Ubuntu 16.04: Remote connect to GNOME Classic Desktop with VNC/XRDP

This article will describe installing tigervncserver and connecting to GNOME Classic Desktop with VNC and XRDP. And remote connect to GNOME3 with tightvncserver will cause aborting. Please see here for connecting Unity. 

1 Preparation

Remove vnc4server and tightvncserver. You can also switch vncserver to tigervncserver with update-alternatives command.

$ sudo apt remove -y vnc4server tightvncserver

Install git and devscripts.

$ sudo apt install -y git and devscripts

Install packages for GNOME Classic Desktop.

$ sudo apt install -y gnome-panel metacity

2 Install tigervncserver

tigervnc repository already has a devscripts files for Ubuntu 16.04.

Download tigervnc from repository. Checkout with hash which was used by this article.

$ mkdir tigervnc
$ cd tigervnc
$ git clone https://github.com/TigerVNC/tigervnc
$ cd tigervnc/
$ git checkout 044e2b87da7121ef6cbd59e88b101d7d8e282896 \
-b 044e2b87da7121ef6cbd59e88b101d7d8e282896

Move devscripts files to the top of directory with symbolic link.

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

Install packages for building tigervnc.

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

Build tigervnc.

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

Install deb files while installing depend package with running "apt -f install".

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

3 Install GNOME

Install gnome package. Use lightdm because gdm3 does not work correctly. You can skip gdm3 interactive setting with setting DEBIAN_FRONTEND to noninteractive.

$ sudo DEBIAN_FRONTEND="noninteractive" apt install -y gnome

4 ${HOME}/.xsession

Run gnome-session-classic.

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

5 Run VNC server

Create password with vncpasswd.

$ vncpasswd
Would you like to enter a view-only password (y/n)? n

Run vncserver. Remote access port is 5900 + display nummber. A port of below example is 5901.

$ vncserver

New 'ubuntu-16:1 (hiroom2)' desktop is ubuntu-16:1

Starting applications specified in /home/hiroom2/.vnc/xstartup
Log file is /home/hiroom2/.vnc/ubuntu-16:1.log

Connect to vnc://<server>:5901 with remote vnc client. Input password and connection will be completed as below.


6 Run XRDP server

Install and run xrdp.

$ sudo apt install -y xrdp
$ sudo systemctl enable xrdp
$ sudo systemctl restart xrdp

Connect to xrdp with rdesktop or "Remote Desktop" on Windows. Input username and password, and connection will be completed.