Grub ConfigurationPreface

Let me ask an initial question here: Why would I want to create a dual or multi boot setup, if I got the hardware to run a bare metal hypervisor?

One of the drivers for a bare metal hypervisor is that you CAN run almost any OS on top of that slim piece of code without suffering from huge performance degradation. So performance is not a valid reason for the need of still being able to boot occasionally a OS without being executed on top of a bare metal hypervisor.  It’s probably fair to say that a multi boot setup is pretty much something demanded from technology people – such as myself for wired setups and engineering and testing use cases.

One important reason for myself is networking; I’m an old networking guy and did protocol analysis for years, so when ever something goes wrong I tend to launch Wireshark to capture network traffic. In order to do so, the NIC needs to be attached to the cable and set into promiscuous mode, which is a bit of a hassle using a virtualized OS. Another reason is flashing firmware to routers or cell phones using serial com or USB in specific modes can be challenging too.

Again, for just running OS and Apps and even high demanding Games XenClient will do the job perfectly, I bet most user wouldn’t notice a performance difference at all anyway.

What’s the approach?

If you dealt with installing XenClient, you may have noticed; by a default fresh install XenClient will take the whole hard-drive. However, if you looked into the PXE setup, you actually can specify partition, choose to leave the OEM partition untouched and where XenClient should have been installed.

One of the possible ways is to make sure there’s already a XenClient installation, so the advanced install will offer to use that partition ( just needs a local volume group named XenClient)

Before you start

  1. Before you start I would spend some time to think about which OS needs how much space… Sounds logical, but how many time did you partition a disk and finally found one partition is getting full while another is almost empty 🙂
  2. Install Windows first, makes it easier due to windows 7 typically wants to create that 100MB boot / bitlocker partition

And btw. I did the partitioning always with parted live but Steve Tyler posted a quick guide on the XenClient support forum using fdisk during the install which makes it even faster and easier!

Step by step

I’ll do in this example a multi boot setup with Windows7, XenClient and Linux

Install windows (or shrink an existing installation) so you got some space left on your harddrive.

After Windows setup is complete, start the XenClient installer – Boot from the CD, PXE boot or memory stick and on the Welcome screen press ALT + F3 to switch to a shell (username root / no password).

Now start partitioning your disk with the fdisk command and write the information down for further install steps.

  • “fdisk -l” will print the partition table of all disks
  • “fdisk /dev/sda” will start partitioning your 1st harddrive
  • Once you launched fdisk use “m” for options e.g. “p” will print the current layout

Now create your XenClient partition; make sure it’s a primary partition and the ID is set to “bd”.

  • “n” Create a new partition
  • “p” Choose primary
  • “3” Partition number 3 (1 and 2 taken by Windows 7)
  • “Enter” to start with first free cylinder
  • “+200000M” to create a 200GB partition
  • “t” + “3” + “bd” will set the ID to bd
  • Verify by pressing the “p” (print)
  • If all looks good press “w” for write

“Fdisk -l” looks now similar to the picture below:

Now we can create the volume and volume group and assign the name XenClient to it.

  • “pvcreate -ff -y /dev/sda3” prepares the physical disk to be used with LVM
  • “vgcreate XenClient /dev/sda3” creates the volume group

I’ going to install Ubuntu additionally, so I’ll another primary partition to disk and just fill up the empty space.


Now switch back to the installer by pressing ALT + F1 and select advanced install. The installer will recognize the existing “installation” and offer to overwrite this partition.


After the installation has finished your system should boot directly into XenClient after the reboot. I wont install Linux now, but keep the partition reserved, so I’ll bot XenClient and add the Windows into the boot loader configuration.

Open a terminal once XenClient has booted or use ssh if remote access is granted.

Add a menu entry into the /boot/system/grub/grub.cfg file using vi.

menuentry "Microsoft Windows 7" {
 set root=(hd0,1)
 chainloader +1
}

This will refer to the fist hard drive second partition.

Reboot XenClient and press ESC during the splash screen to display the boot menu, select “Microsoft Windows 7” and press Enter.

You’re all set!

Enjoy XenClient and as usual excuse any typos!

Questions and feedback here, on the forums or just drop me an email: walter.hofstetter[at]eu.citrtix.com.

Regards, Walter

PS. If you’re coming to Synergy Barcelona, there’s still a chance to get in one of the XenClient Hands on labs I’m doing by just showing up 30 minutes before the lab starts (Room 134) – Even if sold out, there are always no shows!