McGill University School of Computer Science
McGill University School of Computer Science
Views
You are here: VNC

VNC

From Socs Info Wiki

Use VNC to Run a Virtual Remote Desktop Session

To begin, find a fast machine at Trottier that no one is using...

Lab machine names to select from: 

lab1-1 through lab1-16
lab2-1 through lab2-51
lab6-1 through lab6-25
lab7-1 through lab7-28

Check lab reservations page (http://www.cs.mcgill.ca/reservations) to confirm that there isn't a  class going on in the lab that you selected.

Next, open a terminal and connect to your remote lab machine over ssh, and run the following command:

remotehost% vncserver 
(You will prompted for a session passwd --- do NOT use socs password as vnc is insecure)

The first time the above command is run , it will create ~/.vnc with the following files:

local_hostname:1.log
local_hostname:1.pid
passwd
xstartup
Note: xstartup controls your vnc environment.

Now, if wanted to to change windows manager, you need to edit the file ~/.vnc/xstartup as follows:

 #!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
startxfce4&

In order for changes to be observed, run the following:

remotehost% vncserver -kill :1  (kills vncserver) 
remotehost% vncserver  (You shouldn't now be prompted for passwd)

Next, from your local machine, run tsclient and use the following:

Computer: ${remote_host_machine}:5901   (for example lab6-1.cs.mcgill.ca:5091)
protocol vnc
Note: In order to connect, you will next be prompted for your vnc session passwd.

IMPORTANT NOTE:

Your vnc session will continue to run on this remote host until you kill it manually. 
Implication: you can connect to your session at a later date with no interuption.