Setting Host-Only adapter

29 views
Skip to first unread message

Gerhardus Geldenhuis

unread,
Aug 11, 2017, 2:57:02 AM8/11/17
to Vagrant
Hi 
I seem unable to create a Host-Only adapter for my second network interface in vagrant. 

I have the following line for networking:
config.vm.network "private_network", :type => 'dhcp', virtualbox__intnet: "vboxnet0",

Instead of creating a network attached to "Host-Only adaptor" it creates a network attached to the "internal network" named vboxnet0. 

The documentation is a bit sparse on network settings for the virtualbox provider. Any pointers would be appreciated.

I am trying to create a box with two network cards, NAT for enabling the box to talk to the world and Host-Only adaptor to enable me to ssh to the box. I don't want to do port forwarding because I would like a generic solution that allows me to access any port because my host machine is on the same network. 

Regards

Alvaro Miranda Aguilera

unread,
Aug 11, 2017, 6:23:17 AM8/11/17
to vagra...@googlegroups.com
Hello

Not sure from where you got the last part but per documentation should be

config.vm.network "private_network", :type => 'dhcp'

Vagrant first network will be always nat and its by design that way  for vagrant be able to login to the VM and configure



Alvaro

Virusvrij. www.avast.com

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a51409c3-b2f6-4ec9-8395-4eb9b103cbe9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Gerhardus Geldenhuis

unread,
Aug 11, 2017, 6:29:18 AM8/11/17
to Vagrant
Hi
I have actually change the configuration to config.vm.network "private_network", :type => 'dhcp', :name => 'vboxnet0 but it still fails. I created a bug report https://github.com/mitchellh/vagrant/issues/8878 which gives more detail.

Regards


On Friday, 11 August 2017 11:23:17 UTC+1, Alvaro Miranda Aguilera wrote:
Hello

Not sure from where you got the last part but per documentation should be

config.vm.network "private_network", :type => 'dhcp'

Vagrant first network will be always nat and its by design that way  for vagrant be able to login to the VM and configure



Alvaro

Virusvrij. www.avast.com
On Fri, Aug 11, 2017 at 8:57 AM, Gerhardus Geldenhuis <gerhardus....@gmail.com> wrote:
Hi 
I seem unable to create a Host-Only adapter for my second network interface in vagrant. 

I have the following line for networking:
config.vm.network "private_network", :type => 'dhcp', virtualbox__intnet: "vboxnet0",

Instead of creating a network attached to "Host-Only adaptor" it creates a network attached to the "internal network" named vboxnet0. 

The documentation is a bit sparse on network settings for the virtualbox provider. Any pointers would be appreciated.

I am trying to create a box with two network cards, NAT for enabling the box to talk to the world and Host-Only adaptor to enable me to ssh to the box. I don't want to do port forwarding because I would like a generic solution that allows me to access any port because my host machine is on the same network. 

Regards

--
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.



--
Alvaro

Alvaro Miranda Aguilera

unread,
Aug 11, 2017, 6:51:19 AM8/11/17
to vagra...@googlegroups.com
Hello

Does vboxnet0 have a dhcp?

open virtualbox, preferences, network and check

be sure you are in the latest virtualbox version and latest vagrant version

Alvaro

To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/db7b41d9-9804-4df9-b4de-154b03825ac2%40googlegroups.com.

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



--
Alvaro

Gerhardus Geldenhuis

unread,
Aug 11, 2017, 7:54:22 AM8/11/17
to Vagrant
Hi Alvaro,
Everything is latest stable versions. All my vboxnet<n> networks have dhcp servers and all of the dhcp servers is using seperate address ranges so there should be no clash.

Regards



--
Alvaro

Reply all
Reply to author
Forward
0 new messages