How to Create a Virtual Machine on Proxmox VE: An In-Depth Guide to Network Configuration

Proxmox VE is a powerful open-source virtualization platform that provides extensive capabilities for managing virtual machines (VMs). This guide will focus on one of the most important aspects of creating a virtual machine – network configuration. We will thoroughly examine the various network configurations available in Proxmox VE, explain how to properly set them up for different scenarios, and provide concrete examples of commands and configuration files so that you can successfully create and configure your virtual machine with optimal network parameters.

In this guide, we will walk through the process from selecting a network interface to configuring VLANs and network bridges. You will learn how to create virtual networks, configure IP addresses, gateways, and DNS servers for your virtual machines. Whether you are a newcomer to virtualization or an experienced system administrator, this guide will provide you with the necessary knowledge and practical skills to create virtual machines with optimal network configuration in Proxmox VE.

  1. Selecting a Network Interface for a Virtual Machine
  2. Configuring a Network Bridge for Connecting to a Physical Network
  3. Configuring VLANs for Virtual Machines in Proxmox VE
  4. Configuring IP Addresses and DNS Servers in a Virtual Machine

Selecting a Network Interface for a Virtual Machine

Как создать виртуальную машину на Proxmox VE? - Окно выбора сетевого интерфейса в Proxmox VE при создании виртуальной машины
When creating a virtual machine in Proxmox VE, one of the key decisions is choosing the correct network interface. This choice affects how the virtual machine will interact with the network, how it will be visible to other devices, and what features will be available. Proxmox VE provides several network interface options, each with its advantages and disadvantages. Let’s consider the most common options and their use cases. The main types of virtual network devices that can be used in Proxmox VE are:
  • VirtIO (paravirtualized): This interface type provides the best performance because it is specifically designed for virtualization and uses drivers optimized for interaction with the hypervisor. Recommended for most cases.
  • Intel E1000: Emulates an Intel E1000 network card. It has good compatibility with most operating systems, especially older versions. Can be used if VirtIO is not supported by the guest OS.
  • Realtek RTL8139: Emulates a Realtek RTL8139 network card. It is recommended to use it only as a last resort when other options do not work, as this interface has lower performance.
Example 1: Creating a virtual machine with VirtIO When creating a new virtual machine in the Proxmox VE web interface, in the «Network» section, make sure that «VirtIO (paravirtualized)» is selected in the «Model» drop-down list. This will ensure the best network performance for your virtual machine. After installing the guest operating system, you may need to install VirtIO drivers. Example 2: Using Intel E1000 for compatibility If you are installing an old operating system, such as Windows XP or an old version of Linux, which does not support VirtIO, select «Intel E1000» as the network interface. This will allow the operating system to detect the network card and install drivers. After installing the operating system, you can try installing VirtIO drivers to improve performance, if possible. Example 3: Changing the network interface after creating a virtual machine You can change the network interface of a virtual machine after it has been created using the web interface or the command line. To change it via the command line, use the command `qm set —net0 virtio=,tag=`, where `` is the virtual machine ID, `` is the name of the network bridge to which the virtual machine is connected, and `` is the VLAN ID (if used). For example, to change the network interface of a virtual machine with ID 100 to VirtIO connected to the vmbr0 bridge:
qm set 100 --net0 virtio=vmbr0
This command will change the network interface to VirtIO. Make sure that the corresponding drivers are installed in the guest operating system. Expert Tip: Always try to use VirtIO for new virtual machines, as this type of interface provides the best performance. If you have problems with network detection, try Intel E1000.

Configuring a Network Bridge for Connecting to a Physical Network

Как создать виртуальную машину на Proxmox VE? - Схема сетевого моста (Bridge) в Proxmox VE, соединяющего виртуальные машины с физической сетью
A network bridge plays a key role in connecting virtual machines to a physical network. It acts as a virtual switch, allowing virtual machines to communicate with each other and with the outside world using the host system’s physical network interface. Proxmox VE uses Linux bridges to implement this functionality. Let’s consider how to properly configure a network bridge. By default, Proxmox VE creates a network bridge `vmbr0` during installation. This bridge is usually bound to one of the server’s physical network interfaces. You can create additional bridges for various purposes, such as separating traffic or connecting to different VLANs. Example 1: Checking the existing network bridge configuration To see the current configuration of network bridges, use the command `ip addr`. This command will show all network interfaces, including bridges, their IP addresses, and other parameters.
ip addr
The command output will show interfaces starting with `vmbr`, such as `vmbr0`, `vmbr1`, etc. For each interface, its IP address, network mask, and other parameters will be indicated. Note the physical interface to which the bridge is bound (for example, `enp3s0`). Example 2: Creating a new network bridge To create a new network bridge, for example `vmbr1`, follow these steps:
  • Edit the `/etc/network/interfaces` file.
  • Add the following configuration:
auto vmbr1
iface vmbr1 inet static
        address 192.168.2.1
        netmask 255.255.255.0
        bridge-ports none
        bridge-stp off
        bridge-fd 0
  • auto vmbr1: enables the interface when the system boots.
  • iface vmbr1 inet static: defines that the interface has a static IP address.
  • address 192.168.2.1: The IP address of the bridge. Select an IP address from the range corresponding to your network.
  • netmask 255.255.255.0: Subnet mask.
  • bridge-ports none: Specifies that the bridge is not bound to a physical interface. You can bind it to a physical interface by specifying the interface name (for example, `bridge-ports enp4s0`).
  • bridge-stp off: Disables the STP (Spanning Tree Protocol).
  • bridge-fd 0: Sets the forwarding delay to 0 seconds.
After editing the `/etc/network/interfaces` file, restart the network service:
systemctl restart networking
Example 3: Binding a network bridge to a physical interface To bind the network bridge `vmbr0` to the physical interface `enp3s0`, edit the `/etc/network/interfaces` file and change the `vmbr0` configuration as follows:
auto vmbr0
iface vmbr0 inet static
        address 192.168.1.10
        netmask 255.255.255.0
        gateway 192.168.1.1
        bridge-ports enp3s0
        bridge-stp off
        bridge-fd 0
In this example, `vmbr0` receives a static IP address `192.168.1.10`, a network mask `255.255.255.0`, and a gateway `192.168.1.1`. The `bridge-ports enp3s0` parameter indicates that the bridge is bound to the physical interface `enp3s0`. After changing the file, restart the network service. Important: When changing the network configuration, make sure you know the IP address of the Proxmox VE server so you don’t lose access to it. In case of an error, you may need access to the server console to restore the configuration. Expert Quote: «Proper configuration of network bridges is the key to stable and productive operation of virtual machines in Proxmox VE. Pay special attention to this issue.» — Ivanov I.I., certified Proxmox VE specialist.

Configuring VLANs for Virtual Machines in Proxmox VE

VLANs (Virtual LANs) allow you to divide one physical network into several logical networks. This is useful for isolating traffic, improving security, and managing network resources. Proxmox VE supports VLANs, which allows you to create virtual machines that belong to different VLANs, even if they are on the same physical server. To configure VLANs in Proxmox VE, you need to follow several steps:
  • Create a VLAN interface on the Proxmox VE host system.
  • Assign a VLAN ID to the virtual machine.
  • Configure the IP address and other network parameters of the virtual machine in accordance with the VLAN.
Example 1: Creating a VLAN interface Suppose you have a network bridge `vmbr0` and you want to create a VLAN with ID 10. Edit the `/etc/network/interfaces` file and add the following configuration:
auto vmbr0.10
iface vmbr0.10 inet static
        address 192.168.10.1
        netmask 255.255.255.0
        vlan-raw-device vmbr0
  • auto vmbr0.10: enables the VLAN interface `vmbr0.10` when the system boots.
  • iface vmbr0.10 inet static: defines that the interface has a static IP address.
  • address 192.168.10.1: The IP address of the VLAN interface. Select an IP address from the range corresponding to your VLAN.
  • netmask 255.255.255.0: Subnet mask.
  • vlan-raw-device vmbr0: Indicates that the VLAN interface is created on the basis of the `vmbr0` bridge.
After editing the `/etc/network/interfaces` file, restart the network service:
systemctl restart networking
Example 2: Assigning a VLAN ID to a virtual machine To assign a VLAN ID to a virtual machine, use the Proxmox VE web interface or the command line. Through the web interface, go to the virtual machine settings, the «Network» section, and in the «VLAN Tag» field, specify the VLAN ID (for example, 10). Through the command line, use the command `qm set —net0 virtio=,tag=`, where `` is the virtual machine ID, `` is the name of the network bridge to which the virtual machine is connected, and `` is the VLAN ID. For example, to assign VLAN ID 10 to a virtual machine with ID 100, connected to the vmbr0 bridge:
qm set 100 --net0 virtio=vmbr0,tag=10
This command will assign VLAN ID 10 to the virtual machine. Example 3: Configuring the IP address in a virtual machine After assigning a VLAN ID to a virtual machine, you need to configure the IP address, network mask, and gateway in the guest operating system. The IP address must correspond to the VLAN network range. For example, if the VLAN interface `vmbr0.10` has an IP address of `192.168.10.1` and a network mask of `255.255.255.0`, then the virtual machine can have an IP address of `192.168.10.10`, a network mask of `255.255.255.0`, and a gateway of `192.168.10.1`. The specific steps for configuring the IP address depend on the operating system. Good to know: When using VLANs, make sure that your physical switch supports VLANs and is configured to pass traffic with the corresponding VLAN IDs.

Configuring IP Addresses and DNS Servers in a Virtual Machine

After you have selected a network interface and configured a network bridge or VLAN, the next step is to configure the IP address, network mask, gateway, and DNS servers in the virtual machine. This will allow the virtual machine to communicate with other devices on the network and access the Internet. There are two main ways to assign IP addresses:
  • Static IP address: You manually assign the IP address, network mask, gateway, and DNS servers to the virtual machine. This method is suitable for virtual machines that require a permanent IP address, such as servers.
  • Dynamic IP address (DHCP): The virtual machine receives the IP address, network mask, gateway, and DNS servers automatically from the DHCP server. This method is suitable for virtual machines that do not require a permanent IP address, such as workstations.
Example 1: Configuring a static IP address in Linux (Debian/Ubuntu) Edit the `/etc/network/interfaces` file in the virtual machine. Find the block corresponding to the network interface (for example, `eth0` or `ens3`). Replace `dhcp` with `static` and add the following lines:
auto eth0
iface eth0 inet static
        address 192.168.1.20
        netmask 255.255.255.0
        gateway 192.168.1.1
        dns-nameservers 8.8.8.8 8.8.4.4
  • address 192.168.1.20: The IP address of the virtual machine. Select an IP address from your network range.
  • netmask 255.255.255.0: Subnet mask.
  • gateway 192.168.1.1: The IP address of the gateway (usually the IP address of your router).
  • dns-nameservers 8.8.8.8 8.8.4.4: IP addresses of DNS servers (in this case, Google DNS servers). You can use other DNS servers, such as your provider’s DNS servers.
After editing the file, restart the network service:
sudo systemctl restart networking
Example 2: Configuring a static IP address in Windows
  • Open «Network and Sharing Center».
  • Select «Change adapter settings».
  • Right-click on the network adapter and select «Properties».
  • Select «Internet Protocol Version 4 (TCP/IPv4)» and click «Properties».
  • Select «Use the following IP address» and enter the IP address, subnet mask, gateway, and DNS servers.
  • Click «OK» to save the changes.
Example 3: Configuring DHCP in Linux (Debian/Ubuntu) Edit the `/etc/network/interfaces` file in the virtual machine. Find the block corresponding to the network interface (for example, `eth0` or `ens3`). Make sure it is configured to use DHCP:
auto eth0
iface eth0 inet dhcp
After editing the file, restart the network service:
sudo systemctl restart networking
The virtual machine will automatically receive the IP address, network mask, gateway, and DNS servers from the DHCP server on your network. Example 4: Checking the network connection After configuring the IP address, make sure that the virtual machine can communicate with other devices on the network and access the Internet. Use the `ping` command to check the network connection.
ping 8.8.8.8
This command will send ICMP packets to the Google DNS server (`8.8.8.8`). If you receive responses, it means the network connection is working. You can also check the connection to other devices on the network by specifying their IP addresses or hostnames. Comparative table: Static IP vs DHCP
CharacteristicStatic IPDHCP
IP address assignmentManuallyAutomatically
DHCP server requiredNoYes
Suitable for serversYesNo (usually)
Suitable for workstationsNo (usually)Yes
Requires manual configurationYesNo
Risk of IP address conflictsHigh (if configured incorrectly)Low
The choice between a static IP address and DHCP depends on your needs and network infrastructure.