Citrix Xenserver & Ubuntu 12+ VM’s fail to boot / missing bootloader

Error in XenCenter when booting some Linux VM’s using out-dated templates ie XenServer’s paravirtualized bootloader (pygrub) is unable to handle the newest versions of Grub bootloader in VM’s

Specific error message “The bootloader for this VM returned an error – did the VM installation succeed? Unable to find partition containing kernel”

Disclaimer: Make a backup of the file you’re about to change.

# cp /usr/lib/python2.4/site-packages/grub/
# nano -w /usr/lib/python2.4/site-packages/grub/

Locate the following

if arg.strip() == “${saved_entry}”

and append the following or arg.strip() == "${next_entry}" to that line to make it look as below.

if arg.strip() == “${saved_entry}” or arg.strip() == “${next_entry}”:

Control-X to save. Boot the VM.