The host-only connection type allows a VM to communicate with the host operating system and with any other VMs on that machine that also use the host-only connection type. The host operating system and its guest operating systems form an independent, isolated host-only network. Typically all the parties on this private network use the TCP/IP protocol suite although that is not required.
This configuration is useful if you need to use applications hosted by different operating systems, but you want to share or pass data between VMs. However, a host-only VM cannot exchange data with any node external to the host. Only the host machine is visible on an "external" network. The VM cannot communicate with any systems off the host machine without the use of a proxy server. This provides a good measure of security, which may be an issue for some operating systems or types of data.
The private network runs over virtual network vmnet1. For communications to occur over vmnet1, each VM and the host must be given an address on vmnet1. This can be done using one of two general approaches. Addresses can be assigned statically (for example, by consulting a fixed database) or dynamically using protocols such as DHCP.
When host-only networking is enabled at the time VMware is installed, a custom DHCP server application is set up to run on the host machine. This server implements the DHCP protocol only for VMs running on the host-only network associated with the virtual network interface vmnet1.
Guest operating systems that are set up to use DHCP at boot time to obtain an IP address will then work without any additional configuration (with the exception of setting up names, as described below). Guest operating systems that do not use DHCP to obtain an IP address must be explicitly assigned a static IP address.
If you have several host machines on which you want to run host-only networks, you can use the same private network number on each host. This is perfectly safe because each network is self-contained, connecting only VMs on a single host machine.
Installation Prompts for Host-only Networks
When you install VMware, before you configure or start any VM, you are prompted for some network information. These prompts pertain only to the host-only connection type. Their purpose is to identify a private network number that can be used for the host-only network. These prompts follow. (To see a full installation script, refer to "Installing VMware" .)
Configure host-only networking support?
Probe for an unused network number?
Answer No to the first prompt only if you do not intend to use Host-only connection type (the next prompt is suppressed).
If you answer No to the second prompt, you will need to provide a private network number if you will use host-only networking. If you answer Yes, the VMware application probes for an unused network number and responds something like the following:
Network number 192.168.0 (netmask 255.255.255.0) appears unused.
Configuring vmnet1 to use network 192.168.0 and mask 255.255.255.0.
If VMware chooses a network number, it does so by checking the use of private numbers as described in RFC 1918 (Request for Private Network Numbers). In many cases the network number will be 192.168.1, the first possible private network number VMware uses. The VMware application defines a class-C network that allows up to 256 hosts.
Provide a network number if you want to use a specific private network number. Remember that this network number should not allow any packets to escape off the host. The network number should only be known and used by VMs running on the host, and the host itself.
Setting Up a Host-Only VM
This section contains steps for implementing a host-only VM.
To implement a VM with connection type host-only:
As described in the previous section "Installation Prompts for Host-only Networks" , you can either provide a private network number or allow VMware to probe for one.
Using either the VM configuration editor or the VM configuration wizard, set the VM ethernet adapter to connection type host-only and press Install.
You have two choices for setting up IP addresses for VMs on a host-only network: dynamic assignment using DHCP or static assignment.
Using DHCP to assign IP addresses is simpler and more automatic than statically assigning them. Most Windows operating systems, for example, are preconfigured to use DHCP at boot time so they are functional the first time they are booted, without additional configuration. If, however, you want your VMs to communicate with each other using names instead of IP addresses then you need to set up a naming convention and/or a name server on the host machine. In this case it may be simpler to just use static IP addresses.
If you allow DHCP to assign a network address, then each time a VM boots it may be assigned a new or different address. If you have VMs that you use frequently and/or for extended periods of time, you may prefer to assign them static IP addresses or configure the host-only DHCP server to always assign the same IP address to each VM. For VMs that you do not expect to keep for long, let DHCP allocate an IP address.
Available IP addresses in a host-only IP network are split up using the conventions shown below. VMware always uses a Class C address for host-only networks.
|
Range |
||
|---|---|---|
If you want to use a node name rather than a network address to identify the VM, then you must use a static network address and you must run a name server on the host OS.