Citrix XenServer – How to Convert HVM to PV

In order to take advantage of some XenServer features, you need to have a paravirtualization (PV) turned on for your guest host.  You maybe running in HVM because you installed your operating system from a disk and not a XenServer created template.  Now days xen is built into the linux kernel and we don’t need a special kernel installed.  We just need to change the settings in XenServer to boot the system.

Note: I tested this on Ubuntu 14.04 and 16.04 with systems that already had XenTools installed.  I’m assuming the procedure doesn’t change much to other distros.

  1. Find the UUID of the guest host you want to convert from HVM to PV
    xe vm-list name-label=<name of guest host>
  2. Print out the current parameters for the guest host and save them as a backup.
    xe vm-param-list uuid=<uuid from step 1>
  3. Update parameters to boot your system as paravirtualization
    xe vm-param-set uuid=<uuid from step 1> HVM-boot-policy=""
    xe vm-param-set uuid=<uuid from step 1> PV-bootloader=pygrub
    xe vm-param-set uuid=<uuid from step 1> PV-args="-- quiet console=hvc0"
  4. Find the UUID for your VDB boot disk
    xe vm-disk-list uuid=<uuid from step 1>
  5. Set the drive as bootable
    xe vbd-param-set uuid=<uuid from step 4> bootable=true
  6. Boot the system and review the console in XenCenter.  If the system boots, BUT you don't get the login window, you may need to complete create this config file.
    1. Create this file if it doesn't exist on your guest host: /etc/init/hvc0.conf
    2. # hvc0 - getty
      # This service maintains a getty on hvc0 from the point the system is
      # started until it is shut down again.

      start on stopped rc RUNLEVEL=[2345]
      stop on runlevel [!2345]

      exec /sbin/getty -L hvc0 9600 linux

    3. Reboot