X Server on Windows using Xming

I have been exploring the use of virtual machine images for web applications recently, and found a tension between easy development (which realistically requires a GUI these days) and small, efficient deployment.

So, after years of separation, I find myself back at the point of using X Windows to run “remote” applications using the display, keyboard and mouse on my workstation. After a look around I have found and installed XMing on my Windows boxes and am having great fun with much lighter machine images.

Xming X Server for Windows | Get Xming X Server for Windows at SourceForge.net.

Configuration was a bit tricky to start with. For several hours I was unable to get evan a simple X application such as xterm or xeyes working. Error messages included “No protocol specified” and “Can’t open display”.

Some things I needed to do included:

  • Choose the right VM network option. For VirtualBox this meant using “bridged” rather than “NAT” mode.
  • Add the name or ip address of the server as a new line in X0.hosts (by default, this file is located in C:\Program Files\Xming)
  • Open port 6000 in Windows Firewall, if you use it
  • add export DISPLAY=workstation_ip_address:0 to your .bashrc on the server

When you get it working this allows such fun tricks as:

nautilus --no-desktop dir1 dir2 ...

to allow moving files on the virtiual system by simply dragging and dropping icons between separate workstation directory windows, or:

sudo apt-get install aisleriot

to hugely increase the range of time-wasting solitaire games available on your Windows PC 🙂