Congratulations, you decided to be the ultimate hypervisor egalitarian and install every mainstream hypervisor + KVM onto a single server. You setup Windows 2000 and Redhat to dual boot 11 years ago, how much can things have changed?
I could have accomplished this project via constantly swapping harddrives when I needed to change hypervisors, but that seemed more like accepting the problem than a solution.
My initial plan was to divide my six harddrives into 4 logical volumes at the raid controller level. Unfortunately the raid controller for servers I was using (I'm going to refrain from plugging any one vendor, at least as long as I'm operating on other people's hardware) doesn't provide this functionality. For a brief moment I flirted with the idea of cutting up the disk using partitions, until a closer look at ESXi and Xen's installation revealed they don't provide any granularity in setup of the partition tables beyond selecting an installation volume.
Instead of telling this story as it happened, I'm going to first go over the hiccups I encountered on the way. That way, incase you're like me and already started this project before doing your research, you can plan a bit before reading the whole article.
VMware Boot Bank Corruption
Not sure how I accomplished this on the first server, because I couldn't replicate it on the second. I assumed it was because Microsoft was automounting the VMware Boot Banks (they are formatted fat32). Anywho, for quite a long time I was stuck with the error "Not a VMware Boot Bank". VMware provides very little information on this error (and not applicable to my situation). Unfortunately VMware also doesn't seem to provide a way to fix a corrupted Boot Bank, so I was forced to reinstall. Afterwards I ran this command to prevent Windows from auto-mounting these volumes:
Windows installing onto the wrong drives
While Microsoft is nice enough to ask you which drive you'd like to install Windows on, that doesn't mean it'll listen. Unfortunately while it will install your C: drive to the selected partition, it will install the 100MB System Reserved partition which it boots from to where it sees fit. On a system with lots of unformatted drives like mine, and where I was installing Windows to not the first volume, it chose to put the system reserved partition and the MBR for windows on the first volume set, ensuring that it would be booted automatically. I ended up fixing this by only leaving in the disks for Windows during it's installation process, then inserting the other disks after it was done.
XenServer is scared of VMFS volumes
Citrix,it's ok to be scared, but you need to face your fears. Every time I booted the Xen installer it would die when it got the point of scanning the drives with the error "Could not parse Sgdisk". From what I found via a quick google, this is due to an inability of the Xen 6 installer to handle VMFS volumes. Citrix, this is no way to convert followers away from VMware. I resolved this by making sure the disk I was installing Xen to was formatted and pulling the other disks out of the server during the installation of XenServer.
XenServer is scared of GPT volumes
Not sure if this was just from me, or why this was occuring, but I had to follow these instructions to get past a GPT error which occurred during the installation of Xen 6:
1. Boot from the XenServer 6.0.0 install CDROM.
2. At the Xen 6.0.0 install prompt type menu.c32 and press enter.
3. When you get the new menu screen press TAB
4. add disable-gpt just before the last --- then press enter.
BCDedit won't modify the configuration if it's not the primary disk
The actual project
For these four hypervisors, there are three different boot loaders used, and two major versions of one of those boot loaders:
Windows 2008 R2
RedHat Enterprise Linux
VMware ESXi 5
Citrix XenServer 6
My original goal was to use Grub with RHEL 6 to load everything else. This turned out to be a much simpler task than the hours of time I burned on it made it appear. I thought the errors I was receiving in ESXi due to a corrupted boot bank were from some problem with Grub chainloading Syslinux, turns out i had really just corrupted my boot bank.
Boot everything from Grub
This turned out to be rather simple due to support for something called "chainloading". My final working grub configuration is:
# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_ccskvmvmh01-lv_root
# initrd /initrd-[generic-]version.img
title Red Hat Enterprise Linux (2.6.32-220.el6.x86_64)
kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=/dev/mapper/vg_ccskvmvmh01-lv_root rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_NO_DM rd_LVM_LV=vg_ccskvmvmh01/lv_root rd_LVM_LV=vg_ccskvmvmh01/lv_swap
title Windows 2008 R2
title ESXi 5
title XenServer 6
Grub simply hands off booting to the MBR on the respective drives, and the boot loaders for the other hypervisors takes it from there.
Of course since this didn't initially work for me, I went through all the additional effort to also make this for from ESXi's and Xen's Syslinux to boot everything, and I made an effort (but did not finish) making Bootmgr boot everything else.
Boot everything from ESXi 5 (Syslinux 3.86)
This works pretty much the same way, with two major caveats. First, VMware was not nice enough to ship menu.c32 or chain.c32 with the installation of ESXi 5. Therefore you need to go here, download Syslinux 3.86 and extract those two files.
Second, ESXi doesn't mount it's first partition, so you can't do any of this from within ESXi's console. I'd recommend a linux boot disk, or if you chose to dual boot with RHEL 6, you can mount it from there. You'll know you have the right partition if you see the files:
Copy chain.c32 and menu.c32 into this partition. Now backup syslinux.cfg and replace it with the following:
menu label ESXi 5
menu label Windows 2008 R2
menu label XenServer 6
menu label RedHat Enterprise 6
Boot everything from Xen 6 (Syslinux 4.04)
Citrix was nice enough to include both menu.c32 and chain.c32 in their boot partition. I didn't check to see if they mounted this within their OS or not, and simply edited it out of band anyways. Since I was already done with most everything at this point, I didn't change it to use the menu config but instead left it with requiring you to enter the label at the boot prompt.
The file you want to edit this time is extlinux.conf. Again, I suggest making a backup first:
Boot everything from Bootmgr
First note, I never actually go this working. Booting Grub from Bootmgr is easy. I'm sureit's possible somehow to boot Syslinux from Bootmgr, but after accomplishing the above tasks this seemed like a trivial exercise. Still, I figured I'd list what I did.
This seemed to boot Grub just fine, but everything else gave an error about no operating system found. I have not spent more time to troubleshoot it.
Everything available from Grub. I know it's cheesy to take a picture of a monitor, but until someone gets me some test boxes with out of band management (hint hint, Cisco and/or Fujitsu), this is how it's going to be.
Credit: Information for this solution was gathered from numerous websites in addition to independent research. In addition to the websites listed above, some of the others which provided instrumental information are:
Congratulations, you've decided to use some other boot loader to as your primary and simply chainload bootmgr for Windows. Unfortunately you still want to modify the configuration of bootmgr, but BCDedit doesn't do work unless you admit it's god of your boot process.
BCDedit by default opens the configuration for the very first disk in
the system. If that doesn't happen to be Windows, or the Windows
installation you want, then it just won't open it. To get around this you need to mount the system reserved partition which windows creates for the BCD configuration to live on, and then specify that you want to modify that store in your configurations.
First, under disk management, find the 100MB system reserved partition and give it a drive letter.
The BCD configuration will be at (drive letter):\boot\bcd. To specify this in BCDedit use the following syntax:
Credit: Information for this was gathered from numerous websites in addition to independent research. This project came up as a component of my plan to run ESXi 5, Windows 2008 R2, RHEL 6 and XenServer 6 all on one box. Booting ESXi and Xen (both which use syslinux) did NOT work, despite being referenced in the image above. Further details can be found in the blog post on that topic.