Remote Desktop to Lab Workstations - theunissenlab/lab-documentation GitHub Wiki

You can use TeamViewer for free, but they seem to be getting more strict with their license. Alternative is to set up remote desktop on ubuntu. ONLY USE THIS WITHIN THE VPN, DO NOT EXPOSE TO INTERNET DIRECTLY.

Setting up Remote Desktop VNC Server on Ubuntu

1 Installing requirements

on the server:

sudo apt-get update sudo apt install xfce4 xfce4-goodies tightvncserver

2 Set server password

once these are installed run:

vncserver

this will prompt you to set a password, this will be the future vnc password for this machine. It will say New 'X' desktop is <server>:<number> It should start a server on ":" this is usually 1 or 2.

3 Set up vncserver

this next step will require changing some settings in vncserver so first we want to kill our running server

vncserver -kill :<vncnumber>

This stops the vnc server. Make a backup of the startup script so that if all else fails we can get back to square 1.

mv ~/.vnc/xstartup ~/.vnc/xstartup.bak

Now we will make another, first open the startup script with vim (or some other editor)

vim ~/.vnc/xstartup

Make the contents of the file:

#!/bin/bash
# Look 1: xfce4, basic blue look
xrdb $HOME/.Xresources
export XDG_CONFIG_DIRS=/etc/xdg
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

## Look 2: gnome, a bit more complex
#[ -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 &
#gnome-panel &
#gnome-settings-daemon &
#metacity &
#nautilus &

There are two looks available, Look 1, a simple xfce look. Not resource hungry and optimized for remote connection. Look 2 is a gnome look, closer to the unity desktop that we have standard on the computers in lab, at the cost of more resources.

touch ~/.Xresources

this will create an empty file if the file does not exist. We now need to make sure we can execute the xstartup script. To do that run the following command

chmod +x ~/.vnc/xstartup

now you can start your server. Run the command

vncserver

After running this command it will tell you what number the server is being run on New 'X' desktop is <server>:<number>. The port that it is run on is 5900 + <vncnumber>

3 Connecting to the server

Now the vncserver is running on port 5900 + <vncnumber> which is usually 5901 or 5902 on your local machine.

Connect from Mac

  • Connect to VPN

  • From Finder's menu, go to Go > Connect to Server... (or Cmd+K)

  • Put in the remote server address from above (e.g. vnc://<hostname>:<port_number> where <port_number> is 5900 + <vncnumber>)

Connect from Windows

Old notes (for reference)

Remote Desktop (to Ubuntu)

  • Go to Settings > Sharing > Turn on Screen Sharing (if you can't find that, try searching for the program Desktop Sharing)

  • Set it to be password protected on the network, turn off the option that says you must confirm each access to this machine (otherwise you have to confirm incoming connections while physically at the computer)

  • Note down the server address (if you don't see it, its of the form vnc://<hostname>).

  • In terminal, type gsettings set org.gnome.Vino require-encryption false. This is required to connect from Mac and Windows. It makes encryption optional, which makes it doubly important to only use this through our VPN.

  • If you get compatibility issues when connecting, try this: https://gerard.wordpress.com/2014/11/23/fix-screen-sharing-mac-os-x-ubuntu/

  • If you are still getting issues, set up remote desktop using Xtightvnc by following the instructions here, then add a port to the commands below (5900->5910 depending on your vncport)

⚠️ **GitHub.com Fallback** ⚠️