Using Vagrant to create virtual machines with a provider, while vagrant runs inside the same provider

35 views
Skip to first unread message

Yonatan Alon

unread,
Jun 5, 2019, 12:57:21 PM6/5/19
to Vagrant
Hello :)

I am new to Vagrant, and have read the basic tutorials.
As far as I understand, if you install Vagrant on a given computer,
and also install a virtualization provider on the same computer,
then Vagrant can launch virtual machines inside the installed virtualization provider.

My question is: Is it possible to launch virtual machines inside a virtualization provider, 
while Vagrant itself is installed on a virtual machine inside the very same virtualization provider?

In other words - let's say I have a VMware Hypervisor,
and I create a Linux VM inside my Hypervisor, then install Vagrant on my Linux VM,
can I create a new vm on my hypervisor, using my Vagrant installation? 

Thanks in advance

Benjamin Lu

unread,
Jun 5, 2019, 2:16:53 PM6/5/19
to Vagrant
I don't wanna say no but if it does. the VM that you are working with, must have more RAM to be able to do that. I know that Hyper-V does that with the latest version of Windows 10 Pro. 

Jim McGinness

unread,
Jun 5, 2019, 2:35:54 PM6/5/19
to Vagrant
Yes, you can use the Hyper-V provider while running on a Hyper-V VM. More information is available at:


There are a number of limitations to be aware of when using Hyper-V as a provider. Some are noted at the above link and some more are given at



Brian Cain

unread,
Jun 5, 2019, 3:57:33 PM6/5/19
to vagra...@googlegroups.com
On Wed, Jun 5, 2019 at 9:57 AM Yonatan Alon <yonatan...@gmail.com> wrote:
Hello :)

I am new to Vagrant, and have read the basic tutorials.
As far as I understand, if you install Vagrant on a given computer,
and also install a virtualization provider on the same computer,
then Vagrant can launch virtual machines inside the installed virtualization provider.

My question is: Is it possible to launch virtual machines inside a virtualization provider, 
while Vagrant itself is installed on a virtual machine inside the very same virtualization provider?

Yes! This is possible.

If you're using VMWare with the vagrant vmware plugin, you simply just need to add this provider
setting to your Vagrantfile:

guest.vm.provider :vmware_desktop do |v|
      v.vmx['vhv.enable'] = 'TRUE'
      v.vmx['vhv.allow'] = 'TRUE'
end


Supposedly as of VirtualBox 6.0 you can do this too, but I've read some where that it is only supported
on AMD architectures. I think in theory this should work, but I don't have the right hardware to test it:

guest.vm.provider :virtualbox do |v|
      v.customize ["modifyvm", :id, "--nested-hw-virt", "on"]
end

I'm not sure if you need anything special for Hyper-V...

If anyone is curious I have a Vagrant guest that does exactly this. It has some scripts that installs VirtualBox 6 and
 

In other words - let's say I have a VMware Hypervisor,
and I create a Linux VM inside my Hypervisor, then install Vagrant on my Linux VM,
can I create a new vm on my hypervisor, using my Vagrant installation? 

Thanks in advance

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a8f95a67-5c49-4f9f-9a25-9f992d50c175%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Brian Cain

Yonatan Alon

unread,
Jun 6, 2019, 4:26:24 AM6/6/19
to Vagrant
Thanks for the quick reply.
1) Where can I find documentation regarding the vagrant vmware plugin?
2) Do similar plugins (and configuration for Vagrantfile) exist for VMware vSphere esxi?
3) Where do I install the vmware plugin, on the physical machine running the hypervisor, or on the virtual maching running vagrant?

Brian Cain

unread,
Jun 6, 2019, 11:08:51 AM6/6/19
to vagra...@googlegroups.com
On Thu, Jun 6, 2019 at 1:26 AM Yonatan Alon <yonatan...@gmail.com> wrote:
Thanks for the quick reply.
1) Where can I find documentation regarding the vagrant vmware plugin?

 
2) Do similar plugins (and configuration for Vagrantfile) exist for VMware vSphere esxi?

There do seem to be a few vSphere plugins for Vagrant, however HashiCorp does not maintain those. You can find them on GitHub.
 
3) Where do I install the vmware plugin, on the physical machine running the hypervisor, or on the virtual maching running vagrant?

There's an install guide in the docs, but you would install the vagrant plugin on your host machine, where you have installed vagrant.

Hope that helps!

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Brian Cain
Reply all
Reply to author
Forward
0 new messages