1

I'm running OSX Mavericks, and I know hardware virtualization is enabled. I have a debian VM in Vagrant with a virtual CPU that has support for hardware virtualization, but the vmx flag is disabled. This is an issue because I want to play with KVM in my debian VM. What do I need to do to enable (virtual) hardware virtualization on the debian guest OS? For reference, the output of cat /proc/cpuinfo is as follows:

Last login: Wed Aug 20 17:01:35 2014 from 10.0.2.2
vagrant@vagrant-debian-wheezy:~$ cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 42
model name  : Intel(R) Core(TM) i5-2557M CPU @ 1.70GHz
stepping    : 7
cpu MHz     : 1743.766
cache size  : 6144 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36     clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc rep_good nopl pni monitor ssse3   lahf_lm

bogomips : 3487.53 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management:

3
  • VM guests can't support VT-x if the host is using that feature. I doubt that any of the virtualization software out there advertises VT-x in the guests.
    – heavyd
    Commented Aug 20, 2014 at 20:23
  • You can't; what you want isn't possible
    – Ramhound
    Commented Aug 20, 2014 at 21:27
  • It's not possible with VirtualBox, it is possible with VMWare
    – m1keil
    Commented Aug 28, 2014 at 23:03

1 Answer 1

2

Virtualbox does not support nested virtualization so you cannot do what you want with it. However VMWare Fusion (OS X) and VMWare Workstation (Linux/Windows) supports this feature and allows you to enable nested virtualization:

See example (note the vmx flag):

tmp2 -> vagrant up
Bringing machine 'default' up with 'vmware_fusion' provider...
==> default: Checking if box 'puppetlabs/ubuntu-14.04-64-nocm' is up to date...
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Starting the VMware VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 172.16.102.159:22
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Forwarding ports...
    default: -- 22 => 2200
==> default: Configuring network adapters within the VM...
==> default: Waiting for HGFS kernel module to load...
==> default: Enabling and configuring shared folders...
    default: -- /Users/michael/GigaSpaces/VagrantLab/tmp2: /vagrant
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.
tmp2 -> vagrant ssh
Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64)

 * Documentation:  https://help.ubuntu.com/
Last login: Thu Aug 28 15:53:11 2014 from 172.16.102.1
vagrant@localhost:~$ cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 42
model name  : Intel(R) Core(TM) i7-2620M CPU @ 2.70GHz
stepping    : 7
microcode   : 0x28
cpu MHz     : 2693.633
cache size  : 4096 KB
physical id : 0
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx hypervisor lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi ept vpid
bogomips    : 5387.26
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

Here's the short Vagrantfile for this setup:

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
  config.vm.provider "vmware_fusion" do |v|
    v.vmx["vhv.enable"] = "TRUE"
  end
end

~

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .