VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04

VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04
Customization VNC ΠΈ RDP we have already mastered it on a virtual server, it remains to study one more option for connecting to a Linux virtual desktop. Opportunities created by the company No Machine protocol NX interesting enough, besides, it works well through slow channels. Branded server solutions are expensive (client ones are free), but there is also a free implementation, which will be discussed in this article - the system X2GB. It spun off from an open source project FreeNXwhen NoMachine stopped supporting it and let it float freely.

Table of Contents:

Installing the graphical environment

For a virtual graphical desktop on Linux, powerful machines are not needed until the user starts running application programs. For tests, we will take a strong middling with Ubuntu Server 18.04 LTS with two processing cores, four gigabytes of RAM and a twenty gigabyte hard disk drive (HDD). Ubuntu Server 20.04 LTS images are already available on RuVDS, the setup process for a more recent version will be similar. Don't forget to use promo code Habrahabr10 to get a 10% discount on your order.

VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04

As a desktop environment, we again take XFCE because of the relatively low requirements for computing resources. In addition, there are no problems with running this DE via remote access in virtual environments:

sudo apt-get install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils

Russification of the server and software installation

The next step is to set up localization and install the minimum set of applications: browser, email client and office suite. First, install translations for system programs:

sudo apt-get install language-pack-ru

Set up localization:

sudo update-locale LANG=ru_RU.UTF-8

The same effect can be achieved by manually editing the /etc/default/locale.

To localize GNOME and KDE, the repository contains the language-pack-gnome-ru and language-pack-kde-ru packages - you will need them if you will use programs from these desktop environments. In XFCE, translations are installed with applications. Next, you can install dictionaries:

# Π‘Π»ΠΎΠ²Π°Ρ€ΠΈ для ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΠΈ ΠΎΡ€Ρ„ΠΎΠ³Ρ€Π°Ρ„ΠΈΠΈ
sudo apt-get install hunspell hunspell-ru

# ВСзаурус для LibreOffice
sudo apt-get install mythes-ru

# Англо-русский ΡΠ»ΠΎΠ²Π°Ρ€ΡŒ Π² Ρ„ΠΎΡ€ΠΌΠ°Ρ‚Π΅ DICT
sudo apt-get install mueller7-dict

In addition, the installation of translations may be required for some application programs:

# Π‘Ρ€Π°ΡƒΠ·Π΅Ρ€ Firefox
sudo apt-get install firefox firefox-locale-ru

# ΠŸΠΎΡ‡Ρ‚ΠΎΠ²Ρ‹ΠΉ ΠΊΠ»ΠΈΠ΅Π½Ρ‚ Thunderbird
sudo apt-get install thunderbird thunderbird-locale-ru

# ΠžΡ„ΠΈΡΠ½Ρ‹ΠΉ ΠΏΠ°ΠΊΠ΅Ρ‚ LibreOffice
sudo apt-get install libreoffice libreoffice-l10n-ru libreoffice-help-ru

На этом ΠΏΠΎΠ΄Π³ΠΎΡ‚ΠΎΠ²ΠΊΠ° окруТСния Ρ€Π°Π±ΠΎΡ‡Π΅Π³ΠΎ стола Π·Π°Π²Π΅Ρ€ΡˆΠ΅Π½Π°.

Installing the X2Go Server

Stable versions of the X2Go server and client can be installed from an external repository PPA (Personal Packages Archive) on Launchpad or from the regular repositories of current Ubuntu releases. We will focus on the second option, since the software versions in both sources are the same, but if you need additional packages, you will have to connect a third-party repository. We need to install two packages:

sudo apt-get install x2goserver x2goserver-xsession

If you are using a MATE or LXDE environment, additional packages are required (they are not needed for XFCE):

sudo apt-get install x2gomatebindings # if you use MATE/mubuntu
sudo apt-get install x2golxdebindings # if you use LXDE/lubuntu

Cherry on the cake: X2Go works via SSH and doesn't need any further configuration. The VPS must be running sshd and allowed access to port 22 in the firewall rules. Since we are talking about a virtual server, this is probably already done out of the box. On a physical machine, it is not difficult to open remote access via SSH. It remains only to check the status of the X2Go server:

sudo systemctl status x2goserver

VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04
It is also worth getting an unprivileged user to work with the desktop environment:

sudo adduser desktopuser

VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04
Let's add the user to the sudo group so that he can perform administration-related tasks. If there is no such need, this step can be skipped:

sudo gpasswd -a desktopuser sudo

Desktop connection

The X2Go client software for Windows, Linux and OS X can be download on Online project. The Android client is under development, and the free mobile apps from NoMachine are not compatible with the X2Go server. If Ubuntu is installed on the local computer, it is enough to add the x2goclient package:

sudo apt-get install x2goclient

In order to preserve species diversity, this time we will take a client for Windows:

VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04
Here you can configure connection settings, I/O devices, and multimedia devices.

VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04
VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04
VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04
If everything is done correctly, the XFCE desktop will appear after connecting.

VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04

Running an application on a remote computer

Sometimes, instead of a full-fledged desktop environment on a remote computer, you need to run a resource-intensive application (for example, an IDE). This is easy to do, just specify the appropriate session type and command in the connection settings.

VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04
VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04
Browser running on a remote Ubuntu VPS

There are also more exotic options for using X2Go: the system allows, for example, to connect to a user session on a remote computer (as in TeamViewer). In this case, both the client and server parts must be installed on both machines. In addition, it is not necessary to set session profiles on each client: you can install and configure x2gobroker to define them on the server. To do this, you will need to connect third party repository with additional packages.

Benefits of X2Go

Unlike the bandwidth-hungry VNC system, X2Go uses the advanced NX 3 protocol to minimize the amount of data transferred. The system has its own X-server, besides, it requires almost no settings and has advanced features. We've covered only the most basic ones, but X2Go can do a lot more, including broadcasting audio and video from the server to the client, printing to a local printer (you will have to install additional packages on the VPS to set up a virtual printer), and shared directories. Interaction with the server goes through a reliable and time-tested sshd - secure authentication mechanisms are available to the user, incl. with keys. X2Go automatically sets up the environment on login (you don't need to keep the X server running all the time), it supports multi-user work and most popular desktop environments, and the session is not killed even after the connection is broken.

VPS on Linux with GUI: Run X2Go Server on Ubuntu 18.04

Source: habr.com

Add a comment