In this post, I talked about setting up X11 forwarding using Xming and SSH. Today I was looking into forwarding an entire window manager via X11, but wasn't able to.

XDMCP and Xming

However, I found another cool solution - XDMCP. XDMCP is like remote desktop for linux. Xming is an XDMCP client. Once XDMCP is enabled on the remote host's display manager, one can use Xming to connect to it. Note that, via this approach, the Xming is used in a completely different mode than in X11 forwarding. Specifically, SSH didn't play any part in XDMCP (I heard XDMCP is not a secure protocol).

Remote host setup

Ubuntu (and Xubuntu) 16.04 uses lightdm as its display manager. XDMCP isn't enabled by default. To enabled it, edit /etc/lightdm/lightdm.conf and add:

[XDMCPServer]
enabled=true

Now restart lightdm service (this is for Ubuntu 16.04):

 sudo systemctl restart lightdm.service

For more about Ubuntu and XDMCP, refer to xdmcp ubuntu wiki.

Client connection

In order to connect, Xming must be started from command line. Run:

PS> & 'C:\Program Files (x86)\Xming\Xming.exe' -rootless -keyhook -query <remote_host> -clipboard -nowinkill

Here the key part is -query <remote_host>.

-fullscreen can also be replaced with -rootless, or, to be removed (so in "single window mode") and specify screen size: -screen 0 1400 1000. Note that in -fullscreen, alt-tab is broken, and switching in/out of Xming in this mode is very slow. On the contrary, -rootless mode is awesome - swiching in/out Xming is fast, alt-tab works perfectly.

-keyhook is used to enable keyboard short. However, I found alt-tab to be still problematic. Windows keys seem to work: win-e opened mouse pad on Xubuntu. -nowinkill is used so Xming doesn't eat alt-F4.

Refer to Xming man page.

Experience

Initial testing seems to be pretty fast for local Hyper-V Linux machine.


I still want to investigate how to do X11 forwarding + window manager. See Display manager and window manager.

References

Window Manager via X11 forwarding

I can successully x11 forward entire window manager to local machine with Ubuntu server. I choose Ubuntu server because it doesn't come with a desktop environment pre-installed so it's more tweakable.

This is inspired by this blog post.

Xming setup

Launch Xming in the single window or fullscreen mode. Multiwindow mode will cause window managers to fail to start.

Single window mode with screen size:

& 'C:\Program Files (x86)\Xming\Xming.exe' :0 -clipboard -screen 0 1400 1000

Fullscreen mode:

& 'C:\Program Files (x86)\Xming\Xming.exe' :0 -clipboard -fullscreen

In fullscreen mode, escape with ctrl-esc.

As described in x11 forwarding, set the DISPLAY env var in local machine terminal before SSH (or in putty UI):

export DISPLAY=localhost:0.0
ssh -Y <user>@<remote_host>

Remote host (Ubuntu Server) setup

Refer to Ubuntu Server GUI wiki X11 Server Installation:

sudo apt-get install xorg

Then install the choice of window manager. E.g., fluxbox:

sudo apt-get install fluxbox

Then start with fluxbox.

Not all window manager work this way. Tested and worked are:

  • Fluxbox, openbox
  • xfwm4 - WM for xfce - works but haven't figured out any app launcher to use
  • xfce4 - works, pretty, seem to run pretty smoothly (first session might be slow)

Those don't work are:

  • awesome, enlightment, i3