Be warned, Citrix Support will not support your Merchandising Server if you follow these steps.
And - this is really antique and no longer works with Hyper-V 2012.
Here is my scenario:
I have a fully paravirtualized Linux virtual machine (Merchandising Server) that is made to run on a xen hypervisor (the family of hypervisors that enable Linux VMs to boot kernel-xen and run in a truly paravirtualized and highly efficient way).I want to move that vm over to another hypervisor (non-xen) for a client demonstration.
Warning: This might seem a bit convoluted, but it really isn’t difficult. However there are a few tools involved. The steps that apply to your situation all depends on how easy it is to get your virtual disk into a format that you can mount and edit the boot volume. Follow these instructions at your own risk, a positive outcome is not guaranteed. The resulting VM will most likely not be supported if it has problems.
Collecting the elements:
I am going to use a few things that I need to obtain (download) and tools that need to be installed.
- The Citrix Merchandising Server Virtual Appliance
- The Hyper-V Linux Integration Components ISO (v1, not R2)
- Try this if the above is dead.
- Citrix Project Kensho OFT Tool
- Citrix XenConvert
- Some Linux distribution “Live CD” (i use Debian Live)
- A Hyper-V Host
Why so many tools?
The Merchandising Server is the appliance that I am using for the example. XenConvert is to convert the XVA (XenServer export format) into an OVF based appliance. The Kensho OVF Tool is to import the OVF into Hyper-V. The Linux distribution “Live CD” is to mount the virtual disk of the example appliance so we can modify the Grub boot loader and drop a file. And the v1 Linux Integration Components have the magic PV kernel shim that we need.Details, details, missing details. What gives?
I am going to state right now that; I am not going to go into deep and gory details describing each and every click that is required with each tool. If you read my blog, I assume a couple things: that you have a clue, or you want one. And that you are not afraid of figuring things out, or trying and failing (I am also implying that you know how to make back-ups of things before you go mucking them up).The business at hand:
- Expand the Merchandizing bz2 zip archive. (WinRAR can do this, and others as well)
- Use Citrix XenConvert 2.x to convert from “Xen Virtual Appliance” to “Open Virtualization Format (OVF) Package”
- Do not create an OVA, just an OVF.
- Use Citrix Kensho OVF Tool to Import the OVF Package from step 2 to a Hyper-V host.
- Or you could just copy the VHD from step 2 to your Hyper-V host and create a new VM.
- Do not boot the VM at this time.
- Attach the Live CD ISO to the VM
- Set the boot order to boot from DVD first
- Remove the default Network Adapter and add a Legacy Network Adapter
- Add a second DVD drive
- Attach the Hyper-V (v1) Linux IC ISO to the second DVD drive of the VM
- Boot the VM into the Live CD and log in to its console
- Debian will auto logon as ‘user’.
- switch to root: sudo –i
- This is specific to Debian Live
- Discover the IDE disks:
- cd /dev
- ls hd*
- Mount the virtual disk (the vhd)
- make a mount point folder: mkdir /mnt/mine
- mount the disk to the folder: mount /dev/hda1 /mnt/mine
- explore the volume
- Mount the Linux IC DVD drive (mine is the second dvd on controller 2):
- mkdir /mnt/cdrom
- mount /dev/hdd /mnt/cdrom
- Copy the kernel shims from the ISO to the virtual disk
- cd /mnt/cdrom/shim
- cp *.* /mnt/mine
- Edit the device.map
- Edit the GRUB bootloader to load the shim and the kernel.
- nano menu.lst
- comment the ‘hiddenmenu’ option and increase the timeout so I can test.
- Create a new entry specific to the shim and the distribution kernel-xen
- Modify the default selection to point to my new entry.
- Unmount the virtual disk and the cdrom
- cd /
- umount /dev/hda1
- umount /dev/hdd
- Shutdown the virtual machine and remove the ISOs from the DVD drive (also remove the second virtual dvd drive).
- Boot the virtual machine, note the new menu selection that was created – this is the kernel that should boot.