X2Go Server on Centos 7.3 Virtual Machine in Azure

x2go centos7

I just spent a couple of hours to get the X2Go Server on Centos 7.3 Virtual Machine in Azure to work and since I will most probably do the same thing again in a couple of months, here is a cheat-sheet.

Feel free to follow it but make sure to replace the IP address and usernames! πŸ™‚

1. Create a CentOS 7.3 Virtual Machine

I personally have a preference for CentOS for anything server related and because I want to avoid mixing up my commands, I keep to CentOS for my GUI driven Linux OS installations as well.

I am using Azure to run this specific VM, but I am pretty certain that this will be identical for other cloud providers. However, I did not do any test on anything other than Azure.

I am not going to explain to much here since there are plenty of tutorials on this subject already. Basically, just search for the “CentOS-based 7.3” (the most recent available version at the time of writing) VM i the “Compute” section. This image is maintained by OpenLogic and performs pretty well n my experience.

For the configuration of the VM, you can of course make your own choices, but here is what I went with:

  • Step 1
    • Use SSD “Premium” Storage: the VM will be much more stable compared to usung standard HDD storage
    • Always use an SSH public key for internet connected resources. If you use a password, you deserve everything you get! πŸ™‚
  • Step 2
    • Click the “View all” link to see all the possible VM sizes. I went for a DS2_V2 instance, which is faster and cheaper than the DS2 instance.
  • Step 3
    • I selected to use “Managed Disks”; easier and no reason not too, really…
  • Step 4
    • Just click OK to create the VM.

Apart from what I specified above, I went with whatever was set by default.

One the VM is created, go to the VM information to find the IP address. You will need it in the next steps.

2. Update OS and install EPEL repository

Before you can install the X2Go server package, you need to set up the VM. First thing is to log in to the VM using simple SSH and enable the EPEL repository. I also update the installed OS at this point, just to be sure.

ssh jhon@13.95.218.127
The authenticity of host '13.95.218.127 (13.95.218.127)' can't be established.
ECDSA key fingerprint is 6b:4e:7d:76:e6:ce:93:9d:53:1a:32:60:52:cc:90:d9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '13.95.218.127' (ECDSA) to the list of known hosts.
sudo su -
yum -y update
Loaded plugins: fastestmirror, langpacks
No such command: upadte. Please use /bin/yum --help
[root@MyDesktop ~]# yum -y update
Loaded plugins: fastestmirror, langpacks
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
openlogic | 2.9 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/5): base/7/x86_64/group_gz | 155 kB 00:00:00
(2/5): openlogic/7/x86_64/primary_db | 18 kB 00:00:00
(3/5): extras/7/x86_64/primary_db | 139 kB 00:00:00
(4/5): base/7/x86_64/primary_db | 5.6 MB 00:00:00
(5/5): updates/7/x86_64/primary_db | 3.8 MB 00:00:00
Determining fastest mirrors
Resolving Dependencies
--> Running transaction check
<...much output removed here...>
 xfsprogs.x86_64 0:4.5.0-9.el7_3

Complete!
yum -y install epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-9 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================
 Package Arch Version Repository Size
=======================================================================
Installing:
 epel-release noarch 7-9 extras 14 k

Transaction Summary
=======================================================================Install 1 Package

Total download size: 14 k
Installed size: 24 k
Downloading packages:
epel-release-7-9.noarch.rpm | 14 kB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : epel-release-7-9.noarch 1/1
 Verifying : epel-release-7-9.noarch 1/1

Installed:
 epel-release.noarch 0:7-9

Complete!

3. Install X2GO

Now that the OS is up to date, install the S2Go server packages from the EPEL repository:

yum -y install x2goserver-xsession

This installed about 62 packages in total for me.

4. Install KDE desktop

NOTE: X2GO did not work with Gnome. I tried many avenues bit it just did not work. KDE on the other hand worked immediately. I strongly recommend not to try Gnome, but if you do and you got it to work, I would be very interested to know how you did it!

yum -y groupinstall 'KDE' 'X Window System'

This installed about 522 packages. And yes, it takes a few minutes.

Next step is to make sure that KDE is started at boot time. In earlier versions of Linux this meant you had to set the default runlevel to 5, but in this “systemd” era, you need to use systemctl:

systemctl set-default graphical.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/graphical.target.

Now would be a good time to reboot the VM. It is not mandatory, but at this point, it feels like a good idea to me:

reboot

5. Set up the X2Go session in the client

Of course, for tis step, I am assuming you installed the X2Go client software. For client downloads, go toΒ http://wiki.x2go.org/doku.php.

In the client, create a new session, use the correct IP address and add your username and private SSH key. Set the Session Type to “KDE”.

Under the “Input/Output” tab I also set a custom Display resolution. THis is not really necessary since the client desktop window can be resized with simple “corner drag and drop”.

What I did need to do was to set the display dpi to something sensible like 120 because on my Surface 4, the fonts were ridiculously sized if I did not.

6. Get rid of “color managed device” authorization dialogs

When you connct to the VM using your X2Go client, you;ll probably find yu need to enter the root password six times to authorize the “color managed dialogs”, which is a bore.

There is not solution here, but the following workaround works perfectly: (you need to be root for this)

vim /etc/polkit-1/rules.d/02-allow-colord.rules

Add the following to that file:

polkit.addRule(function(action, subject) {
 if ((action.id == "org.freedesktop.color-manager.create-device" ||
 action.id == "org.freedesktop.color-manager.create-profile" ||
 action.id == "org.freedesktop.color-manager.delete-device" ||
 action.id == "org.freedesktop.color-manager.delete-profile" ||
 action.id == "org.freedesktop.color-manager.modify-device" ||
 action.id == "org.freedesktop.color-manager.modify-profile") &&
 subject.isInGroup("wheel")) {
 return polkit.Result.YES;
 }
});

Make sure that the group is set to the group your user belongs to. I added my user to the wheel group, so I set it to that. But it can be any group, even the “private user group” of you use that.

 

And that’s it. You should now be able to access the VM using X2GO.

2 thoughts on “X2Go Server on Centos 7.3 Virtual Machine in Azure”

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.

Copyright © 2016 · All Rights Reserved · Jhon's Blog