# Running a lightweight GUI on your vps via X2Go



## mikedep333 (May 2, 2014)

Hi, I'm an X2Go developer and my friend introduced me to this forum.

I thought I'd share my alternative to this thread, which uses VNC instead of X2Go.

In my case, I tested it on Amazon EC2's Free Tier with Ubuntu 14.04.

For XFCE4 (ideal for a VPS because it has a small footprint):

1. On Ubuntu, add the X2Go Stable PPA


sudo add-apt-repository ppa:x2go/stable && sudo apt-get update
If you're on Debian, follow these instructions instead to add our apt repo. We have packages for other distros too.

2. Install the XFCE packages and X2Go. Feel free to add other packages, but I purposely kept this selection small.

Installing "x2goserver-xsession" enables X2Go to launch any utilities specified under /etc/X11/Xsession.d/ , which is how a local X11 display or an XDMCP display would behave. This maximizes compatibility with applications.

On Ubuntu:


sudo apt-get install xfce4 xfce4-goodies xfce4-artwork xubuntu-icon-theme firefox x2goserver x2goserver-xsession
On Debian:


sudo apt-get install xfce4 xfce4-goodies xfce4-clipman iceweasel x2goserver x2goserver-xsession

3. No need to open up any additional ports. All X2Go traffic is tunneled over SSH.

4. No need to start any daemon. x2goagent, our "X server", is launched on-demand as a user process when an X2Go Client connects. We do have an "x2goserver" init service, but all it does is clean stale X2Go sessions when you start it, and clean all sessions when you stop it. That's right, an X2Go session stays running after you click the X to disconnect; log out through the desktop's GUIs if you want to end your session.

If you want configure server settings, see /etc/x2go/x2goserver.conf .

5. Install X2Go Client and connect with it. In the X2Go Client "Session Preferences":


Specify "XFCE" as the "Session type."

If you have the SSH key in OpenSSH/PEM format, specify it in "Use RSA/DSA key for ssh connection".
If you have the ssh key in PuTTY .PPK format, convert it using PuTTYgen, and then specify it.
Or even better, just launch Pageant (part of the PuTTY suite,) load the .PPK key in Pageant, then in X2Go Client select "Try auto login (ssh-agent or default ssh key)".
6. Once connected, remember to disable the screensaver because screensavers tend to use lots of CPU. A blank screen is fine of course.

Screenshots:

http://imgur.com/a/KueTO#0



*Things to change if you want to run openbox:*

1. Install openbox (the aforementioned thread has more details.)


sudo apt-get install openbox obconf obmenu menu conky nitrogen
2. When connecting with X2Go Client:


Specify "Custom desktop" as the "Session type". Then Specify "openbox-session" as the "command".


----------



## drmike (May 2, 2014)

Welcome to vpsBoard @mikledep333!  Glad to have you on board.

Umm humor me, I use X2Go, like it a lot.  I am not a power user of it, yet.

Why would using VNC be a preferred alternative to the X2Go client?  Who is the market for the VNC use?

Thanks for the OpenBox how-to part


----------



## mikedep333 (May 2, 2014)

drmike said:


> Welcome to vpsBoard @mikledep333!  Glad to have you on board.
> 
> Umm humor me, I use X2Go, like it a lot.  I am not a power user of it, yet.
> 
> ...


To clarify, X2Go Server needs to be used with X2Go Client. There are multiple implementations of VNC, a VNC server can normally be used with any VNC client.

The main difference between X2Go and VNC is the internal design. We use client-side rendering, they use server-side rendering. I could go into low-level details.

The advantages/use cases for VNC  that I can think of are:

1. VNC can be integrated into a hypervisor. It is integrated into KVM, Xen, VMware Workstation, and probably some others. This enables you to administer a VM before the OS is installed, and you can administer a VM with no network connection. You connect to the host's IP address, not the VM's IP address.

2. When properly setup with VirtualGL, TurboVNC can take advantage of a server's graphics card for 3D rendering.

3. VNC has better support for 3D/compositing desktops such as GNOME3.

Advantage of X2Go include:

1. Audio support

2. Folder Sharing

3. Printer sharing

4. Easier setup and switching between desktop environments.

5. Much better performance for 2D desktop usage.

6. I don't think we're any better than VNC in terms of video playback currently. However,we're working on a client-side rendering solution for video playback called X2Go "Telekinesis". It will have awesome performance.


----------



## HalfEatenPie (May 2, 2014)

Welcome buddy!  

Love the work you do for X2Go!


----------



## drmike (May 2, 2014)

mikedep333 said:


> To clarify, X2Go Server needs to be used with X2Go Client. There are multiple implementations of VNC, a VNC server can normally be used with any VNC client.
> 
> The man difference between X2Go and VNC is the internal design. We use client-side rendering, they use server-side rendering. I could go into low-level details.
> 
> ...


Thanks for this... I remain enamored by x2go.  I am an ancient VNC user but haven't used it in many years since Linux-only user.

Hope to see more x2go usage, examples, optimization, etc. here.  Folks need to know about the project as it really works well and creates all sorts of interesting remote computing opportunities.


----------



## wcypierre (May 2, 2014)

@mikedep333, try and build a ppa for raspberry pi and I think that you can gain some userbase from there(and hopefully as they are used to it in their raspi, they will use it on their dev machines as well)


----------



## DomainBop (May 2, 2014)

> Hope to see more x2go usage, examples


I'm using it right now to type this post (LXDE desktop)...not exactly on a small low RAM VPS though...an 18 euros monthly Q6700 w/8GB RAM 2x1TB SATAIII in RAID0 and Debian Wheezy at OVH (yeah, DDoS protected remote desktop)...server provides remote desktop services via x2go for a few people in my company (the ones with titles like Director of GTFO, VP of WTF, etc) .Desktops on this server are XFCE4, LXDE, and Mate. 



> sh-4.2$ whereis x2go
> x2go: /etc/x2go /usr/lib/x2go /usr/share/x2go





> sh-4.2$ free -m
> total       used       free     shared    buffers     cached
> 
> 
> ...





> sh-4.2$ cat /proc/cpuinfo
> processor    : 0
> 
> 
> ...


RSync and SCP are my primary means of moving files from server to server but when I use Filezilla this remote desktop is my preferred launching point... 102/71 is much faster than my regular 35/5 business cable connection (plus my servers are primarily in Europe so the latency to them is much lower using this remote desktop ).


----------



## mikedep333 (May 3, 2014)

wcypierre said:


> @mikedep333, try and build a ppa for raspberry pi and I think that you can gain some userbase from there(and hopefully as they are used to it in their raspi, they will use it on their dev machines as well)


I'll have to look into a raspberry pi ubuntu PPA.

I'll also have to look into having our debian build system produce armhf wheezy packages; that should cover raspbian.

The person who setup our debian build system is extremely busy right now though. He (Mike Gabriel) is under contract to get MATE (the fork of the GNOME2 desktop environment) included in Debian Jessie within a matter of weeks. (FYI: GNOME2 & MATE run great under X2Go. I didn't provide instructions because they're not as lightweight as XFCE, LXDE, and Openbox. The same basic instructions apply though: 1. Install the Desktop Environment's packages, 2. select MATE or GNOME in X2Go Client. 3. Disable the screensaver for each desktop environment once you connect.)

Also:

TL;DR: Don't be confused by the link below; X2Go is not available for raspbian yet.

I got all excited when I saw this. But then I realized that only the "all" architecture packages are available for the "armhf" architecture. For example, the package "x2goserver" is available because it is composed of bash scripts; so its architecutre is "all". But it's useless without "nxagent" (which we wrap around and call "x2goagent") (source package: "nx-libs".) nxagent does the actual heavy lifting for x2goserver, is written in C, and is not being compiled for "armhf" currently. 

http://packages.x2go.org/debian/dists/wheezy/main/binary-armhf/


----------



## WebSearchingPro (May 3, 2014)

Welcome to VPSBoard! Glad to see that the x2go project is alive and kicking  I personally recommend it to everyone as an alternative to VNC for the native out of the box security (tunneled over SSH) as well as the dynamic resizing of the desktop.


----------



## mikedep333 (May 3, 2014)

mikedep333 said:


> I'll have to look into a raspberry pi ubuntu PPA.
> 
> I'll also have to look into having our debian build system produce armhf wheezy packages; that should cover raspbian.
> 
> ...


Good news.

x2goclient is available in raspbian.

http://imgur.com/a/1SJ44#0

I forgot about this fact: x2goclient (including the dependency "nx-libs") is available in debian (repo: "main") and in ubuntu (repo "universe"). Therefore, x2goclient is available in raspbian.

It's an older version in raspbian, 3.99.2.1-5 . debian backports for wheezy has a newer version: 4.0.1.1-1, but I'll have to look into whether raspbian can use debian backports.

Either way, if you're on rasbpian, these are the steps you need to follow, compared to above:

1. Install X2Go Client


sudo apt-get install x2goclient

2. In the session preferences:


Settings tab

Set Display DPI (enable)
Leave the default value of "96". (Or raise it if text and icons are too small.)
By default on x2goclient 4.0.1.x and later, this is enabled and set to 96.

3. MATE is not listed in the session types. If you wish to use MATE, specify  Specify "Custom desktop" as the "Session type". Then Specify "mate-session" as the "command".

Also,

There was some confusion previously. PPAs are only available for Ubuntu, not for Debian. Ubuntu is not available for the raspberry pi because Ubuntu requires a newer ARM CPU (one that supports the ARMv7 instruction set. the pi is only ARMv6.)


----------



## wcypierre (May 3, 2014)

mikedep333 said:


> Good news.
> 
> x2goclient is available in raspbian.
> 
> ...


Any chances of making x2goserver at Raspbian? I'm now using VNC but I'm too used to x2go as I use it for my remote desktop vps but I can't use it on my Raspberry Pi.


----------



## mikedep333 (May 3, 2014)

Any chances of me doing it? Yes. However, I want to fix some bugs 1st though. I'm primarily the maintainer of the x2goclient for windows. For example, right now GNOME3 on Ubuntu 14.04 LTS  requires a workaround. It's not an issue with x2goclient, but I still want to fix it ASAP. I am a volunteer developer, I contribute in my free time because I enjoy doing so.

Also, just throwing this out there:

2 of our developers provide professional X2Go support for a living. That includes developing new features on contract. For example, Mike Gabriel recently setup our automated RHEL/CentOS build infrastructure on contract:

http://wiki.x2go.org/doku.php/docrofessional-support


----------



## wcypierre (May 3, 2014)

mikedep333 said:


> Any chances of me doing it? Yes. However, I want to fix some bugs 1st though. I'm primarily the maintainer of the x2goclient for windows. For example, right now GNOME3 on Ubuntu 14.04 LTS  requires a workaround. It's not an issue with x2goclient, but I still want to fix it ASAP. I am a volunteer developer, I contribute in my free time because I enjoy doing so.
> 
> Also, just throwing this out there:
> 
> ...


All the best on that. I'll be using VNC until x2go is released on raspi


----------



## lixdesic (Oct 20, 2016)

i did not install lightbox. i am using x2go server. how do you disable screensaver on server. 


i am locked into thye screensaver and cant get it to go away


----------



## mikedep333 (Oct 21, 2016)

@lixdesic since you can't unlock the screensaver, open up a terminal ssh session (e.g., with putty) and kill the screensaver process. For example, run "ps -ef | grep screensaver" to find the pid. Note that I don't not know which screensaver you have running


To disable the screensaver, use your desktopenvironment's GUI.


----------

