Finding the correct configuration for using a virtual machine for running the Yocto builds is not easy – and for other things also.
I have a new laptop, a ThinkPad with a 13th Gen Intel(R) Core(TM) i7-1360P 2.20 GHz processor, 32 GB of RAM, and Windows 11 Pro (23H2).
So I decided to migrate the very old Mandrake Linux VM I use for some old compiling builds, and the new Ubuntu 20.04 LTS VM I use for Yocto builds.
The first issue has been with using the Ubuntu VM with VMWare 17.5. It simply does not work (see here), and I had to revert to VMWare 17.0 to have a working machine.
The second issue has been with the Mandrake Linux VM. It is simply incredibly slow – the kernel loading time is on the order of minutes.
Searching on the Internet finds that there is a potential issue with the new Windows hypervisor settings. See here. The problem seemed to be that, since in the log I had the line
2023-01-22T09:26:16.952Z In(05) vmx Monitor Mode: ULM
I switched the memory isolation off and set the hypervisorlaunchtype to off. It did nothing and the performance did not change.
So I migrated the VM to Virtual Box, which worked (after some fighting to install the linux source package of the very old Mandrake 9.2 distribution, and compiling the virtual box Guest Additions).
At this point I decided to test the performance of VMWare and VirtualBox with the same VM.
I created two virtual machines with 8 processor cores, 8 GB of RAM and 20 GB of HD, with Ubuntu 20.04 LTS. In VMWare, the mitigation against the side-channel attacks was switched to off putting in the .vmx file the line:
ulm.disableMitigations="TRUE"
The performance benchmark was measured with hardinfo and sysbench.
After the first run with VirtualBox, done with the memory isolation off and hypervisorlaunchtype off (“modded” Windows cfg), I decided to switch back the memory isolation and hypervisorlaunchtype configuration to the standard one (“default” Windows cfg).
| Machine |
|
|
VirtualBox |
VirtualBox |
VMWare |
VirtualBox (VMWare HD) |
WSL2 Ubuntu |
| Windows cfg |
|
|
modded |
default |
default |
default |
default |
sysbench cpu
(events/s) |
Threads=1 |
higher is better |
n.a. |
3990.63 |
1730.44 |
4103.91 |
4030.06 |
| Threads=2 |
higher is better |
n.a. |
7580.10 |
2840.87 |
7991.29 |
7791.52 |
| Threads=8 |
higher is better |
n.a. |
20868.16 |
11522.57 |
23974.51 |
26679.99 |
| Threads=16 |
higher is better |
n.a. |
20990.99 |
11574.03 |
25237.46 |
38108.54 |
| hardinfo |
CPU Blowfish |
lower is better |
0.62 |
0.54 |
1.11 |
0.50 |
0.31 |
| CPU CryptoHash |
higher is better |
1509.54 |
1103.02 |
371.26 |
1520.22 |
2006.11 |
| CPU Fibonacci |
lower is better |
0.33 |
0.35 |
1.01 |
0.33 |
0.31 |
| CPU N-Queens |
lower is better |
7.99 |
6.98 |
28.60 |
6.96 |
9.72 |
| CPU Zlib |
higher is better |
0.05 |
0.04 |
0.56 |
0.05 |
3.18 |
| FPU FFT |
lower is better |
0.44 |
0.47 |
1.88 |
0.52 |
0.41 |
| FPU Raytracing |
lower is better |
1.06 |
1.19 |
4.71 |
1.08 |
1.01 |
| GPU Drawing |
higher is better |
20098.72 |
20475.80 |
n.a. |
20555.37 |
24410.46 |
VirtualBox beats VMWare in all tests, though the CPU load measured by the Windows Resource Monitor is 40% with VMWare and 80% with VirtualBox. However, we also observed that running with VMWare and more than 8 processor cores “hangs” the Windows host.
The last column contains the same benchmark made with the Windows Subsystem for Linux and an Ubuntu 20.04 VM. This is not limited to 8 processor cores, so the performance can be higher. However, the VirtualBox VM is closer to the WSL2 VM.
Unexpectedly, VirtualBox seems to be better than VMWare in my current environment.