简体   繁体   中英

How to limit number of network adapters in Virtual Box?

I am setting up a virtual machine with Virtual Box and Vagrant, but receiving error messages after running the "vagrant up" command:

VBoxManage.exe: error: Invalid NIC number 9
VBoxManage.exe: error: Invalid NIC number 10
VBoxManage.exe: error: Invalid NIC number 11
VBoxManage.exe: error: Invalid NIC number 12

and so on till "Invalid NIC number 39".

How do I lower the number of used network adapters to 8?

For Windows:

Open base.rb under "C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.8.3\\plugins\\providers\\virtualbox\\driver"

Find:

    def max_network_adapters
      36
    end

Change 36 or whatever number you have, to the number you want. For example, if you want to change it to 8, the new code will be:

    def max_network_adapters
      8
    end

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