VirtIO and VMware VMXnet3 drivers for Linux, Windows and etc.

Why do you need VirtIO driver?

It's useful when you use Linux/Windows VMs in PVE.

Usually when you attach a network to the VM, you would click the "Hardware" -> "Network Device" -> "Bridge" -> "vmbr0" or "vmbr1" -> Choose Model: VirtIO (paravirtualized)

vmbr0 or vmbr1 is the network bridge you created in the PVE and it will bridge the VM with the router which your PVE connected with.

 

After you boot the VM, try to download the latest VirtIO drivers for Linux or Windows. More info can be found here: https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers

For enabling virtio drivers on Linux, here's the info : https://www.linuxquestions.org/questions/debian-26/%5Bsolved%5D-how-do-i-use-virtio-drivers-in-debian-in-a-kvm-virtual-machine-4175442186/

In short

add lines in file /etc/initramfs-tools/modules

virtio_pci
virtio_blk
virtio_net

then do the command

sudo update-initramfs -u

then reboot to check speed of IO

check whether virtio module is loaded: 

dmesg | grep -i virtio

 

 

What can VirtIO drivers give you? 

For faster ethernet. Mode VirtIO (paravirtualized) can bring up 10Gbps network speed.

The default Mode Intel e1000 can work fine on Linux and Windows at 1Gbps which is slow.

 

Tips

1) For selecting the default network adapter on Windows, please read here: https://services.northwestern.edu/TDClient/30/Portal/KB/ArticleDet?ID=1563

Also here's a video: 

How to Change Network Priority of Connection on Windows 10

 https://www.youtube.com/watch?v=ig6gtgIW6As

E.g. Windows can choose adapter #2 as default while adapter #1 will be used only if #2 is down.

 

Tests

Windows 11 VM (virtio ethernet via PVE network bridge vmbr1) <-> physical router <-> Synology DSM (same virtio ethernet via PVE network bridge vmbr1)

There is a docker iperf3 -s service instance running on the DSM with docker network setting as host

 

The speed is very low. It's about 282Mbps.

If we use a physical PC (2.5Gbps) -> 2.5Gbps switch -> Synology DSM vm in PVE with PCIE-Ethernet-passthrough (i226), the speed can be 2.35Gbps.

When you use a virtio ethernet card in DSM vm in PVE, you can't see the Ethernet negociation speed 

 

It's better to do pcie-ethernet-passthrough, because it can bring stable fast speed when the OS has stable driver inside.

 

VMware VXnet3 can be faster than VirtIO sometimes

 

When you use PVE bridge Mode VXnet3 VMware for Synology DSM VM in PVE,

You can see the speed

 

the speed is better (windows VM in PVE using VirtIO ethernet driver on Network bridge vmbr0 <-> DSM vm in PVE using mode VMware VXnet3 on the same Network bridge vmbr0). There's a iperf3 -s service on DSM vm.

 

Ubuntu vm (virtio on network bridge vmbr1 )<-via physical xiaomi 7000 router> DSM vm (Vmware vxnet3 on same work bridge vmbr1)

The speed is 555Mbps because the 2 VMs share 1 cable (1Gbps) to the physical router on the same PVE network bridge vmbr1. It should be 1Gbps but right now it's only 555Mbps.

 

From the OpenWRT vm (virtio on PVE network bridge vmbr0) <-physcial ISP router (1Gbps)> DSM vm (virtio on PVE network bridge vmbr0)

The speed is faster. Because because the 2 VMs transfer data directly on PVE network bridge VirtIO (paravirtualized). 

Why is it faster than 1Gbps (ISP router is 1Gbps)? Because the 2 VMs transfer data using PVE Network Bridge "vmbr0" which works like a "switch". The IO speed depends on the performance of "vmbr0". So it can be higher than 1Gbps.

 

Let's check what really happens in DSM vm (VMware VMXnet3 on vmbr1)

 

Alright. Let's set the speed to be 10000mbps using these commands manually

sudo ethtool -s eth0 autoneg on speed 10000 duplex full

Then check the speed 

sudo ethtool eth0

You will see VMware VMXnet3 actually doesn't support set speed using this

 

 

So you can't reach to 2.5Gbps via physical Router/Switch using virtual network bridges in DSM vm in PVE. 

 

To get 2.5Gbps or higher, just do the pcie-ethernet-passthrough and make sure the driver is functioning currectly.

 

posted @ 2024-06-16 09:39  spaceship9  阅读(12)  评论(0编辑  收藏  举报