How To Install A Desktop And Vnc On

Sep 30, 2021 VPS Server

How To Install A Desktop And VNC On Ubuntu 16.04

Reading Time: 2 minutes

As you know, VNC is a protocol that allows sharing the desktop and is controlled remotely over the internet. With VNC you can use a graphical desktop environment remotely. This simple article will help you install and configure the graphical desktop environment and VNC on your Ubuntu 16.04 server.

Before You Begin

Update your system using the following command.

sudo apt-get update && sudo apt-get upgrade -y

Install Ubuntu Desktop on Your Instance

We’re going to install the Unity desktop GUI on our Ubuntu Server, which is the default desktop environment of Ubuntu. To install it along with a few other packages which are required for the graphical interface to function properly, run the following command.

sudo apt-get install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

During the installation, you might be asked whether you want to change a system file to a new version. Type y and then press enter to use the updated version.

Install and Configure a VNC Server

There are several VNC servers to chose from. We’re going to install vnc4server.

sudo apt-get install vnc4server

Now test the VNC server by starting a session.

vncserver :1

You will be prompted for a password. Set any password you like. You should now be able to connect using a VNC client. But you’ll see a gray screen instead of the desktop. We need to configure VNC to launch the full Unity desktop when it starts. To do it, first kill the VNC session.

vncserver -kill :1

Now edit the file ~/.vnc/xstartup to match the configuration given below. Start by opening the file on an editor. Before we begin configuring the new xstartup file, let’s back up the original.

Note: This file will only be created when you start a VNC session for the first time.

Now create a new xstartup file with nano or your favorite text editor.

nano ~/.vnc/xstartup

Now edit the end of the file to match it with the below configuration.


# Uncomment the following two lines for normal desktop:
# exec /etc/X11/xinit/xinitrc

[ -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 &

Save the file by pressing ctrl + o and exit by pressing ctrl + x and then pressing enter.

Now launch a VNC session again.

vncserver :1

You can now use a VNC client/viewer to connect to your computer remotely and use it. The following is your address which you need to enter when connecting.


And the password will be what you set earlier when first launching the VNC session.

Ubuntu Desktop All Features Review on Linux VPS, RDP Solution on Linux

Here is Some Free VNC Clients Link:


Leave a Reply

Your email address will not be published. Required fields are marked *