vagrant-kvm icon indicating copy to clipboard operation
vagrant-kvm copied to clipboard

Enable nested virtualization?

Open tpodowd opened this issue 10 years ago • 4 comments

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?

tpodowd avatar Nov 17 '14 01:11 tpodowd

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

adrahon avatar Nov 18 '14 10:11 adrahon

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 avatar Nov 19 '14 01:11 tpodowd

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

tpodowd avatar Nov 19 '14 09:11 tpodowd

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

adrahon avatar Nov 19 '14 09:11 adrahon