Starting and stopping the VNC server
Normally, there is nothing to do for the students
in this regard – the VNC servers should
remain running for the duration of the semester.
For the lab supervisors (and in case there are problems)
we provide instructions for starting and stopping the
VNC servers below.
Starting a VNC server
In the following example, we assume that we want to start the
VNC server for the star formation lab on ltsp11.
Use ssh to connect to the lab computer as the appropriate user.
If you are connecting from outside the Munich university network,
you will have to establish a VPN tunnel first
(or use an equivalent SSH tunnel).
bash$ ssh starform@ltsp11.usm.uni-muenchen.de
Password:
Last login: Fri Apr 9 15:48:22 2021 from 129.187.203.22
Have a lot of fun...
starform@ltsp11:~>
Check whether a VNC server is already running.
If it is, but you cannot connect to it, stop the VNC server first,
as shown below in “Stopping a VNC server”.
Note that stopping the VNC server kills all programs running on the
remote desktop, so first make sure that the remote desktop is not
being used (you might be the only one unable to connect).
starform@ltsp11:~> vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESS ID
starform@ltsp11:~>
Then, start the VNC server:
starform@ltsp11:~> PATH=/usr/local/bin:/usr/bin:/bin
starform@ltsp11:~> rm ~/.vnc/passwd
starform@ltsp11:~> vncserver -geometry 1600x1200
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
New 'ltsp11:1 (starform)' desktop is ltsp11:1
Creating default startup script /usr/users/starform/.vnc/xstartup
Creating default config /usr/users/starform/.vnc/config
Starting applications specified in /usr/users/starform/.vnc/xstartup
Log file is /usr/users/starform/.vnc/ltsp11:1.log
starform@ltsp11:~>
Take note of the display number assigned to your VNC server
(in the example above, the :1 shown in blue).
Note 1: Setting the path to something sane before starting the server
can prevent session startup errors.
Note 2: The password will be saved to ~/.vnc/passwd ,
and you will not be asked for a new password if this file already exists.
It is advisable to remove the file (if it exists) before starting the server,
unless it was created by one of your own sessions and you know
the password.
Note 3: Choose a remote desktop size that also works
for the participant with the lowest screen resolution.
Even if you have a high-resolution display, a large remote desktop
means that more pixels have to be transferred over the network.
A setting of
-dpi 72 -geometry 1152x864 is okay for a local
2736 × 1824 display
with 200% screen scaling.
This is important if you are using the x2go client
to connect to the VNC server (possible, but not recommended).
If you are using the VNC client to connect (recommended),
this is not critical, since the VNC client allows
dynamic resizing of the desktop.
You can then log off again, the VNC server will keep on running.
starform@ltsp11:~> exit
logout
Connection to ltsp11 closed.
Stopping a VNC server
List the running VNC servers and note the corresponding display
number (blue in the example below).
Use this display number to select the VNC server to be stopped.
starform@ltsp11:~> vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESS ID
:1 2020
starform@ltsp11:~> vncserver -kill :1
Killing Xvnc process ID 2020
starform@ltsp11:~>
Done!
|