Setting up VNC ServerArticle ID: 81
ON THIS PAGE
RESOLUTION
Setting up VNC Server for a user account
- To start using VNC Server and create a VNC server session, make sure you are logged into shell and insert the following command:
vncserver
- If this is your first time running the command, you will be asked to enter a password. This will be the password you will use to access the desktop and then it will output the following message. Otherwise, the command will immediately output the following without asking for a password as you have set it up before
New 'linuxshell.picrofo.com:2 (ricardo)' desktop is linuxshell.picrofo.com:2
where linuxshell.picrofo.com is the host name and :2 is the display number. - To access the desktop, we will need a VNC viewer to connect first. RealVNC Viewer is recommended, but you may as well use your favorite one! To download RealVNC Viewer, click here to pick up the one suitable for your platform
- To connect, open your VNC viewer and insert the host name followed by the display number in the VNC Server field and connect to access the desktop of your account. (e.g Insert linuxshell.picrofo.com:2 in the VNC Server field; where linuxshell.picrofo.com is the host name and :2 is the display number)
- You should be asked to enter a password to access the desktop after clicking to connect, enter the password you have set up previously when setting up VNC server for the first time and it shall log you in!
Changing your VNC password
- Make sure you are logged into shell and insert the following command to change your default VNC password:
vncpasswd
- Finish by entering the new password you would like to use for VNC and then by confirming it when asked
Listing VNC server sessions for a user account
- To view a list of opened VNC Server sessions, make sure you are logged into shell and type the following command:
vncserver -list
- You should receive an output similar to
TigerVNC server sessions: X DISPLAY # PROCESS ID :2 10688
This indicates that an active VNC server session on display number :2 with the process ID 10688 is associated with your account.
Killing a VNC server session for a user account
- To kill a VNC session by its display number, make sure you are logged into shell and type the following command:
vncserver -kill $DISPLAYNUMBER
where $DISPLAYNUMBER is the display number of the active VNC server session you would like to terminate. (e.gvncserver -kill :2
where :2 is the display number of the VNC server session desired to terminate)
Did you find this helpful?