9.17. Configuring multiple host-only network interfaces on Solaris hosts

Oracle VM VirtualBox

9.17. Configuring multiple host-only network interfaces on Solaris hosts

By default VirtualBox provides you with one host-only network interface. Adding more host-only network interfaces on Solaris hosts requires manual configuration. Here's how to add another host-only network interface.

Begin by stopping all running VMs. Then, unplumb the existing "vboxnet0" interface by execute the following command as root:

ifconfig vboxnet0 unplumb

If you have several vboxnet interfaces, you will need to unplumb all of them. Once all vboxnet interfaces are unplumbed, remove the driver by executing the following command as root:

rem_drv vboxnet

Edit the file /platform/i86pc/kernel/drv/vboxnet.conf and add a line for the new interface we want to add as shown below:

name="vboxnet" parent="pseudo" instance=1;
name="vboxnet" parent="pseudo" instance=2;

Add as many of these lines as required with each line having a unique instance number.

Next, reload the vboxnet driver by executing the following command as root:

add_drv vboxnet

On Solaris 11.1 and newer hosts you may want to rename the default vanity interface name. To check what name has been assigned, execute:

dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         100    full      e1000g0
net2              Ethernet             up         1000   full      vboxnet1
net1              Ethernet             up         1000   full      vboxnet0

In the above example, we can rename "net2" to "vboxnet1" before proceeding to plumb the interface. This can be done by executing as root:

dladm rename-link net2 vboxnet1

Now plumb all the interfaces using ifconfig vboxnetX plumb (where 'X' would be 1 in this case). Once the interface is plumbed, it may be configured like any other network interface. Refer to the ifconfig documentation for further details.

To make the newly added interfaces' settings persistent across reboots, you will need to edit the files /etc/inet/netmasks, and if you are using NWAM /etc/nwam/llp and add the appropriate entries to set the netmask and static IP for each of those interfaces. The VirtualBox installer only updates these configuration files for the one "vboxnet0" interface it creates by default.