Install XFCE graphical desktop & VNC on an Ubuntu 24.04 instance

Create an instance and connect to it via SSH to run the commands below.

sudo apt update sudo apt install xfce4 xfce4-goodies sudo apt install dbus-x11 sudo apt install tigervnc-standalone-server

Bonus: install Google Chrome (there is no default browser)

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo apt install ./google-chrome-stable_current_amd64.deb

Configure the VNC server

vncserver

Configure the xstartup file (may need to be created)

we ~/.vnc/xstartup

and enter the content below

#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS startxfce4
chmod +x ~/.vnc/xstartup

Create this file

sudo vi /etc/systemd/system/vncserver@.service

and insert the content below (replace your_user)

[Unit] Description=Start TigerVNC server at startup After=syslog.target network.target [Service] Type=simple User=your_user Group=your_user WorkingDirectory=/home/your_user PIDFile=/home/your_user/.vnc/%H:590%i.pid ExecStartPre=-/bin/sh -c "/usr/bin/vncserver -kill :%i > /dev/null 2>&1" ExecStart=/usr/bin/vncserver -fg -depth 24 -geometry 1920x1080 -localhost no :%i ExecStop=/usr/bin/vncserver -kill :%i [Install] WantedBy=multi-user.target
sudo chmod +x /etc/systemd/system/vncserver@.service sudo systemctl daemon-reload sudo systemctl enable vncserver@1.service vncserver -kill :* sudo systemctl start vncserver@1 sudo systemctl status vncserver@1

It is now possible to connect to vnc://serverns_ip:5901 with a VNC client or on MacOS: Finder > Go > Connect to server

We use cookies.