Host-only networking can be thought of as a hybrid between the bridged and internal networking modes. As with bridged networking, the virtual machines can talk to each other and the host as if they were connected through a physical Ethernet switch. As with internal networking, a physical networking interface need not be present, and the virtual machines cannot talk to the world outside the host since they are not connected to a physical networking interface.
When host-only networking is used,
Hosts running recent macOS versions do not support host-only adapters. These adapters are replaced by host-only networks, which define a network mask and an IP address range, where the host network interface receives the lowest address in the range.
The host network interface gets added and removed dynamically by the operating system, whenever a host-only network is used by virtual machines.
On macOS hosts, choose the Host-Only Network option when configuring a network adapter. The Host-Only Adapter option is provided for legacy support.
Host-only networking is particularly useful for preconfigured virtual appliances, where multiple virtual machines
are shipped together and designed to cooperate. For example, one virtual machine may contain a web server and a
second one a database, and since they are intended to talk to each other, the appliance can instruct
To enable a host-only network interface for a virtual machine, do either of the following:
Go to the Network page in the virtual machine's Settings dialog and select an Adapter tab. Ensure that the Enable Network Adapter check box is selected and choose Host-Only Adapter for the Attached To field.
On the command line, use
For host-only networking, as with internal networking, you may find the DHCP server useful that is built into
In
Alternatively, you can use the
On Linux and macOS hosts the number of host-only interfaces is limited to 128. There is no such limit for Oracle Solaris and Windows hosts.
On Linux, macOS and Solaris
* 10.0.0.0/8 192.168.0.0/16 * 2001::/64
Lines starting with the hash
* 0.0.0.0/0 ::/0
If the file exists, but no ranges are specified in it, no addresses will be assigned to host-only adapters. The following example effectively disables all ranges:
# No addresses are allowed for host-only adapters