VirtualBox Host-Only Networking Configuration

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

GUI

Create the Host-Only Virtual Interface

Create the host "host-only" virtual interface.

VirtualBox -> Preferences -> Network -> Host-only Networks -> +

They will be automatically named "vboxnet0", "vboxnet1", etc.

This is the name of the interface created on host and is also the the name of the private virtual Ethernet switch this interface and the guest's interfaces will connect to.

Configure the Host-Only Virtual Interface

Click on the host-only network name, then on the "screwdriver" icon.

You will be able to configure the Adapter (IPv4 address and mask, IPv6 address and mask length) and the DHCP server for that network.

Configure Guests

Network -> Adapter X -> Enable Network Adapter -> Host-only Adapter -> Name:

Use the name of the host-only network just created.

The network interface configuration will then be set using guest-specific means. You can use static addresses or DHCP.

After the guest's reboot, you will able to ssh into guest from the host using the new address.

Command Line

TODO

VBoxManage hostonlyif create
VBoxManage modifyvm "VM name" --nic<x> hostonly