Ubuntu Cloud Desktop with X2Go
This guide is using X2Go as an alternative to VNC (or noVNC) for accessing remote Ubuntu Desktop as described in the previous article. Similar to VNC, X2Go is an open-source remote desktop software that enables access to a Linux graphical desktop over the network. However, X2Go uses a modified NX 3 protocol and is tunneled through the Secure Shell protocol (SSH), so it is encrypted and secured. Additionally, it is optimized for bandwidth requirements that work well over both low bandwidth and high bandwidth connections, making it possible to handle multiple user sessions. For more information on its features and capabilities, please visit X2Go Wiki.
Prerequisites
X2Go tunnels over SSH, it is mandatory that it is installed and properly configured. Cloud Linux server uses SSH as the standard method for remote access so it is already provisioned. However, for security reasons, X2Go requires that you utilize SSH public key authentication instead of password credentials. More detail information on installing and securing SSH server can be found in this tutorial.
The next requirement is, of course, the Linux desktop environment. See the previous article. One benefit of X2Go is that you can install more than one desktop environment in the cloud server and you can select and change which one to use from the X2Go client.
LXDE
To install LXDE, run the following commands in your cloud server’s terminal:
$ sudo apt-get update
$ sudo apt-get install lxde
XFCE
To install Xfce, run the following commands in your cloud server’s terminal:
$ sudo apt-get update
$ sudo apt-get install xfce4 xfce4-goodies
MATE Desktop
To install MATE, run the following commands in your cloud server’s terminal:
$ sudo apt-get update
$ sudo apt-get install ubuntu-mate-core
Installing X2Go Server
Run the following commands in your cloud server’s terminal:
$ sudo apt-add-repository ppa:x2go/stable
$ sudo apt-get update
$ sudo apt-get install x2goserver x2goserver-xsession
Additionally, you also need to install the X2Go Desktop Binding which depends on the desktop environment that you will use.
For LXDE, install this binding:
$ sudo apt-get install x2golxdebindings
For MATE
$ sudo apt-get install x2gomatebindings
There is no binding for XFCE so you don’t need to install any.
Installing and setting up X2Go Client
The X2Go clients need to be installed on local machines that shall access cloud desktop running X2Go Server.
For Ubuntu/Debian:
$ sudo apt-get update
$ sudo apt-get install x2goclient
For other Linux distro, MS Windows and Mac OS, please read this instruction.
When you first open the X2Go client, the following window should appear.
- In the Session name field, enter any unique name to differentiate the session setting.
- Enter your cloud server’s IP address or hostname in the Host field under Server.
- Enter the username you used for your SSH connection in the Login field.
- Since you will log into the server with SSH keys instead of password credential, click the folder icon next to Use RSA/DSA key for ssh connection and browse to your private key. See Prerequisites above.
- In the Session type, select the desktop environment that you installed before: LXDE, XFCE or MATE.
After pressing the OK button, you can connect the session definition by clicking the white box that includes your session name on the top-right side of the screen. You should get a desktop view of the remote host like the window below, this case is using LXDE desktop environment.