-
Notifications
You must be signed in to change notification settings - Fork 1
How to VNC into computers in Glen's lab
If you prefer not using SSH-based development tools (plain old terminal / VSCode / some other solution) and prefer using a graphical interface, you can instead interact with the machines through VNC.
First setup your SSH access with this guide.
Once your SSH access to the desired server is in place, you can setup the VNC server.
tightvncserver
, xfce4
, xfce4-goodies
are required on the server for this setup to work; if typing them into a terminal yields a command not found, you need to install them. These should already be installed on green
and blue
. If not, sudo apt install
them. When installing xfce4
, choose gdm3
as the window manager.
On the first run, launching the VNC server will ask you to setup a password, and generate some configuration files you will edit later. Type in:
vncserver
And setup a main password. You do not need a view-only password.
Start by killing the server; the server needs to restart for changes to apply:
vncserver -kill :1
Here, :1
specifies we are killing window 1. Go to ~/.vnc
, and use a text editor to add the following line to the very end of xstartup
:
startxfce4
In order to connect to the VNC server, we will bridge traffic from the server to the client. This will need to be done every time you wish to connect to the VNC server. Use the following command to create the SSH tunnel (from the client):
ssh -L 5900:localhost:5901 -C -N $SSH_ALIAS_TO_LAB_MACHINE
This forwards port 5901 of the server to port 5900 of the client.
Launch the VNC server in local mode using:
vncserver -localhost
Use the VNC client of your choice to connect to the machine. Tada!
If you are on macOS, you have a built-in VNC client you can access through Finder > Go > Connect to server > vnc://localhost
.
Much of this short guide was put together using information from this page.