Setup VNC and RDP on Ubuntu 16.04

If you need to setup VNC and/or RDP on your Ubuntu system, you can do it.

Original instructions came from hiroom2.com, but I modified these instructions to work for my setup:

https://www.hiroom2.com/2016/05/24/ubuntu-16-04-remote-connect-to-gnome-classic-desktop-with-vnc-xrdp/#sec-5

Download the libraries you need:

sudo apt remove -y vnc4server tightvncserver
sudo apt install -y git and devscripts
sudo apt install -y gnome-panel metacity

You will need to download and compile from source:
(yes, you need these double folders)

cd ~/source
mkdir tigervnc
cd tigervnc
git clone https://github.com/TigerVNC/tigervnc
cd tigervnc

This seems to be the specific build that was working:

git checkout 044e2b87da7121ef6cbd59e88b101d7d8e282896 \
-b 044e2b87da7121ef6cbd59e88b101d7d8e282896

Now we do the build:

ln -s contrib/packages/deb/ubuntu-xenial/debian

sudo apt install -y $(grep Build-Depends: debian/control | \
sed -e 's/Build-Depends://g' -e 's/([^\)]*)//g' -e 's/,//g')

chmod a+x debian/rules
fakeroot debian/rules binary

Now install the deb packages:

cd ..
sudo dpkg -i *.deb || (sudo apt -f install -y; sudo dpkg -i *.deb)
cd ..

Install GNOME:

sudo DEBIAN_FRONTEND="noninteractive" apt install -y gnome

echo "gnome-session-classic" > ~/.xsession

mv ~/.vnc/xstartup ~/.vnc/xstartub.bak

vncpasswd

RDP Installation:

sudo apt install -y xrdp
sudo systemctl enable xrdp

If you are running this in a VirtualBox, you will need to do some port forwarding:

Default VNC port: 5901
VirtualBox port: 15901 (or whatever)

Default RDP port: 3389
VirtualBox port: 13389 (or whatever)

One thought on “Setup VNC and RDP on Ubuntu 16.04

  1. I am trying to install tigervnc on Linux Mint Mate 18.2

    I have followed your instructions to the letter. But ‘fakeroot debian/rules binary’ ends with an error saying:

    “No package ‘xfont’ found”

    I have searched the Internet, but there does not seem to exist a solution to that error.

    Would you, by any chance, know what to do?

    Thank you.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.