In this article I would like to deal with Windows performance under Bhyve. Like me already here FreeBSD bhyve with Windows 10 described, I use the machine for work to run various Windows applications.

I'm referring to FreeBSD here 12.1 Release Zweig. This information should not apply to other branches or. the patches come from the current branch, which forms the basis for the next release.

First we need a patch, which we store under / usr / src. After we applied the patch, we rebuild the kernel.

bhyve-rS349184-rS358848-combined

cd /usr/src
patch -C < bhyve-rS349184-rS358848-combined.diff
make buildkernel KERNCONF=GENERIC
make installkernel KERNCONF=GENERIC
reboot

Of course you should have installed the current version of vm-bhyve. Either from the ports or using pkg.

To further increase the performance of Windows under Bhyve, the KVM Virtio drivers should be used for storage controllers and networks. If you read through the various forums, but not all versions seem to be suitable. The versions are considered reliable 118-1 and 126-1. The drivers can be obtained from the following link:

Fedora Virtio Treiber Download

Without really creating benchmarks, but simply based on your own observations, Usability and trying out drivers based, I noticed, that the recently released drivers in the version 185-1 for my windows 10 The machine works best.

The best way to observe the behavior of the drivers is in Task Manager. If the drivers / OS combination is not optimal, the processor load is continuously on 100%, caused by the process “System interruptions”.

In addition, a small tool can be used to remedy the situation. TimerTool is a small exe, which modifies the Windows system timer. For this I have created a small batch that I have at system start, by means of task planning, let it execute. You can find the tool here:

Windows System Timer Tool Download

My batch looks the same, of course, like the example on the TimerTool homepage. For the sake of completeness, I'll post it anyway.

start "" "C:\timerTimerTool.exe" -t 0.5 -minimized
exit

Who is watching the tutorials on installing Windows on Bhyve, especially Windows 10, will find out, that only after successful installation, the drivers are changed on Virtio. This is not trivial with the storage controller and requires it, that the drivers are loaded in Safe Mode in order to be used as a new boot device. The individual steps:

Open an elevated command prompt and set the VM to boot into safe mode by typing
bcdedit /set {current} safeboot minimal
shut-down the VM and change the boot device type to virtio.
boot the VM. It will enter in safe mode.
Note: In Safe mode all boot-start drivers will be enabled and loaded, including the virtio driver. Since there is now a miniport installed to use it, the kernel will now make it part of the drivers that are to be loaded on boot and not disable it again.
in the booted VM reset the bcdedit settings to allow the machine to boot into the Normal mode by typing (in elevated command prompt again):
bcdedit /deletevalue {current} safeboot

I have often walked this path and can say, that it works reliably. I found the whole thing on superuser.com

Another interesting thread on this topic can be found in FreeBSD Forum

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.