简体   繁体   中英

How to prevent Vagrant from creating a hostonly network?

When creating a (linux) virtual machine using Vagrant and VirtualBox, vagrant implicitly creates a hostonly network interface on the virtual machine.

Can this be prevented? I think there are no vagrant options to do this. Am I right? What is the best generic/OS-independent way to achieve this?

There is no way of preventing creating the host-only network, because that's how Vagrant was designed to work (see Virtual Machine requirements in the "Creating a base box" chapter).

It's the way Vagrant communicates with the machine: injects an SSH keys, checks the status, runs provisioners, etc.

Likewise, the guest machine's first network interface will be dedicated to the communication with Vagrant.

Without it Vagrant becomes unusable; instead you can just run your own virtual machine in VirtualBox.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM