← Back to blog
Quick VNC server setup in ubuntuPhoto via Unsplash
Linux

Quick VNC server setup in ubuntu

How to backup VM images in linux. Learn how to backup and restore VM images.

Suyash Singh
Suyash Singh
1 min read

These commands will spin up a vnc server quickly. Ensure you have a desktop environment, let's go with xfce in this case

$ sudo apt install xfce4 xfce4-goodies

Install a vnc server - tigervnc in this instance

$ sudo apt install tigervnc-standalone-server tigervnc-common tigervnc-tools

Setup a password for vnc

$ vncpasswd

Setup the context for vncserver

$ vi ~/.vnc/xstartup 
#!/bin/sh
# Start up the standard system desktop
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
/usr/bin/startxfce4
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
x-window-manager &

Start the vnc server

$ vncserver -localhost -geometry 1920x1080 -depth 24

Now you can utilize ssh local port forward tunneling to access the vnc server remotely. Follow this post, to learn how.