LinkedIn Sourceforge

Vincent's Blog

Pleasure in the job puts perfection in the work (Aristote)

When wifi is not supported, just run a VM

Posted on 2024-08-06 20:57:00 from Vincent in OpenBSD

I'm using a brand new laptop (T14s) with a wifi driver not supported by several BSD systems. So, the workaround is to install a VM host and run your preferred OS inside a VM

This blog post will show you how this impact performances


Introduction

Having bought a new Lenovo T14s AMD, I'm able to run my preferred OS: OpenBSD.
Everything runs as it should, even the touch screen ;).

But in the context of my current job, I need to run FreeBSD. Unfortunately there is no wifi driver for this OS.
My solution was to install a linux system having KVM on it. And run FreeBSD as a VM on it.

This blog post will show you what a re the consequences of this setup.

Setup

My T14s is composed of the following elements:

  • AMD Ryzen 7 Pro 7840U
  • Lenoveo T14sGen 4
  • Nbr of CPU: 16
  • RAM: 32GB
  • disk NVMe SKHynix HFS001TE
  • Wifi: Qualcomm QCNFA765

Not knowing the Linux evolution since +15 years, I've decided to install Fedora. I don't know if this is a valid choice. But, amongst all Linux distro, this is a one I've heard in the past.
The installation process is ridicoulsly simple.
I don't know details of what I've installed (reason why I don't like Linux), but it work on this laptop and propose a tool called Boxes which allow creation of VM.
Nevertheless, this installation does not remove my OpenBSD partition. Thanks to UEFI I'm able to dual boot OpenBSD and Fedora.
This will be an element of comparison later ;)

On this Fedora VM system, I've installed the following VM:

  • OpenBSD 7.5. I'll use it as comparison with the "physical" install
  • FreeBSD 14
  • Fedora 40. For comparison too.

Thanks to Boxes and Fedora, a network system is build so my VMs can reach internet. I don't know the details of this setup.

Network performance impact

To measure the impact on Network side, I'll use the following:

$ time wget http://cdn.openbsd.org/pub/OpenBSD/7.5/src.tar.gz

In every tests, Wget will always be the version 2.1.0

For sure such measures are not rigorous:

  • my T14s is conected to my wifi access point. I'm alone at home, but external elements could come to impact the wifi signal
  • between each tests, the CDN server could have more or less usage, traffic, ...
  • I try to avoid situation where the Fedora host trigger a download, ...

Anyhow, to try to remove those external bias, I'll do 3 measures each time.

Before starting a new VM I kill existing one. So, each time a VM is performing a test, this is the only one running on the machine. All other applications are killed.

Results

Machine        | duration in sec  | avg MB/sec
---------------|------------------|-----------
Fedora phy     | 18.3             | 10.66
Fedora phy     | 19.6             | 9.64
Fedora phy     | 21.2             | 8.04
OpenBSD 7.5    | 85               | 2.63 
OpenBSD 7.5    | 83               | 2.65 
OpenBSD 7.5    | 87               | 2.58 
VM OpenBSD 7.5 | 22.2             | 8.75
VM OpenBSD 7.5 | 26.2             | 7.44
VM OpenBSD 7.5 | 25.9             | 7.53
VM FreeBSD 14  | 20.8             | 9.37
VM FreeBSD 14  | 18.6             | 10.4
VM FreeBSD 14  | 18.7             | 10.4
VM Fedora      | 18               | 10.67
VM Fedora      | 18.3             | 10.62
VM Fedora      | 18.3             | 10.63

Observations

FreeBSD VM and Fedora VM are quite similar ;)
The OpenBSD VM is a bit slower, but this is not significant.
Nevertheless, we see that When installed directly on the physical machine, OpenBSD is much slower.

We can conclude that using a VM is better for BSD OSes on this T14s machine :(.
This is unfortunately often the case on new hardware.

IO performance on disks

The inital goal of this test was to let run FreeBSD on a laptop where Wifi driver is not present.
But since results are quite good, I would take some extra measure in order to check the IO impact of those VM.

This time I would how a VM will impact IO performance on disk.
To perform such test, I will do the following command:

$ time dd if=/dev/random of=bigfile bs=1M count=30720

For info, bs is the block's size. In this case 1 MB. And as you deduce, 30720 x 1024 KB = 30 GB

Results

 Machine        | transfer in sec  
 ---------------|------------------
 Fedora phy     | 2.807            
 Fedora phy     | 2.976            
 Fedora phy     | 2.951            
 OpenBSD 7.5    | 2.302            
 OpenBSD 7.5    | 2.238            
 OpenBSD 7.5    | 2.276            
 VM OpenBSD 7.5 | 7.149            
 VM OpenBSD 7.5 | 6.663            
 VM OpenBSD 7.5 | 6.441            
 VM FreeBSD 14  | 3.848            
 VM FreeBSD 14  | 3.364            
 VM FreeBSD 14  | 3.335            
 VM Fedora      | 2.367            
 VM Fedora      | 2.63             
 VM Fedora      | 2.90

Observations

We clearly see that OpenBSD inside a VM is much slower. At contrario, on the same hardware, OpenBSD is slightly faster than Fedora ;). But the difference is not relevant.

Conclusions

Running BSD OSes on a brand new hardware is risky. Not all required drivers could exist.
The solution is to run those OSes within a VM ;).
The losses are not too important.
At least you can still enjoy your favorite OS.



2, 3
displayed: 1688



What is the first letter of the word Moon?