Windows
You can operate VNC Connect programs from the graphical desktop in the standard way for Windows applications, or alternatively from the command line.
*By default, VNC Server in Service Mode starts automatically when the computer is powered on. You can change this from the Microsoft Services snap-in.
Operating VNC Server at the command line
By default, VNC Server is installed in C:\Program Files\RealVNC\VNC Server.
Note that commands for VNC Server in Service Mode must be run from an Administrator Command Prompt (right-click Start > All Programs > Accessories > Command Prompt and select Run as administrator).
Operation | Mode | Command |
---|---|---|
Start VNC Server | User | vncserver.exe |
Service | vncserver.exe -start | |
Reload license keys and parameters without stopping | User | vncserver.exe -reload |
Service | vncserver.exe -service -reload | |
Get help | User | vncserver.exe -help |
Service | vncserver.exe -service -help | |
Stop VNC Server | User | vncserver.exe -stop |
Service | vncserver.exe -service -stop |
If you installed VNC Viewer, then it will be in C:\Program Files\RealVNC\VNC Viewer by default.
If you downloaded standalone VNC Viewer, perhaps because you didn’t have administrative privileges to install, then it can just be run from the download location.
Operation | Type | Command |
---|---|---|
Start VNC Viewer | Standalone | <download-file>.exe |
Installed | vncviewer.exe | |
Start VNC Viewer and establish a direct connection | Standalone | <download-file>.exe <computer> |
Installed | vncviewer.exe <computer> | |
Get help | Standalone | <download-file>.exe -help |
Installed | vncviewer.exe -help |
Mac
You can operate VNC Connect programs from the graphical desktop in the standard way for Mac applications, or alternatively from the command line.
By default, VNC Server in Service Mode starts automatically when the computer is powered on. Stop VNC Server to prevent this; your change is remembered.
Operating VNC Server at the command line
By default, VNC Server is installed in /Applications/RealVNC (denoted by <dir> below).
Note that commands for VNC Server in Service Mode must be run with elevated privileges, for example using sudo.
Operation | Mode | Command |
---|---|---|
Start VNC Server | User | /Library/vnc/vncserver-root |
Service | <install-dir>/VNC\ Server.app/Contents/MacOS/vncserver_service | |
Reload license keys and parameters without stopping | User | /Library/vnc/vncserver -reload |
Service | /Library/vnc/vncserver -service -reload | |
Get help | User | /Library/vnc/vncserver -help |
Service | /Library/vnc/vncserver -help | |
Stop VNC Server | User | /Library/vnc/vncserver -stop |
Service | /Library/vnc/vncserver -service -stop |
Operating VNC Viewer at the command line
VNC Viewer is a disk image that you can ‘install’ by dragging it to the Applications folder.
Operation | Command |
---|---|
Start VNC Viewer | /Applications/VNC\ Viewer.app/Contents/MacOS/vncviewer |
Start VNC Viewer and establish a direct connection | /Applications/VNC\ Viewer.app/Contents/MacOS/vncviewer <computer> |
Get help | /Applications/VNC\ Viewer.app/Contents/MacOS/vncviewer -help |
Linux
You can operate some VNC Connect programs from the graphical desktop in the standard way for your Linux distribution. Others must be operated from the command line.
Operating VNC Server at the command line
By default, VNC Server is installed in /usr/bin or /usr/local/bin. Note that:
- Commands for VNC Server in Service Mode must be run with elevated privileges, for example using sudo.
- For VNC Server in Virtual Mode, the vncserver symlink can be substituted for vncserver-virtual.
Operation | Mode | Command |
---|---|---|
Start VNC Server | Service | systemctl start vncserver-x11-serviced.service #systemd /etc/init.d/vncserver-x11-serviced start #initd |
User | vncserver-x11 | |
Virtual | vncserver-virtual | |
Virtual daemon | systemctl start vncserver-virtuald.service #systemd /etc/init.d/vncserver-virtuald start #initd |
|
Start VNC Server at every boot | Service | systemctl enable vncserver-x11-serviced.service #systemd update-rc.d vncserver-x11-serviced defaults #initd |
User | invalid operation | |
Virtual | invalid operation | |
Virtual daemon | systemctl enable vncserver-virtuald.service #systemd update-rc.d vncserver-virtuald defaults #initd |
|
Reload license keys and parameters without stopping | Service | vncserver-x11 -service -reload |
User | vncserver-x11 -reload | |
Virtual | DISPLAY=:<display-number> Xvnc -reload | |
Virtual daemon | invalid operation | |
Get help | Service | vncserver-x11-serviced -help and man vncserver-x11-serviced |
User | vncserver-x11 -help and man vncserver-x11 | |
Virtual | vncserver-virtual -list and man vncserver-virtual | |
Virtual daemon | vncserver-virtuald -help and man vncserver-virtuald | |
Stop VNC Server | Service | systemctl stop vncserver-x11-serviced.service #systemd /etc/init.d/vncserver-x11-serviced stop #initd |
User | vncserver-x11 -stop | |
Virtual | vncserver-virtual -kill :<display-number> | |
Virtual daemon | systemctl stop vncserver-virtuald.service #systemd /etc/init.d/vncserver-virtuald stop #initd |
|
Prevent VNC Server starting at boot | Service | systemctl disable vncserver-x11-serviced.service #systemd update-rc.d vncserver-x11-serviced disable #initd |
User | invalid operation | |
Virtual | invalid operation | |
Virtual daemon | systemctl disable vncserver-virtuald.service #systemd update-rc.d vncserver-virtuald disable #initd |
Operating VNC Viewer at the command line
If you installed VNC Viewer, then it will be in /usr/bin or /usr/local/bin by default.
If you downloaded standalone VNC Viewer, perhaps because you didn’t have administrative privileges to install, then you must make the file executable before it can be run from the download location.
Operation | Type | Command |
---|---|---|
Start VNC Viewer | Standalone | ./<download-file> |
Installed | vncviewer | |
Start VNC Viewer and establish a direct connection | Standalone | ./<download-file> <computer> |
Installed | vncviewer <computer> | |
Get help | Standalone | ./<download-file> -help |
Installed | vncviewer -help |
Comments
When I log out of my Raspberry Pi using RealVNC viewer my PC then displays a rotating wheel and the message "attempting to reconnect to VNC server VNC server exited" and I can't get to the VNC interface to exit - instead I have to use Ctrl + Alt + Del to sign out and then sign back in to my PC. Pretty clunky - is there a keystroke sequence in VNC viewer to exit?
Please sign in to leave a comment.