Computers, Science, Technology, Xen Virtualization, Hosting, Photography, The Internet, Geekdom And More

Better Productivity With Xen, Ubuntu and XDMCP

Posted on | June 15, 2009 | 3 Comments

Being over-loaded with work is a vicious cycle, especially when the work involves more maintenance than creativity. The cycle goes something like this:

  1. 15 things require immediate attention
  2. You give immediate attention to 15 things at once
  3. Despite the cycle of #1 and #2, #1 still persists at the end of the day

Even if I had the space in my small corner of the world to set up 10 different workstations, I don’t think the breakers would hold. I thought about just adding more monitors since they’ve become so cheap, the problem is that I need to keep 14 urgent things out of view while working on a single task. This is not like the classic case of information overload, where you have temptations on your desktop like e-mail, instant messengers, IRC clients, etc all competing with your editor or terminal to get some love from your eye balls. Here, in this case, I really have 15 urgent things making me quite anxious that unfortunately relate to each other causing them to be in progress at once.

Some of the tasks involve fiddling with system libraries, testing bleeding edge versions of various applications and other things that could lead to melt downs. I had to get these tasks on different systems and I needed a desktop for each one.

I have used VNC or SDL frame buffers in the past when working with Xen guests. VNC’s idea of 24 bit depth is a little different than mine, plus the mouse is extremely akward in tracking. SDL does a bit better on the rendering end, however the pointer is extremely over-sensitive. Having 6 VM’s open at once on a single desktop is also just protracting my problem, Its too easy to switch from one window to the next. I needed my faithful editor, in full glory, full screen with pointer tracking that could cut and paste huge chunks of code.

What I finally did was debootstrap 6 Ubuntu Jaunty domains (after previously doing an apt-mirror of the main / universe repository). I then installed the ubuntu-desktop package (which is what makes Ubuntu .. well .. Ubuntu) and configured X to play nicely with the virtual frame buffer (thanks, Steven!).

I then did what most people would consider taboo, I turned on XDMCP for each guest (safe, I’m behind a very paranoid NAT) and started various remote sessions. Switching between them is as simple as ctrl-alt-f(6 – 10), and you’re completely oblivious to the fact that you’re working on a deboostrapped paravirtualized Xen domain.

No more hassles with VNC/SDL pointer tracking, my apps run as if they’re running on the native display (which , technically, they are) .. its just as if I was using some kind of VGA passthrough.

This helped me become engrossed with one task at a time and actually make some real progress today. Sure, I have multiple windows and desktops on each virtual machine, but they are consigned to a single task and have disposable file systems. Using SSHFS (a FUSE backed SSH driven file system), I was able to quickly set up a shared folder to make moving patches / etc from guest to guest rather painless.

I am in no way advising anyone to turn on XDMCP when on a public network, however when working with multiple Xen domains locally that are running X, its so much better and less cluttering than using VNC or SDL.

XDMCP has been around for years, I can’t believe that it just dawned on me to use it today. This is really easy to set up with any modern Linux based OS using a pv_ops enabled kernel. Though I do appreciate hardware assisted virtualization, this small victory shows why I much prefer paravirtualization with Xen. I don’t have VT extensions on this machine, so KVM was out of the question for me.


3 Responses to “Better Productivity With Xen, Ubuntu and XDMCP”

  1. Dusty Wilson
    June 15th, 2009 @ 4:24 pm

    Unless you really need to run separate kernels, I suggest using OpenVZ instead of Xen. It has a much lower per-guest overhead and shares the same kernel for all guests. Adding a shared folder is as easy as adding a bind mount for each guest. Deployment of new guests is as easy saying “vzctl create 1234″ and it takes care of the rest. No install process or anything else.

    In my super-customized arrangement, each guest has its IP address assigned by DHCP, has a real MAC address, can be easily live-migrated from machine to machine, and the creation/management/etc is all done through a self-made web UI. Deploying a new guest on any of my servers or workstations is simple. Moving a guest from machine to machine is simple. Changing any of the resource levels on the fly (without reboot/etc) is simple. And to upgrade an entire batch of guests, you can simply run a script on the machine and have it call into each guest the usual apt-get commands. And you can still run X and XDMCP in each guest as wanted.

  2. tinkertim
    June 16th, 2009 @ 2:51 pm


    A lot of what I do is testing of new kernels and drivers (some I write myself). Xen is soon gaining tmem, which will allow for more flexibility regarding memory usage. I don’t have anything against OpenVZ, though I do have some technical objections to how its implemented and used.

    I really need to be able to just grab a kernel git tree, check out a specific tag, enable pv_ops and sandbox it, especially with PCI pass through (especially for driver development).

    One thing not many realize is that Xen is a system integrators tool box. The default user space tools are the bare minimum needed to boot and control domains. Most people end up writing their own tools, for their own needs, which I think is one of the beauties of just shipping a good hypervisor, libraries and some example code.

    One thing I won’t do is argue that any one solution is better than another (beyond what it does to the kernel and how it does it). I think everyone should just use what works for them :)

  3. Dusty Wilson
    June 21st, 2009 @ 9:55 pm

    @tinkertim: I agree with that. If you need what Xen offers, that’s a good fit. Many people don’t need it, but think they do. In your case, it seems that you do.

    My only wish is that people would research what they need before they go with something, especially when deciding among the virtualization/container/hypervisor choices out there.

    I use what I need when I need it. I use OpenVZ for almost everything. I use Xen and KVM where those are appropriate. And I’m a big fan of libvirt.

    It’s a wonderful world when you have so many great choices.

Leave a Reply

  • Monkey Plus Typewriter
  • Stack Overflow

  • Me According To Ohloh

  • Meta