Remote desktop access
Sometimes it is useful to manage the CPU and GPU instances from a visual desktop interface.
Follow these steps to set up a remote desktop environment with VNC server using TigerVNC on Linux systems like Ubuntu 24.04. This setup allows you to remotely access a lightweight graphical desktop on DataCrunch virtual machine instances.
Connect to your instance using SSH
ssh user@INSTANCE_IP_ADDRESS
Update The System
Follow the instructions on Securing Your Instance if you have not done that before
sudo apt update
sudo apt upgrade
Install XFCE Desktop Environment
sudo apt install xfce4 xfce4-goodies
Install TigerVNC Server
sudo apt install tigervnc-standalone-server tigervnc-common
Set Up VNC Password and Initial Configuration
Start the VNC server to set your access password and create initial configuration files:
vncserver
You will be prompted to set a password for VNC access.
Configure VNC to Use XFCE
Stop the VNC server to edit the startup configuration:
vncserver -kill :1
Edit (or create) the ~/.vnc/xstartup file:
vi ~/.vnc/xstartup
Replace its contents with:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &
Make the script executable:
chmod +x ~/.vnc/xstartup
Start the VNC server again (for example, on display :1):
vncserver :1
Now your instance has and VNC server running and is ready for the VNC connection. Next commands are run on the machine that you want to use for viewing and controlling the desktop.
Create an SSH tunnel to secure the VNC connetion
Run this command on the machine that you will use to connect to your instance. If you want to keep the SSH tunnel connection in the background, you can use screen
or tmux
commands.
ssh -L 5901:localhost:5901 username@REMOTE_IP
Connect Using a VNC Client
Use any VNC viewer (e.g., TigerVNC Viewer, RealVNC, or Remmina) and connect to localhost:5901.
Tips
You can change the vnc ports and make multiple connections, they will get assigned different ports 5901, 5902 etc..
You can also use other compatible Linux desktop environments like Ubuntu Desktop (Gnome), KDE Plasma on the instances. XFCE Desktop is recommended for most users since it is lightweight and simple to use without much configuration and works with default DataCrunch OS images.
Last updated
Was this helpful?