adrahon / vagrant-kvm

This project is dead, please use vagrant-libvirt instead! A Vagrant 1.4+ plugin that adds a KVM provider to Vagrant, allowing Vagrant to control and provision KVM/QEMU VM.
MIT License
366 stars 60 forks source link

Enable nested virtualization? #270

Open tpodowd opened 9 years ago

tpodowd commented 9 years ago

I'm trying to enable nested virtualization. If I use virsh edit to edit the xml file for the machine, I can add the following.

<cpu mode='custom' match='exact'>
    <model fallback='allow'>core2duo</model>
    <feature policy='require' name='vmx'/>
</cpu>

Then if I boot the vagrant created vm using the Virtual Machine Manager directly it works but if I boot using 'vagrant up' it loses this configuration (as expected I guess). How can I edit the Vagrantfile to enable this feature?

adrahon commented 9 years ago

It would be cool if you tried implementing support for that. You could look at the implementation of another option in the domain definition like https://github.com/adrahon/vagrant-kvm/commit/5b8de4f359330587539fd648cd0a770c42cab820#diff-a592055369fbc5b7f1427ad7ffa622ab

tpodowd commented 9 years ago

Ok. Will have a look. Just poking around, there is already 'cpu_model' config which looks like it used to be used for architecture from the looks of the README. However it seems like it is not used in the code and the arch is set using other means. I'm thinking I could reuse this configuration as its a good name for what I need.

tpodowd commented 9 years ago

I created a pull request to address this issue. It's my first time looking at ruby code :-)

https://github.com/adrahon/vagrant-kvm/pull/272

adrahon commented 9 years ago

Wow, that was fast, thanks! I'll have a look asap.