X2go is a great way of remotely connecting to a headless Ubuntu server (assuming you’re the type of person that wants to manage Ubuntu graphically). In my case my headless Ubuntu is just a hobbyist’s server and I think it’s cheaper to have one hosted for me, than to pay for the electricity and with the added fire risk of hosting a physical server myself. (Except for disk space considerations).
I’ve been using DigitalOcean droplets and I think their control panel is great.
I’m just writing up the steps here, because I’m sure to forget if I need to create another one sometime in the future,
Ubuntu 15.04 now uses systemd. (well that could be another post, because it’s a bit of a kludge it seems to me. But it might be a stepping stone).
1. Create the Ubuntu 15.04 droplet.
2. Ensure you can connect with PuTTY (ssh) or equivalent.
3. Update the droplet with apt-get as per normal.
4. Install Lubuntu. I installed lubuntu.desktop and then removed it as I thought I had problems. I’m sure lubuntu.core is sufficient. [TBA]
5. Now reboot. You’ll see that a graphical login is shown in the DigitalOcean’s console. But it is unusable as the mouse cursor does not align properly.
DigitalOcean’s support don’t help here if you ask, as they say they don’t support graphical droplets.
You can now see why PuTTY must be working! This means SSH is working too.
6. Go to /etc/default and edit grub with nano to this
this puts the droplet into a non-graphical mode on the next reboot.
[TBA. I did a few other things while testing this, but I think this is the key change. I’ll need to update once I’ve repeated this procedure once again]
7. You might as well reboot to see the effect.
Once logged back in again, ps –ef will show the parameters passed to init
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 19:05 ? 00:00:01 /sbin/init 4 4
This run level 4 is supposed to be a custom level same as 3, where 5 is the graphical level we don’t want.
8. Install X2goserver, as follows
sudo add-apt-repository ppa:x2go/stable
sudo apt-get update
sudo apt-get install x2goserver x2goserver-xsession
9. The install process has started the x2goserver already. You can check with
systemctl –l status x2goserver.
But this is where a pure Arch system and Ubuntu differ.
A startup file has been put in /etc/init.d, x2goserver, and Ubuntu’s handling has created a x2goserver.service.
I did a
systemctl enable x2goserver.service
to be consistent and sure!
10. Now try and connect using the X2goclient. I bet it will fail with a “kex error”.
It seems it can be fixed with adding the below to /etc/sshd_config, and restarting sshd or rebooting.
PuTTY has the great feature of a right click paste into nano to avoid typing all this!
11. Set your X2goclient to LXDE of course, and you should be in.