Page 1 of 1

Bridge Adapter's Host Interface Selection - How to List

Posted: 18. Mar 2014, 05:54
by Dj Sison
How does Virtual Box filter the host interfaces on the screen where the user can select the interface that the Bridged Adapter is attached to? (please see attached file)

I am currently using VBoxManage to create VMs and set properties such as network settings.
In one of my Linux VMs (that I create on the command line), I assign NIC1 (Network Adapter 1) to a Bridged Adapter using the following command:

Code: Select all

VBoxManage modifyvm myLinux --nic1 bridged
But when I start the VM, I get the following error:
Could not start the machine
myLinux because the following
physical network interfaces were not found:

Realtek PCIe GBE Family Controller (adapter
1)

You can either change the machine's network
settings or stop the machine.
It seems that the value "Realtek PCIe GBE Family Controller" is set as the attached interface to the Bridged Adapter (this value maybe from the previously selected value), which is not present in the host (not a network interface of the Mac host).

When I issue the following command, the VM will start correctly.

Code: Select all

VBoxManage modifyvm myLinux  --bridgeadapter1 en0
The problem is, I do not want to hardcode the "en0" part.
I want the "en0" part to be the same with Virtual Box's default selected interface when a Bridged Adapter is created.
How can I achieve this?

Re: Bridge Adapter's Host Interface Selection - How to List

Posted: 18. Mar 2014, 09:42
by socratis
  1. You have to use both commands to make it work. If you use the "--bridgeadapter1" alone it does nothing. See user manual, section 8.8.2.
  2. You can list the bridged adapters by issuing "VBoxManage list bridgedifs" and do some (heavy duty) parsing to figure out the default and then use the "VBoxManage modifyvm myLinux --bridgeadapter1 <adapter>".
  3. This is what the GUI is doing. There is no "default", because default changes. Try to change the order of your NICs in the System Preferences, then create a new VM. Your "default" will be assigned to the first (available/connected?) NIC.

Re: Bridge Adapter's Host Interface Selection - How to List

Posted: 18. Mar 2014, 09:49
by Dj Sison
I have confirmed 1,2, and 3, and it is exactly as what you have said.
Thank you very much for your help! :D