Which networking mode (Bridged, Shared or Host-Only) should I use for the virtual machine?
A virtual machine can use three different networking modes to communicate with the world: Bridged, Shared and Host-Only.
Before we discuss each networking mode, let's dive a bit into some basics of the networking technology.
When talking about networking we often use terms like IP address, DHCP Server, subnetwork, and many others. The first three are the most important in our case.
IP address: A numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol (IP) for communication.
IP addresses are represented in dot-decimal notation, which consists of four decimal numbers, each ranging from 0 to 255, separated by dots, e.g., 192.168.0.10. Each part represents a group of eight bits of the address. IP addresses, like regular addresses, are used by computers and other devices to communicate with each other.
An IP address can be assigned to a network device (e.g., computer, printer, tablet, smartphone, etc.) either manually by a user or a System Administrator, or automatically by a DHCP server. To see the IP address of your Mac, go to System Preferences > Network.
Your Mac will normally use either a Wi-Fi connection:
or an Ethernet (cable) connection:
DHCP server: A computer or a specific network device (router) that maintains a database of available IP addresses and configuration information. When the server receives a request from a client device (e.g., computer, printer), the DHCP server determines the network to which the DHCP client is connected, and then allocates an IP address that is appropriate for the client, and sends configuration information appropriate for that client.
In an average home network your router will work as a DHCP server that automatically assigns the IP addresses to all your network devices so that you do not need to worry about the IP addresses and other necessary settings for your Mac or a smartphone.
Subnetwork (or subnet): A logically visible subdivision of an IP network. The practice of dividing a network into two or more networks is called subnetting.
All computers that belong to a subnet are addressed with a common, identical, most-significant bit-group in their IP address. For example, a typical home subnet will have IP addresses in the following range: 192.168.0.1-255. This means your Wi-Fi router will have an IP address of 192.168.0.1, your MacBook Pro® will have an IP address of 192.168.0.10, your smartphone - 192.168.0.20 and your wireless printer - 192.168.0.30. To learn more about the settings of the DHCP server, please read your router's documentation.
Traffic between subnetworks is exchanged or routed with special gateways called routers, which constitute the logical or physical boundaries between the subnets.
Let's go back to the virtual machine's networking modes.
Bridged Networking. When this networking mode is used, your virtual machine's network card establishes adirect connection with your Mac computer's network card using a technology called "bridging." As a result:
- A virtual machine appears as a separate physical computer that belongs to the same subnet as the Mac it is running on.
- A DHCP server (e.g., your router) provides a virtual machine with an IP address within the same IP range as other computers in the same subnet.
- A virtual machine can ping and see all computers in the subnet.
Other computers can ping and see the virtual machine.
To use the Bridged networking mode, go to your virtual machine's Configuration > Hardware > Network and choose Bridged: Default Adapter, Ethernet, or Wi-Fi depending on your needs.
Here is a short explanation of how each type of the Bridged mode corresponds to the Mac network settings:
- Bridged: Ethernet corresponds to your Mac Ethernet adapter
- Bridged: Wi-Fi corresponds to your Mac Wi-Fi adapter
Bridged: Default Adapter corresponds to whichever network adapter is chosen as the default (the first in the list System Preferences > Network) on the Mac.
Shared Networking. This is the recommended type of networking for the virtual machines, as it does not require any specific configuring and works "out of the box". When this networking mode is used your Mac will work as a router for your virtual machine. As a result:
- Parallels Desktop creates a separate virtual subnet with its own virtual DHCP server running in OS X®.
- A virtual machine belongs to that virtual subnet with its own IP range.
- A virtual machine is not visible in the real subnet the Mac belongs to.
A virtual machine can ping computers in the real subnet.
As you can see from the picture above, your Mac will have two IP addresses. This is because your Mac will belong to two subnets at the same time: the real subnet (e.g., your home network) and the virtual subnet created by Parallels Desktop. The settings of this virtual subnet can be accessed from the Parallels Desktop Preferences > Advanced > Network: Change settings.
To use the Shared networking mode, go to your virtual machine's Configuration > Hardware > Network and choose Shared Network.
Host-Only Networking. This mode is similar to Shared mode except the virtual subnet that is created by Parallels Desktop (10.37.129.x) is isolated from the outer world. As a result, the virtual machine that is working in host-only mode can only see and ping the Mac it is running on.
To learn more about each networking mode please read the Parallels Desktop 10 User's Guide, pages 175-176.