As I do a lot of different projects at the same time I like to keep them cleanly separated to not mess things up. One of the cleanest ways is to have a dedicated server for each project to make sure there are never any interferences. As I already have a home server that serves as a data storage I wanted to set up a dedicated application server device for Continuous Integration and the various web projects I am working on. Of course it needs to leverage virtualization as physical hardware is not an option if you go beyond two concurrent projects.

Picking the right hardware

Because it is eventually going to idle for 90% of the time I wanted to have something with low energy consumption. Also the overall footprint (read: size) of the box should not be too big. Being silent would also have been a huge plus. Thanks to Haswell we’ve seen some very nice hardware recently. I glanced at the Intel NUCs briefly considered moving to AMD and then went straight for the Zotac Zbox ID91.

The ID91 is basically a mini PC with an i3 processor (no VT-d, if you must know), dual Gigabit NICs, and a 4400 graphics card that allows up to 16 GB RAM and a 2.5 inch internal HD or SSD (either SATA-6 or mSATA are possible). Plus it has all the media center goodness these days – ac-class wifi, Bluetooth 4, IR receiver, 2xUSB 3.0 ports, memory card reader, HDMI, DVI, and even digital audio out. I already had the HD, so all I had to get was the box itself with two DIMM sticks.

Picking the right OS

As I mentioned in the beginning, I want multiple boxes on this machine. Perhaps at one point I will want to try and run a virtual media machine with XBMC, MythTV or the likes, and there is no VT-d present I want to make sure that I pick an virtualization solution that allows guest systems to access hardware directly. Also I am basically a non-Windows user, so the only copy you find here is a virtual system on my main MacBook.

That pretty much ruled out VMWare (due to Windows management requirements) and KVM (I read it’s quite complicated to achieve hardware passthrough). Shortly I considered OpenVZ but decided I wanted a real virtualization solution rather than containers in case I need to host a guest with a specific kernel at some point. That brought my old friend Xen back on the scene. I had a Xen server in the early 2000s and it was very reliable and fun to work with.

Being a Debian user I installed Wheezy on the box, together with Xen. Unfortunately Xen 4.1 is the available version on Wheezy, the most recent is 4.3. I never had such a new piece of hardware like this Haswell box I was worried about proper support of all different devices. I did not dare to try Sid on this box as I will really need it to work 99% of the time, so I looked around and noticed that Citrix open sourced their XenServer. Naturally I went for it and decided to use XenServer 6.2 as the basis for my new home server. Fortunately you do not have to use the Windows management software (XenCenter), xe on the console is always available.

Now comes the hard part…

Bootable XenServer on the Zotac Zbox ID91

I took me almost a whole day to get XenServer on the ID91 due to technical problems. The box only offers booting over USB, so either a USB stick or external CD-Rom is needed. I have an external USB-CD-Rom, but apparently it is broken, which I only found out after quite a while.

Only when I attached it to my MacBook and checked the system.log I saw messages like

The IOUSBFamily gave up enumerating a USB device after 10 retries.

So the only viable way to get the system on my new server was to use a USB stick. Unfortunately the method to create a bootable USB stick on OS X described on the Ubuntu site was not sufficient. Booting was not possible. As it turns out there are two things to be done in order for the ID91 to boot from USB with the XenServer 6.2.0 image.

Set BIOS for booting the USB stick

The Zotac is very flexible in its interpretation of what comes over the USB. I need it to think my USB stick is a floppy drive. That is why I attach the USB stick (no matter if installed or not, just the hardware needs to be present), enter the BIOS and go to the USB settings. There I chose to apply the Forced FDD mode for my stick.

Prepare USB stick for XenServer

Simply putting the ISO on the stick will not be successful as I told the ID91 to think of an FDD, not a CD-Rom when talking to USB. So I followed these steps:

  • Open my Windows 7 machine in Parallels on the MacBook and start the download for XenServer.
  • Use Rufus to prepare the USB stick for booting (no, Unetbootin will not recognize a USB device in a virtual Parallels on OS X, so it does not work). It is important to extend the Advanced Options and check the box that says List USB Hard Drives. Then the step required to make the stick boot properly is to Create a bootable disk using: Syslinux 4.
    In order to be really sure I also checked the BIOS fixes as well as the Rufus Mbr (not sure if those are really needed). Then let Rufus do its job.

  • Download Syslinux 4 from kernel.org
  • Next, copy all the files from the XenServer ISO to the USB stick.
  • In the /boot directory you will see a folder called isolinux. I copied this and named it syslinux. Also I renamed all the files inside that were called isolinux to syslinux.
  • From the downloaded Syslinux 4 archive I copied the file /com32/mboot/mboot.c32 to the root of the USB stick.

Only then did I succeed in booting into XenServer from a USB stick – the rest was a piece of cake.

Putting it into production

One thing you have to remember is to enable ssh for the XenServer, else you actually need to use the XenCenter software. Plus it makes sense to apply the latest Hotfixes. For 6.2.0 there is already a Service Pack that conveniently bundles all patches until end of 2013. How to do it is nicely explained in this Hotfix note by Citrix. (Or you can do it with my favorite toy for Configuration Management, Ansible)

Final words

So far the Zotac Zbox ID91 is a great little machine. It is not as silent as I would have hoped, but that is quite ok as I am not planning on having this in my living room for quite some time. But at some point I will and then I hope Xen will be nice enough to let an OpenElec guest access all required hardware. But that might still be a while aways – there are a lot of things to tackle now.

Next is a CI environment for PHP projects. Don’t hold your breath, though 😉