Instructions for use of Virtual Network Computing

Nikola Baran

1 Introduction

Virtual Network Computing (VNC)1 allows you to use a remote machine as if your screen, keyboard and mouse are connected to the machine itself. It streams video from the remote server to your computer with compression, and other smart algorithms that reduce bandwidth requirements. However, it is still heavy but far from impossible to be practically used when on limited speed/bandwidth connection like mobile hotspots, caffe bar WiFi and such. If you are connecting from untrusted internet access points always bear in mind the security of the connection. All processes started within your VNC session are child processes of the vnc4server process. That means that if you kill vnc4server all you had open in that session is lost. On the other side, it is by far better than starting processes from your computers terminal because you can safely close the VNC (closes the video stream/interaction only), shut down your computer, or run out of batteries, and all you have started still runs safely on the remote server. Next time you access your VNC session it is still there. Since, in a way, you are working on the server itself, all keyboard shortcuts are inherited from the servers (OS). That can be a bit con- fusing when accessing the server from Mac computers (ctrl+v-¿cmd+v, middle button paste functionality on )

2 Procedure for running VNC

0) Connect to internet.

1) Download a (free) VNC client app like this one: https://www.realvnc.com/download/vnc/

2) Install the downloaded app

3) Open a terminal on your Mac/Linux, or i.e. Putty2 on Windows

1https://en.wikipedia.org/wiki/Virtual Network Computing 2http://www.chiark.greenend.org.uk/∼sgtatham/putty/

1 4) Login to server: ssh -X [email protected] enter your password for that server.

5) On both servers vnc4 is installed. Start your very own VNC server by typing into terminal: vnc4server :11000 -geometry 1600x900 -depth 24 where :11000 should be TCP port you will use to connect to the server. Choose a port above 10000. For this example let’s use 11000. Choose your own port number and note it. Geometry parameter sets the screen resolution. 1600×900 looks good both on our office screens and laptops, but feel free to find the one that best suits you. Color depth of 24 bit is fine.

5a) You will be prompted by the server to define a password to access your VNC session. Do so.

5b) If you ever wish to close the VNC server type into terminal: vncserver -kill :11000

When you close the VNC server and wish to start it again, return to step 5 and proceed as described. In practice it is rarely needed to kill the VNC server.

6) After you start the VNC server on the remote machine, open your VNC application (in this example realVNC ).

7) Under VNC ”server type” i.e. krampus.phy.hr:16900

Note that with our current server configuration, the port you have chosen when starting VNC server should be added to 5900. For example 11000+5900=16900, thats why we input 16900 into VNC client configuration. Let the client app con- figure encryption (hint: theres none, which is fine for now)

7a) If you want to encrypt the connection you can do so by starting a secure ssh session with the server, forwarding it to local port and then connect the VNC client app to that local port.

8) Click connect

9) Input your password and confirm that you are aware that the connection

2 is unsecured (if so).

10) You now see a grey screen within your computers window. That is your servers screen as it would be displayed if you connected your screen directly to the graphics card of the server machine. You can use keyboard shortcuts to get the terminal if one does not start by default. All graphics, including those graphic windows from AIPS 3, DS9 4, TopCat 5 and such should work fine.

10a) If you wish to have a proper desktop on the server (with toolbars, menus, etc.), edit the VNC startup file like this (feel free to use any text editor available to do the following step): emacs /home/yourusername/.vnc/xstartup

You can delete this files contents and copy/paste the following text into this file:

#!/bin/sh

#export XKL XMODMAP DISABLE=1 unset SESSION MANAGER

#unset DBUS SESSION BUS ADDRESS

#-panel &

#gnome-settings-daemon &

# &

#nautilus &

#gnome-terminal &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic &

3http://www.aips.nrao.edu/ 4http://ds9.si.edu 5www.star.bris.ac.uk/ mbt/topcat/

3 #x-terminal-emulator -geometry 80×24+10+10 -ls -title "$VNCDESKTOP Desktop" & x-window-manager & lxterminal &

/usr/bin/lxsession -s LXDE &

#gnome-panel &

#exec gnome- &

#xterm &

#xterm &

- Save the startup file. - Kill your VNC server as described in 5b) and start it again as described in 5). If you wish to use the same port it is fine. Now the proper desktop should appear and it will appear every time you start your VNC server.

3 Notes

Servers need a maintenance restart from time to time. After reboot you will have to start your VNC session from scratch. Make sure to notify your system administrator of your activities on the server (or the lack of) when the need to restart the server arises. The server should be restarted when all work is saved and we all give a green light. If you happen to forget the port your VNC server is listening, login to server as in 4) and type lsof -i -P | grep -i listen" The TCP port listed in the terminal output of this command is the one you should use for logging into your VNC session as in 7)

4