BIOS Configuration Requirements for Xen Project HVM

Since Xen Project hardware virtual machines (“HVM”) require emulation at the hardware level, it is essential that the system’s BIOS settings are properly configured.

As found in Xen Project’s official wiki, the BIOS settings required to successfully run a HVM instance include the following enabled/disabled options:

  • VT-x needs to be enabled (aka Virtualization Support or Hardware Virtualization)[1]
  • IOMMU needs to be enabled (aka Intel VT-d or Hardware IOMMU)[2]
  • TXT needs to be disabled (aka Trusted Execution Technology)[3]

Disabled by Default

A common source of frustration for first-time HVM users is that VT-x is disabled by default in most BIOS. This is complicated by the fact that error messages encountered when running an xl create command on a VT-x disabled machine are not necessarily explicit.

For example, with VT-x disabled, the xl create error message may resemble this output:

# xl create /etc/xen/hostname.cfg
Parsing config from /etc/xen/hostname.cfg
libxl: error: libxl_create.c:564:libxl__domain_make: domain creation fail: Invalid argument
libxl: error: libxl_create.c:928:initiate_domain_create: cannot make domain: -3

Luckily, the VT-x status of your Xen system may be confirmed by running the xl dmesg command in Dom0.

# xl dmesg | grep -i vmx

If VT-x is disabled, you should find the following lines in the resulting output:

(XEN) CPU0: VMX disabled by BIOS.
(XEN) VMX: failed to initialise.

Otherwise, if VT-x is enabled, expect to see the text:

(XEN) VMX: Supported advanced features:
(XEN) HVM: VMX enabled

Similar information for VT-d, and other relevant BIOS configuration options, may also be found in the output of the xl dmesg command.

(This tutorial is an excerpt from Creating HVM DomU Virtual Machines in Xen Project Hypervisor, also found on vidigest.com.)


Footnotes:

[1] See https://wiki.xenproject.org/wiki/Xen_Common_Problems#How_can_I_check_if_I.27m_able_to_run_Xen_HVM_.28fully_virtualized.29_guests.3F

[2] See https://wiki.xenproject.org/wiki/Xen_Common_Problems#How_can_I_check_if_my_hardware_has_an_IOMMU_.28VT-d.29_and_it.27s_enabled_and_supported.3F

[3] See https://wiki.xenproject.org/wiki/Xen_Common_Problems#I_can.27t_start_any_HVM_guests.2C_I_get_error_.22libxl_domain_make_domain_creation_fail:_cannot_make_domain:_-3.22._PV_guests_work_fine.