VMWare Workstation: creating virtual network adapters and networks from virtual machines. Creating a VLAN in VMware Workstation

Quite often there is a need to connect a virtual machine VMware Workstation to the Internet. This need arises when receiving updates directly from an Internet site, testing the operation of Internet browsers, and for many other reasons. In this article we will talk about the possibilities of connecting virtual machines VMware Workstation to the Internet. Depending on the network configuration, the following bridged, NAT or host-only connections can be used.

First, let us remind you that using the Virtual Network Editor utility it is possible to configure virtual networks VMware Workstation. This utility allows you to configure the network VMware Workstation and allows you to configure DHCP and NAT services. More detailed information about using Virtual Network Editor can be obtained by reading the article Network Settings VMware Workstation

Scenario 1. Access of VMware Workstation virtual machines to the Internet using a bridged connection.

Let's consider the first scenario for connecting virtual machines to the Internet using a bridged connection. Let's assume that there is a DHCP server on your local network (if it does not exist, then all the TCP/IP parameters of the virtual machine (IP address, mask, default gateway, DNS) can be set manually). We also assume that your network equipment does not block connections based on MAC address and that your firewall allows any computer to connect to the Internet.

In this case, you don’t need to make any additional settings; if you chose a bridged connection for the virtual machine, everything should work.

The figure shows a bridged connection. As you can see, the physical machine (host) has its own unique IP address. Virtual machines receive their own IP addresses from the DHCP server. Thus, each virtual machine acts as an independent node on the local network.

This connection method also has disadvantages. In a situation where the addresses of computers with Internet access are hardcoded on the firewall, virtual machines VMware Workstation will not gain access. In this case, you need to create a separate access permission on the firewall for each virtual machine. Another limitation for the operation of a virtual machine on a network can be the settings of the network equipment; the settings may indicate a limitation of one MAC address per port. Since in a bridged connection each virtual machine has its own MAC address, network equipment can block the port due to the large number of MAC addresses on the port.

Scenario 2. Connecting VMware Workstation virtual machines to the Internet using NAT.

We looked at the first scenario for connecting virtual machines VMware Workstation to the Internet. As discussed above, there are certain limitations inherent in a bridged connection. To overcome these limitations, you can alternatively use a NAT connection. In a NAT connection, the IP address of the host (physical computer) is used by all virtual machines. In other words, if a guest virtual machine accesses local network resources, the request occurs on behalf of the host, using its IP and MAC address.

When using a NAT connection, there are two networks. One is a virtual network in which virtual machines are located and interact, and the second is a physical network to which a physical computer is connected. The DHCP service is used to assign IP addresses to virtual machines. DHCP configuration is carried out through the Virtual Network Editor utility VMware Workstation. In the DHCP service configuration, it is advisable to specify the DNS server of the higher Internet provider.

Please note that the physical computer is also connected to the virtual network using a virtual network adapter. When a virtual machine accesses the resources of a local network or the Internet, packets from the virtual machine reach the default gateway (which is the IP address of the virtual adapter of the physical computer), network address translation is carried out on the physical computer and the packets enter the network using the IP and MAC address physical computer. After receiving data from an external network or the Internet, the reverse translation of network addresses occurs.

Scenario 3. Access of VMware Workstation virtual machines to the Internet using a host-only connection.

When talking about a host-only connection, it is always emphasized that a virtual network is created, isolated from external networks. All virtual machines on this network can only communicate with each other and with the host operating system. But, even for a host-only connection, it is possible to provide virtual machines VMware Workstation Internet access. This can be done using a proxy server, router, NAT, etc. on the host. On computers using Windows 2000, Windows XP or Windows Server 2003 as a host operating system, together with a host-only connection, you can use Internet connection sharing, allowing virtual machines to use dial-up or another Internet connection.

Conclusion. VMware Workstation provides many options when configuring virtual networks - bridged, NAT and host-only. Depending on the use case, you need to select a specific network. If you want to connect a virtual machine to a local network or to the Internet, it is better to use the bridged or NAT option. The choice depends on your local network security configuration.

Note. Please note that your personal firewall may be blocking virtual machine connections. As an experiment, you can disable the firewall for a while and test the connection from the virtual machines.

Having touched on the topic of desktop virtualization, we cannot ignore the products of the undoubted leader in this market - VMWare. VMWare Workstation provides users with virtually unlimited possibilities in creating virtual environments and takes into account many of the features of desktop applications. The same cannot be said about Hyper-V, when a server hypervisor, or VirtualBox, which has significantly less functionality, was added to the user OS.

What is desktop virtualization and who needs it?

Let’s be clear right away - desktop virtualization, in terms of tasks and needs, has nothing in common with server virtualization and, often, puts forward directly opposite requirements for the hypervisor. Often this type of virtualization is considered as something frivolous, for which some VirtualBox is enough, and they do not see the point in paid software, which includes VMWare Workstation.

At first glance, $287 for a desktop hypervisor seems like a fairly high amount, but once you take a closer look at the product, you begin to understand that it is definitely worth the money. For those who are just starting to master virtualization, we can recommend the free VMWare Player, which, although intended primarily for launching ready-made virtual machines, allows you to create new virtual machines and has most of the features of the older version.

The disk subsystem also has specific requirements. Firstly, storing virtual machines requires space, a lot of space, especially if you actively use snapshots. Secondly, normal array performance in random access operations is required. It has been experimentally revealed that a regular general-purpose disk allows you to work quite comfortably with no more than 4-5 simultaneously running machines.

Therefore, immediately forget about economical ones, etc. series of discs. In our practice, we use a separate RAID 0 array of fast disks, such as WD Black. High speed and low overhead distinguish this type of arrays, and the disadvantage of low reliability for desktop use is not so significant. Hard drives do not die overnight, and this process is easy to notice if you are at the machine every day.

If possible, it is better to assemble two arrays of two disks, instead of one of four. A large number of disks in an array will certainly increase its performance, but will greatly complicate its maintenance.

The listed requirements force you to be careful when choosing a motherboard; most likely, only older models that have the required number of memory connectors and SATA ports will suit you. Who said that virtualization is cheap?

Let's virtualize everything

One of the undeniable advantages of VMWare Workstation is the widest selection of supported guest systems. It's much harder to find something unsupported. This distinguishes this product from Hyper-V, where only native operating systems and Linux with kernels 3.4 and higher are normally supported, and from VirtualBox, where there are problems with supporting older operating systems.

Setting up a virtual switch is extremely simple and comes down to selecting the required physical adapter.

Private network (Host-only) - VMnet1

It is also created by default and allows you to organize private networks isolated from the outside world. The available options are the built-in DHCP server and connection to the host, in this case a virtual network adapter is created on the host connected to this switch.

Custom

This option is not a network type, but allows you to directly specify the virtual switch to which the network card will be connected. You can also select any unconfigured switch and get a private network based on it without connecting to the host and without virtual network services.

Custom any unconfigured virtual switch. The documentation is silent about the difference between the two identical modes.

Advanced

This is not a network type, but additional network connection settings that allow you to specify the connection bandwidth and loss level.

This makes it possible to emulate a modem connection, asymmetric communication lines, poor quality channels, etc. without using additional software. and will be appreciated by developers and testers of network solutions.

In the next part of the article we will look at working with peripheral devices, disks and partitions, and also look at the snapshot system.

  • Tags:

Please enable JavaScript to view the

The use of desktop virtualization platforms, both on home computers and in enterprise production environments, has recently become especially popular. Many users use virtual machines for training, running software written for a different operating system than the installed operating system, and creating portable user environments that are untethered from specific hardware. In an enterprise environment, virtual machines allow you to securely test software on a variety of guest operating system configurations, using specialized virtualization platform tools that increase the efficiency of the development and testing process. In addition, one of the most important advantages of virtual machines is the ability to combine them into virtual networks, which allows one to simulate the behavior of distributed systems, consisting of both end-user applications and various types of servers, in a heterogeneous environment on one computer. The flexibility of virtual machines in terms of resources allocated to them and the extensive capabilities for maintenance and performance optimization make it possible to easily manage many different virtual machine configurations and create optimized, hardware-independent applications “packaged” in virtual machines. These components, consisting of virtual machines, can then be networked in various ways to simulate different systems.

VMware products are currently market leaders in terms of organizing such models for testing. In June 2007, VMware Workstation 6 received the Visual Studio Magazine award for Best Solution in the Development Tools category. This was largely due to the availability of a large number of tools that can significantly increase the speed of development and testing, simplify the procedure for deploying applications and setting up network interaction between them. The desktop virtualization platform VMware Workstation has become so popular that Microsoft has decided to take a not entirely fair step regarding the licensing policy for virtualization of operating systems of the Windows Vista family: some of its editions cannot be virtualized. This situation could not suit VMware, which began the fight for the free use of operating systems on virtualization platforms. In addition, VMware is betting big on the VMware Fusion product, which provides the tightest integration between Mac OS and Windows Vista (codenamed Unity) and demonstrates truly fantastic results: the user works as if “in two worlds.”

The sixth version of VMware Workstation introduces many new features and capabilities, including networking. The most significant improvement is the ability to create up to ten virtual network adapters for a virtual machine.

Principles of organizing networks between virtual machines

Virtual machines on the VMware platform allow users to create various combinations of virtual systems that operate on different networking principles. The core of a VMware network is the following components:

  • virtual switches
  • virtual network interfaces (Virtual Ethernet Adapters)
  • virtual bridge
  • built-in DHCP server
  • network address translation device (NAT, Network Address Translation)

The fundamental element of networking in VMware Workstation and VMware Server is the virtual switch. It provides networking of virtual machines in the manner of a physical device: the virtual switch has ports to which the virtual network interfaces of the virtual machines, as well as other components of the virtual infrastructure within the host, can be bound. Multiple virtual machines connected to the same virtual switch belong to the same subnet. A virtual bridge is a mechanism by which a computer's physical network adapter is bound to virtual network interfaces. VMware's built-in DHCP server allows virtual machines to automatically obtain an IP address on their subnet, and a virtual NAT device provides network address translation when virtual machines communicate with an external network.

3 types of network interaction between virtual machines

VMware Workstation and VMware Server products provide users with the ability to assign one of three basic networking types to a virtual machine for each of the virtual network adapters:

  • Bridged
  • Host-only

Each of these types of networking can be used for different use cases for virtual machines, and it is necessary to carefully select the type of networking for a virtual machine to more effectively use it in conjunction with other components of the network infrastructure.

This type of networking allows you to bind the virtual machine's network adapter to the physical network interface of the computer, which makes it possible to share network card resources between the host and virtual systems. A virtual machine with this type of network interaction will behave in relation to the external network of the host system as an independent computer. You can assign such a machine its own IP address on your home or organizational network, or it will receive it from an external DHCP server. For the created virtual machine, this type of network interaction is assigned by default, since this is the simplest way to organize network interaction between the virtual machine, the host and the external network. The structure of Bridged Networking is given below.

The guest's virtual network adapter is connected to the virtual switch VMnet0, which also has a virtual bridge that communicates directly with the physical network adapter.

In order to assign the Bridged network communication type to a virtual machine, you need to go to the “VM” menu, then “Settings”, on the “Hardware” tab, select the virtual Ethernet network card and set the Network Connection group switch to the Bridged position.

This type of network interaction is optimal for software testing purposes, when you need to organize a virtual network within the host, and virtual machines do not need access to an external network. In the virtual subnet there is a DHCP server connected to the virtual switch VMnet1 and assigning IP addresses from the specified range to virtual machines (by default 192.168.179.128 - 192.168.179.254). The structure of Host-Only Networking is given below:

Guest virtual network adapters connect to the VMnet1 switch and communicate on the 192.168.179.0/24 subnet. A virtual network interface is also created on the host system, connected to VMnet1, which allows you to interact with virtual machines.

In order to assign a Host-Only network connection type to a virtual machine, you need to go to the “VM” menu, then “Settings”, on the “Hardware” tab, select the virtual Ethernet network card and set the Network Connection group switch to the Host-Only position.

This type of networking is very similar to Host-Only, with one exception: an IP address translation (NAT) device is connected to the VMnet8 virtual switch. A DHCP server is also connected to this switch, which distributes addresses from a given range to virtual machines (by default 192.168.89.128 - 192.168.89.254) and, directly, the virtual machines themselves. A NAT device allows IP address translation, which allows virtual machines to initiate connections to an external network without providing a mechanism for accessing the virtual machines from outside. The structure of NAT Networking is given below:

In the host operating system, as well as for Host-Only Networking, a virtual network interface is created for the VMnet 8 switch, allowing the host to communicate with virtual machines.

This model of network interaction is optimal from a security point of view (since it is impossible to initiate a connection to a virtual machine from the outside), but it significantly reduces network performance (sometimes by up to 20-30 percent). A NAT connection can be used, for example, to surf the Internet securely from a virtual machine.

In order to assign a NAT network communication type to a virtual machine, you need to go to the “VM” menu, then “Settings”, on the “Hardware” tab, select the virtual Ethernet network card and set the Network Connection group switch to NAT.

Each virtual machine can have multiple virtual network adapters connected to different virtual switches that implement different types of network communication. On the VMware Server 1.0 platform, up to four virtual network adapters can be created for one virtual machine, on the VMware Workstation 6 platform - up to ten. To add a virtual network adapter to a virtual machine, go to the “VM” menu, select “Settings”, then on the “Hardware” tab, click the “Add” button and select “Ethernet Adapter” in the Add Virtual Devices Wizard. After this, in the wizard, assign the type of network interaction for this adapter and click “Finish”.

Setting up a virtual network using Virtual Network Editor

The Virtual Network Editor application is included with VMware Workstation and VMware Server and is a powerful virtual network management tool. In order to use it, you need to run the vmnetcfg.exe program from the folder with Workstation or Server, or select Virtual Network Settings from the “Edit” menu.

The first tab of the virtual network editor shows the available virtual networks, their description, the subnet they form, and whether a DHCP server is enabled for it. By going to the “Automatic Bridging” tab we will see the following picture:

Here we can let the VMware platform itself select the appropriate physical network adapter for binding to the virtual bridge (if there are several network cards), and also add to the list physical adapters for which there is no need to create a bridge. If you have one network card, it is recommended to leave everything as is. Next we can go to the “Host Virtual Network Mapping” tab.

Here we can bind host network interfaces (both physical and virtual) to VMnet virtual switches. By default, virtual network interfaces VMnet1 and VMnet8 are bound to switches for Host-Only and NAT, respectively. The physical interface is bound to the VMNet0 switch. For each of the switches, we can assign a subnet by assigning an address and a subnet mask:

We can also bind a DHCP server to a virtual switch, for which there is a binding to one of the host network interfaces. This functionality duplicates the DHCP tab and will be described later. Let's now consider creating your own subnet based on an unoccupied VMnet2 switch, which begins with the “Host Virtual Adapters” tab.

Here we see virtual host adapters for Host-Only and NAT network communication, their corresponding virtual switches and device statuses. We can disable or enable virtual devices, or even remove them altogether. Let’s add our virtual adapter to create a subnet of virtual machines by clicking on the “Add” button. Add the VMnet2 adapter and click the “Apply” button. As a result, we have another virtual network interface on the host and a subnet with an automatically assigned address like 192.168.x.0/24. On the “Host Virtual Network Mapping” tab, we can make sure that the created adapter is bound to the VMnet2 switch, and view or change its subnet. Next, let's move on to the next tab, where we can attach a DHCP server to various virtual switches.

Here we see that the DHCP server is running for virtual switches VMnet1 and VMnet8. We can also add the switch to the list of DHCP server clients by clicking the “Add” button, and it does not matter whether any host network interface is associated with it or not. At the bottom you can also see the status of the service that supports DHCP ( vmnetdhcp.exe), and we can stop, start or restart it.

Add the VMnet2 switch using the “Add” button and click “Apply”. DHCP is now assigned to our subnet, and we can edit its properties by clicking on the “Properties” button:

Here, in addition to the range of IP addresses assigned to virtual machines, we can configure the duration of IP address leases by DHCP clients (default and maximum). Thus, by attaching a DHCP server to the switch and creating a virtual host network adapter bound to it, we created our own Host-Only subnet.

As mentioned above, Host-Only network communication differs from NAT in the absence of only one NAT device. This device, which translates virtual machine IP addresses, can be associated with only one virtual switch and host virtual network interface. By default, the VMnet8 switch and the virtual network adapter associated with it are used as the basis for network communication via NAT. On the last tab “NAT” you can change the parameters of this network interaction:

In order to assign a NAT device to our VMnet2 network, select it from the combo and click “Apply”. After this, our virtual subnet on the VMnet2 switch becomes protected from outside penetration, and virtual machines using a NAT device can initiate outgoing connections to the external network, which will be processed by the VMware NAT server. The address translation service is implemented by the vmnat.exe process. From this tab it can also be installed, launched and restarted. For NAT server settings, click the “Edit” button.

Here you can configure the IP address of the gateway used by the NAT device, the UDP (User Datagram Protocol) timeout in minutes (how long the UDP protocol binding to the NAT network lasts) and Config port - the port through which you can obtain information about the status of the NAT device.

The “Active FTP” checkbox allows or denies opening an incoming connection from an external FTP server in Active Mode. If the checkbox is not checked, single-channel Passive Mode will be used. The “DNS” (DNS, Domain Name System) button allows you to manage the settings for DNS forwarding (redirecting requests to DNS). This feature can only be configured for Windows hosts. The OUI (Organizationally Unique Identifier) ​​checkbox should be checked only if you have changed the first part of the virtual machine's MAC address, which identifies the network card manufacturer (by default, VMware assigns its own OUI to all machines), and you want to allow these machines to use a NAT device .

NetBIOS protocol parameters include the NBNS (NetBIOS Name Service) name processor timeout, the number of retries for NBNS requests, and the NBDS (NetBIOS Datagram Service) timeout.

Building networks from virtual machines with multiple network adapters

As mentioned earlier, each virtual machine can have multiple virtual network adapters associated with different types of network communication and switches. By adding new network interfaces with different types of network communication to a virtual machine, you can deploy a true virtual infrastructure within the host system for testing complex distributed systems and for training purposes. For example, the structure of a virtual network on a host could be like this:

As can be seen from the figure, there are no problems in modeling complex complex systems on one physical computer, in which various types of servers, firewalls and client computers operate. All this can be done using the Virtual Network Editor utility. In addition, the VMware Workstation product, focused on the development and testing process, provides another tool for creating virtual networks between virtual machines, which has advanced capabilities - Virtual Machine Teaming.

Virtual Machine Teaming on VMware Workstation

VMware defines the category of its Workstation product as Development and Test for a reason. The VMware Workstation platform provides a wealth of tools needed by developers and software quality engineers in software development companies. One of the most effective features of the product is the creation of “teams” of virtual machines, united by virtual network segments for testing complex systems. Essentially, Virtual Machine Teaming implements the same capabilities as the Virtual Network Editor, but allows you to more easily create virtual networks by binding virtual machine adapters to different virtual network segments. For example, we need to test the following system: on one of the hosts there is a Web server that has 2 network interfaces - one for accessing it through a thin client from the user’s machine, the other for connecting to the database server, where the client sends requests via the Web -server. The structure of such a system is presented below:

Let's create three virtual machines, in accordance with the structure of the model, and add another virtual network adapter for the virtual Web server. After that, in the “File” menu of VMware Workstation, select New->Team. We further indicate where the virtual machine team files will be located, then select the “Yes” option when asked “Add Virtual Machines to the team now”. Next, go to the add virtual machines window:

Here we can add virtual machines using the “Add” button. Add the required machines, click “Next” and answer “Yes” to the question “Add LAN segments to the team now” to go to the window for adding network segments.

Here we add 2 network segments for the simulated system using the “Add” button and click “Next”. Then we go to the most interesting page - the page for binding virtual network adapters to network segments.

Here we can assign virtual network adapter bindings to the virtual network segments we need by simply checking the boxes for the corresponding network interfaces in the segment columns. In accordance with the structure of the model, we assign LAN segment 1 for the database server and Web server and LAN segment 2 for the Web server and client. Thus, after clicking on the “Finish” button, we will receive a command from virtual machines that meets the requirements of the simulated system.

Once the team is created, we can launch all the team's virtual machines with one click and immediately begin testing the system. It should be noted that virtual machines added to a team cannot be used independently, but only within it.

Some aspects of VMware networking

When a virtual machine starts, VMware Workstation and VMware Server automatically assign MAC addresses to virtual network adapters. The automatic address assignment system is such that virtual machines on the same host are guaranteed not to have the same MAC addresses. Therefore, if you only use one copy of the VMware platform on your organization's network, this system ensures that there are no physical address conflicts. However, if virtualization platforms are running on several hosts on the network at once, a situation of duplication of MAC addresses may arise, which will lead to conflicts in the network and unavailability of virtual machines. To avoid this, you can manually assign MAC addresses to virtual machines by adding a line like this in a vmx file in a text editor:

Ethernet[n].address = 00:50:56:XX:YY:ZZ

Where n is the serial number (starting from zero) of the virtual machine's network interface, and XX, YY and ZZ are the corresponding components of the MAC address.

In addition, when using a virtual infrastructure based on VMware Workstation or VMware Server in a production environment, it is worth remembering that VMnet virtual switches are actually concentrators (“hubs”), that is, they duplicate traffic on all ports of VMnet devices. This creates potential security issues because a network interface running in promiscuous mode in one of the virtual machines could be listening to traffic destined for other clients of the virtual hub.

Conclusion

The VMware Workstation and VMware Server platforms are powerful tools for organizing network interaction between several virtual machines running simultaneously within a host. None of the desktop virtualization platforms currently on the market have the same networking functionality as VMware Workstation. When testing software, the platform's ability to model complex distributed systems is invaluable. In addition, on the VMware server platform, you can create “virtual server parks” with their own internal and external network connections; these systems are decoupled from the hardware and are very flexible in terms of transferring them to another platform. There are many possibilities hidden in setting up virtual networks, as well as various kinds of subtleties that allow you to configure virtual networks very, very flexibly and get the maximum effect from virtual machines.

VMware Workstation is an ideal solution for self-education, debugging applications, and creating test laboratory environments. Many who take their first steps with VMware Workstation face various questions when setting up. In this article we will look at the network settings available immediately after installation. VMware Workstation. This article will be of interest, first of all, to those who are just beginning to understand the virtual environment.

By default, in VMware Workstation There are three types of virtual networks. You can connect a virtual machine to a specific network from the Virtual Machine Settings menu

Let's look at the default networks VMware Workstation:

Bridged/VMnet0. In this connection, the virtual machine connects to the network using the host's physical network adapter. A virtual machine's virtual network adapter uses your computer's physical network adapter, allowing the virtual machine to access the same network to which the physical computer is connected. In other words, virtual machines gain access to your local network.

Please note that the host and guest operating systems have unique MAC and IP addresses. If the virtual machine does not have a static IP address, it will receive it via DHCP, like a regular computer. In this type of connection, the virtual machine has full access to the local network and can connect to other computers, and computers on the local network can connect to it.

This type of connection is used most often.

Host-only/VMnet1. The second type of network connects the guest virtual machine and the host computer, forming a private network. This connection provides a network connection between the virtual machine and the physical computer (host), using a virtual network adapter available to the host operating system.

With this type of connection, the virtual machine does not have access to the local network and the Internet. Since virtual machines do not have access to the physical network, VMware Workstation provides for the use of the DHCP service to assign TCP\IP parameters to virtual machines. For a host-only virtual network, a specific subnet is used, in our case it is 192.168.52.0-254, where the virtual adapter on the physical computer has an IP address of 192.168.52.1, and all guest virtual machines using a host-only connection receive addresses from the VMware DHCP server.

Virtual machines using a host-only network can communicate with each other on this network.

NAT/VMnet8. This is the third type of connection. This type of connection is characterized by the fact that communication between the virtual machine and the host occurs over a private network. Why is a second virtual network card installed in a physical computer?

When using a NAT connection, the virtual machine does not have its own external network IP address. However, the virtual machine can connect to computers from an external network using the standard TCP/IP protocol. In this case, the virtual machine uses the IP and MAC addresses of the physical computer.

It is worth noting that by default, a computer from the local physical network cannot connect to a virtual machine.

NAT connection is selected by default when creating a new virtual machine VMware Workstation.

Since the virtual machine does not have direct access to the network, VMware Workstation uses the DHCP service to assign IP addresses to virtual machines on a private network.

Virtual network management VMware Workstation carried out in the Virtual Network Editor, which is installed by default. You can launch Virtual Network Editor directly from the Start menu by selecting All Programs, then VMware and Virtual Network Editor. You can also launch Virtual Network Editor inside the interface VMware Workstation by selecting the Edit menu and Virtual Network Editor.

After launching Virtual Network Editor you will see a tab Summary. This tab displays all virtual networks used VMware Workstation.

Automatic Bridging. If the host machine, i.e. computer on which the software is installed VMware Workstation, has more than one physical Ethernet adapter, the first available physical adapter is automatically selected to be used in the VMnet0 virtual network. It is possible to add an exception not to use a specific physical adapter on the VMnet0 network.

Host Virtual Network Mapping. This tab is used to configure virtual networks in VMware Workstation. On this tab, for the VMnet0.network, you can specify the use of a specific physical adapter. For networks VMnet1 and VMnet8, you can specify the subnet and DHCP parameters.

Host Virtual Network Adapter. This type of adapter allows the host machine to connect to a virtual network. By default, two virtual network adapters are created per host: one for the bridge network and one for the network address translation (NAT) network. Using this tab, you can disable or completely remove a specific adapter. Also on this tab you can create a new virtual adapter and associate it with a specific VMnet.

DHCP. This tab defines DHCP parameters for VMnet1 (host-only) and VMnet8 (NAT) virtual networks. Here you can stop or restart the DHCP service.

NAT This tab determines which virtual network will use Network Address Translation (NAT). On this tab you can start/stop the NAT service. Additionally, there are advanced NAT settings available in the "Edit" section.

We hope you have gained a clearer understanding of virtual networks VMware Workstation, and this article was useful to you.

Networking in VMware Workstation and VMware Server.

Article:

The use of desktop virtualization platforms, both on home computers and in enterprise production environments, has recently become especially popular. Many users use virtual machines for training, running software written for a different operating system than the installed operating system, and creating portable user environments that are untethered from specific hardware. In an enterprise environment, virtual machines allow you to securely test software on a variety of guest operating system configurations, using specialized virtualization platform tools that increase the efficiency of the development and testing process. In addition, one of the most important advantages of virtual machines is the ability to combine them into virtual networks, which allows one to simulate the behavior of distributed systems, consisting of both end-user applications and various types of servers, in a heterogeneous environment on one computer. The flexibility of virtual machines in terms of resources allocated to them and the extensive capabilities for maintenance and performance optimization make it possible to easily manage many different virtual machine configurations and create optimized, hardware-independent applications “packaged” in virtual machines. These components, consisting of virtual machines, can then be networked in various ways to simulate different systems.

VMware products are currently market leaders in terms of organizing such models for testing. In June 2007, VMware Workstation 6 received the Visual Studio Magazine award for Best Solution in the Development Tools category. This was largely due to the availability of a large number of tools that can significantly increase the speed of development and testing, simplify the procedure for deploying applications and setting up network interaction between them. The desktop virtualization platform VMware Workstation has become so popular that Microsoft has decided to take a not entirely fair step regarding the licensing policy for virtualization of operating systems of the Windows Vista family: some of its editions cannot be virtualized. This situation could not suit VMware, which began the fight for the free use of operating systems on virtualization platforms. In addition, VMware is betting big on the VMware Fusion product, which provides the tightest integration between Mac OS and Windows Vista (codenamed Unity) and demonstrates truly fantastic results: the user works as if “in two worlds.”

The sixth version of VMware Workstation introduces many new features and capabilities, including networking. The most significant improvement is the ability to create up to ten virtual network adapters for a virtual machine.

Principles of organizing networks between virtual machines

Virtual machines on the VMware platform allow users to create various combinations of virtual systems that operate on different networking principles. The core of a VMware network is the following components:

  • virtual switches
  • virtual network interfaces (Virtual Ethernet Adapters)
  • virtual bridge
  • built-in DHCP server
  • network address translation device (NAT, Network Address Translation)

The fundamental element of networking in VMware Workstation and VMware Server is the virtual switch. It provides networking of virtual machines in the manner of a physical device: the virtual switch has ports to which the virtual network interfaces of the virtual machines, as well as other components of the virtual infrastructure within the host, can be bound. Multiple virtual machines connected to the same virtual switch belong to the same subnet. A virtual bridge is a mechanism by which a computer's physical network adapter is bound to virtual network interfaces. VMware's built-in DHCP server allows virtual machines to automatically obtain an IP address on their subnet, and a virtual NAT device provides network address translation when virtual machines communicate with an external network.

3 types of network interaction between virtual machines

VMware Workstation and VMware Server products provide users with the ability to assign one of three basic networking types to a virtual machine for each of the virtual network adapters:

  • Bridged
  • Host-only

Each of these types of networking can be used for different use cases for virtual machines, and it is necessary to carefully select the type of networking for a virtual machine to more effectively use it in conjunction with other components of the network infrastructure.

This type of networking allows you to bind the virtual machine's network adapter to the physical network interface of the computer, which makes it possible to share network card resources between the host and virtual systems. A virtual machine with this type of network interaction will behave in relation to the external network of the host system as an independent computer. You can assign such a machine its own IP address on your home or organizational network, or it will receive it from an external DHCP server. For the created virtual machine, this type of network interaction is assigned by default, since this is the simplest way to organize network interaction between the virtual machine, the host and the external network. The structure of Bridged Networking is given below.


The guest's virtual network adapter is connected to the virtual switch VMnet0, which also has a virtual bridge that communicates directly with the physical network adapter.

In order to assign the Bridged network communication type to a virtual machine, you need to go to the “VM” menu, then “Settings”, on the “Hardware” tab, select the virtual Ethernet network card and set the Network Connection group switch to the Bridged position.

This type of network interaction is optimal for software testing purposes, when you need to organize a virtual network within the host, and virtual machines do not need access to an external network. In the virtual subnet there is a DHCP server connected to the virtual switch VMnet1 and assigning IP addresses from the specified range to virtual machines (by default 192.168.179.128 - 192.168.179.254). The structure of Host-Only Networking is given below:


Guest virtual network adapters connect to the VMnet1 switch and communicate on the 192.168.179.0/24 subnet. A virtual network interface is also created on the host system, connected to VMnet1, which allows you to interact with virtual machines.

In order to assign a Host-Only network connection type to a virtual machine, you need to go to the “VM” menu, then “Settings”, on the “Hardware” tab, select the virtual Ethernet network card and set the Network Connection group switch to the Host-Only position.

This type of networking is very similar to Host-Only, with one exception: an IP address translation (NAT) device is connected to the VMnet8 virtual switch. A DHCP server is also connected to this switch, which distributes addresses from a given range to virtual machines (by default 192.168.89.128 - 192.168.89.254) and, directly, the virtual machines themselves. A NAT device allows IP address translation, which allows virtual machines to initiate connections to an external network without providing a mechanism for accessing the virtual machines from outside. The structure of NAT Networking is given below:


In the host operating system, as well as for Host-Only Networking, a virtual network interface is created for the VMnet 8 switch, allowing the host to communicate with virtual machines.

This model of network interaction is optimal from a security point of view (since it is impossible to initiate a connection to a virtual machine from the outside), but it significantly reduces network performance (sometimes by up to 20-30 percent). A NAT connection can be used, for example, to surf the Internet securely from a virtual machine.

In order to assign a NAT network communication type to a virtual machine, you need to go to the “VM” menu, then “Settings”, on the “Hardware” tab, select the virtual Ethernet network card and set the Network Connection group switch to NAT.

Each virtual machine can have multiple virtual network adapters connected to different virtual switches that implement different types of network communication. On the VMware Server 1.0 platform, up to four virtual network adapters can be created for one virtual machine, on the VMware Workstation 6 platform - up to ten. To add a virtual network adapter to a virtual machine, go to the “VM” menu, select “Settings”, then on the “Hardware” tab, click the “Add” button and select “Ethernet Adapter” in the Add Virtual Devices Wizard. After this, in the wizard, assign the type of network interaction for this adapter and click “Finish”.

Setting up a virtual network using Virtual Network Editor

The Virtual Network Editor application is included with VMware Workstation and VMware Server and is a powerful virtual network management tool. In order to use it, you need to run the vmnetcfg.exe program from the folder with Workstation or Server, or select Virtual Network Settings from the “Edit” menu.


The first tab of the virtual network editor shows the available virtual networks, their description, the subnet they form, and whether a DHCP server is enabled for it. By going to the “Automatic Bridging” tab we will see the following picture:


Here we can let the VMware platform itself select the appropriate physical network adapter for binding to the virtual bridge (if there are several network cards), and also add to the list physical adapters for which there is no need to create a bridge. If you have one network card, it is recommended to leave everything as is. Next we can go to the “Host Virtual Network Mapping” tab.


Here we can bind host network interfaces (both physical and virtual) to VMnet virtual switches. By default, virtual network interfaces VMnet1 and VMnet8 are bound to switches for Host-Only and NAT, respectively. The physical interface is bound to the VMNet0 switch. For each of the switches, we can assign a subnet by assigning an address and a subnet mask:

We can also bind a DHCP server to a virtual switch, for which there is a binding to one of the host network interfaces. This functionality duplicates the DHCP tab and will be described later. Let's now consider creating your own subnet based on an unoccupied VMnet2 switch, which begins with the “Host Virtual Adapters” tab.


Here we see virtual host adapters for Host-Only and NAT network communication, their corresponding virtual switches and device statuses. We can disable or enable virtual devices, or even remove them altogether. Let’s add our virtual adapter to create a subnet of virtual machines by clicking on the “Add” button. Add the VMnet2 adapter and click the “Apply” button. As a result, we have another virtual network interface on the host and a subnet with an automatically assigned address like 192.168.x.0/24. On the “Host Virtual Network Mapping” tab, we can make sure that the created adapter is bound to the VMnet2 switch, and view or change its subnet. Next, let's move on to the next tab, where we can attach a DHCP server to various virtual switches.


Here we see that the DHCP server is running for virtual switches VMnet1 and VMnet8. We can also add the switch to the list of DHCP server clients by clicking the “Add” button, and it does not matter whether any host network interface is associated with it or not. At the bottom you can also see the status of the service that supports DHCP ( vmnetdhcp.exe), and we can stop, start or restart it.

Add the VMnet2 switch using the “Add” button and click “Apply”. DHCP is now assigned to our subnet, and we can edit its properties by clicking on the “Properties” button:

Here, in addition to the range of IP addresses assigned to virtual machines, we can configure the duration of IP address leases by DHCP clients (default and maximum). Thus, by attaching a DHCP server to the switch and creating a virtual host network adapter bound to it, we created our own Host-Only subnet.

As mentioned above, Host-Only network communication differs from NAT in the absence of only one NAT device. This device, which translates virtual machine IP addresses, can be associated with only one virtual switch and host virtual network interface. By default, the VMnet8 switch and the virtual network adapter associated with it are used as the basis for network communication via NAT. On the last tab “NAT” you can change the parameters of this network interaction:


In order to assign a NAT device to our VMnet2 network, select it from the combo and click “Apply”. After this, our virtual subnet on the VMnet2 switch becomes protected from outside penetration, and virtual machines using a NAT device can initiate outgoing connections to the external network, which will be processed by the VMware NAT server. The address translation service is implemented by the vmnat.exe process. From this tab it can also be installed, launched and restarted. For NAT server settings, click the “Edit” button.

Here you can configure the IP address of the gateway used by the NAT device, the UDP (User Datagram Protocol) timeout in minutes (how long the UDP protocol binding to the NAT network lasts) and Config port – the port through which you can obtain information about the status of the NAT device.

The “Active FTP” checkbox allows or denies opening an incoming connection from an external FTP server in Active Mode. If the checkbox is not checked, single-channel Passive Mode will be used. The “DNS” (DNS, Domain Name System) button allows you to manage the settings for DNS forwarding (redirecting requests to DNS). This feature can only be configured for Windows hosts. The OUI (Organizationally Unique Identifier) ​​checkbox should be checked only if you have changed the first part of the virtual machine's MAC address, which identifies the network card manufacturer (by default, VMware assigns its own OUI to all machines), and you want to allow these machines to use a NAT device .

NetBIOS protocol parameters include the NBNS (NetBIOS Name Service) name processor timeout, the number of retries for NBNS requests, and the NBDS (NetBIOS Datagram Service) timeout.

Building networks from virtual machines with multiple network adapters

As mentioned earlier, each virtual machine can have multiple virtual network adapters associated with different types of network communication and switches. By adding new network interfaces with different types of network communication to a virtual machine, you can deploy a true virtual infrastructure within the host system for testing complex distributed systems and for training purposes. For example, the structure of a virtual network on a host could be like this:


As can be seen from the figure, there are no problems in modeling complex complex systems on one physical computer, in which various types of servers, firewalls and client computers operate. All this can be done using the Virtual Network Editor utility. In addition, the VMware Workstation product, focused on the development and testing process, provides another tool for creating virtual networks between virtual machines, which has advanced capabilities - Virtual Machine Teaming.

Virtual Machine Teaming on VMware Workstation

VMware defines the category of its Workstation product as Development and Test for a reason. The VMware Workstation platform provides a wealth of tools needed by developers and software quality engineers in software development companies. One of the most effective features of the product is the creation of “teams” of virtual machines, united by virtual network segments for testing complex systems. Essentially, Virtual Machine Teaming implements the same capabilities as the Virtual Network Editor, but allows you to more easily create virtual networks by binding virtual machine adapters to different virtual network segments. For example, we need to test the following system: on one of the hosts there is a Web server that has 2 network interfaces - one for accessing it through a thin client from the user’s machine, the other for connecting to the database server, where the client sends requests via the Web -server. The structure of such a system is presented below:


Let's create three virtual machines, in accordance with the structure of the model, and add another virtual network adapter for the virtual Web server. After that, in the “File” menu of VMware Workstation, select New->Team. We further indicate where the virtual machine team files will be located, then select the “Yes” option when asked “Add Virtual Machines to the team now”. Next, go to the add virtual machines window:


Here we can add virtual machines using the “Add” button. Add the required machines, click “Next” and answer “Yes” to the question “Add LAN segments to the team now” to go to the window for adding network segments.


Here we add 2 network segments for the simulated system using the “Add” button and click “Next”. Then we go to the most interesting page - the page for binding virtual network adapters to network segments.


Here we can assign virtual network adapter bindings to the virtual network segments we need by simply checking the boxes for the corresponding network interfaces in the segment columns. In accordance with the structure of the model, we assign LAN segment 1 for the database server and Web server and LAN segment 2 for the Web server and client. Thus, after clicking on the “Finish” button, we will receive a command from virtual machines that meets the requirements of the simulated system.

Once the team is created, we can launch all the team's virtual machines with one click and immediately begin testing the system. It should be noted that virtual machines added to a team cannot be used independently, but only within it.

Some aspects of VMware networking

When a virtual machine starts, VMware Workstation and VMware Server automatically assign MAC addresses to virtual network adapters. The automatic address assignment system is such that virtual machines on the same host are guaranteed not to have the same MAC addresses. Therefore, if you only use one copy of the VMware platform on your organization's network, this system ensures that there are no physical address conflicts. However, if virtualization platforms are running on several hosts on the network at once, a situation of duplication of MAC addresses may arise, which will lead to conflicts in the network and unavailability of virtual machines. To avoid this, you can manually assign MAC addresses to virtual machines by adding a line like this in a vmx file in a text editor:

Ethernet[n].address = 00:50:56:XX:YY:ZZ

Where n is the serial number (starting from zero) of the virtual machine’s network interface, and XX, YY and ZZ are the corresponding components of the MAC address.

In addition, when using a virtual infrastructure based on VMware Workstation or VMware Server in a production environment, it is worth remembering that VMnet virtual switches are actually concentrators (“hubs”), that is, they duplicate traffic on all ports of VMnet devices. This creates potential security issues because a network interface running in promiscuous mode in one of the virtual machines could be listening to traffic destined for other clients of the virtual hub.

Conclusion

The VMware Workstation and VMware Server platforms are powerful tools for organizing network interaction between several virtual machines running simultaneously within a host. None of the desktop virtualization platforms currently on the market have the same networking functionality as VMware Workstation. When testing software, the platform's ability to model complex distributed systems is invaluable. In addition, on the VMware server platform, you can create “virtual server parks” with their own internal and external network connections; these systems are decoupled from the hardware and are very flexible in terms of transferring them to another platform. There are many possibilities hidden in setting up virtual networks, as well as various kinds of subtleties that allow you to configure virtual networks very, very flexibly and get the maximum effect from virtual machines.