Ubuntu – How to enable hardware virtualization technology (VT-x) for use in Virtualbox


So I am trying to run Ubuntu in a virtualbox but on installing 12.10 from the .iso I was greeted by a warning telling me that audio wouldn't work then I pressed next and this popped up:

Failed to open a session for the virtual machine Tux 3
VT-x features locked or unavailable in MSR

Result Code: 
E_FAIL (0x80004005)
IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}

And then it doesn't work.

I assigned 4GB of my 8GB to Ubuntu, 100 dynamically allocated GB of space, and 12MB of graphics memory. I'm running an Asus p8z77 V LX mobo with an Intel i5 3550 processor.

Downloaded 12.04.2 on my PC and tried again. Still getting the same message.

Best Answer

Before changing BIOS settings we may want to see if hardware virtualization (VT-x for Intel, AMD-V for AMD processors) is supported by our CPU.

From a terminal issue

grep --color vmx /proc/cpuinfo ## for an Intel processor
grep --color svm /proc/cpuinfo ## for an AMD processor

If virtualization was supported the flag vmx (for Intel CPUs) or svm (for AMD CPUs) will be colored.

enter image description here

In case the CPU supports hardware virtualization, we need to enable it in the computer BIOS to be able to use it.

Also read How to determine if CPU VT extensions are enabled in bios? for other approaches.

Enter the BIOS (often pressing Del or F12 while booting) and see with the manual how it is named there. Each BIOS appears to have a different name fror this. Search for Virtualization, Virtualization Technology (VT-x), SVM, VMX, or similar, here shown for an Award BIOS:

Award BIOS Virtualization Flag

For an example screenshot of an Asus EFI-BIOS see this answer on SU.

Set this entry to Enabled in case it was not done yet. Some BIOS need a cold boot (i.e. boot from power off state) to be able to use hardware virtualization.

Hardware virtualization can then be chosen in the virtual machine's System -> Acceleration settings:

enter image description here

By this the VM uses hardware virtualization for optimal performance. We would even be able to run a 64-bit guest OS on a 32-bit host for testing.

Related Question