bhyve windows 11 on bhyve

I have just upgraded some of our virtual desktop environments using https://github.com/builtbybel/Flyby11

So whoever uses a Windows 10 VM and wants to do in-place upgrades to Windows 11 - I can recommend this tool. It switches off some checks, like the one for compatibility by having a TPM 2.0 chip.
 
I run Win10 routinely in ESXi virtual machines without a hitch.

Does BHYVE offer a similar installation, where the VM host type is selected at creation time?
 
I don't know... might be just me - but somehow I trust these sorts of tools even less than Microsoft.
me neither, however, my trust in fumbling around in the registry as described by some random "how to bypass windows 11 checks" posts or article is just a little higher. We'll see what happens if Win 11 25H2 is released. I hope we have a stable TPM 2.0 emulation with FreeBSD/bhyve.

I run Win10 routinely in ESXi virtual machines without a hitch.

Does BHYVE offer a similar installation, where the VM host type is selected at creation time?
Windows 10 is no problem with bhyve. However, Windows 11 is because it checks various things, and one of the official requirements for Windows 11 to run is a TPM 2.0 chip - and FreeBSD/bhyve does not offer TPM 2.0 emulation.
 
We already have a functional TPM driver that works on Windows 11: tpm(4)

And add it to your kld_list for convenience.

Assuming you use vm-bhyve, plop this into your Windows 11 VM config:
Code:
bhyve_options="-l tpm,passthru,/dev/tpm0"
(Look ma, no registry hacking!)
Yes it works! I installed windows 11 from win11.img, not from usb, because when installing windows 11 it freezes if you do passthru usb host controller. I did the following: sudo dd if=/dev/da0 of=win11.img bs=4m status=progress, and then set it as a secondary hdd in bhyve cmd line. I also set one processor with 16 cores one thread each. During install I did not set an activation key, I activated windows after it was installed. Then I changed bhyve cmd (see attached picture). All works (but slowly). ...I haven't tried 'passthru' usb controller yet.

w11_bhyve.png
 
You probably want to change your CPU config so you don't end up with two sockets in the Windows 11 guest.

It's a licensing nightmare.
 
You probably want to change your CPU config so you don't end up with two sockets in the Windows 11 guest.

It's a licensing nightmare.
I have retail license, not OEM (if it somehow affects the situation). I set license right after install (with one processor), and now it continues to work (with two sockets).

:-/
 
It works but I found it caused a huge performance issue - forcing the vm to a single socket fixed it.
Yes, very slowly. That's why I stopped using Windows 11 as a bhyve guest. I use it as a VMware guest on Linux.

bhyve:

w11_on_bhyve.png


VMware (Debian 12):


w11_on_vmware_debian12.png
 
Hi!

I've done a windows 11 upgrade of my bhve vm today.

I am seeing my vm stuck with the win11 circle, when i have more than 1 vCPU together with GPU passthrough AMD RX6400 device.

On the host, i see the messages: bhyve: tpm_crb_mem_handler: cancelling a TPM command is not implemented yet
and the bhyve process stays running, is see host CPU consume.

All worked fine with FreeBSD 14.3 and Windows 10.

At what stage are we on FreeBSD with this?
Are there open Bugs (didnt find them) ?

I am on FreeBSD-15.1 with all possible updates.

command:

/usr/sbin/bhyve -AHPSw \
-c sockets=1,cores=8,threads=2 \
-m 32G -w \
-o acpi_tables_in_memory=false \
-l tpm,swtpm,/home2/vm/tpm_win/swtpm.sock \
-s 31:0,lpc -l bootrom,/usr/local/share/edk2-bhyve/BHYVE_UEFI.fd,fwcfg=qemu \
-s 0,hostbridge,model=i440fx \
-s 4:0,nvme,/dev/zvol/home2/vm/win10vol \
-s 5:0,nvme,/dev/zvol/home2/vm/tempdsk \
-s 6:0,virtio-net,tap0 \
-s 30:0,fbuf,tcp=0.0.0.0:5905,w=1900,h=1000 \
-s 30:1,xhci,tablet \
-s 8:0,passthru,131/0/0,rom=/home2/vm/Navi24.rom \
-s 8:1,passthru,131/0/1 \
win11
 
On the host, i see the messages: bhyve: tpm_crb_mem_handler: cancelling a TPM command is not implemented yet
I see the same messages. As for the performance of Windows 11 bhyve guest, there's no improvement—everything works just as slowly as it did a year ago (the mouse moves quickly, but clicks are slow, keystrokes are slow, windows open slowly, compiling in the terminal from the command line is slow, etc.). I have two dual-socket (Xeon Gold) servers. One has a hardware tpm2 chip, and I emulate it on the other using swtpm. But it's impossible to work—everything works so slowly. Therefore, if I need to work in Windows 11, I switch to VMware on Debian 13.

Server 1
server1.png


Server 2
server2.png
 
startup scripts:

Server 1
1) create tpm.sock
Code:
swtpm socket --tpm2 --tpmstate backend-uri=file:///var/run/swtpm/tpm.state --server type=unixio,path=/var/run/swtpm/tpm.sock --flags not-need-init --daemon
chmod 777 /var/run/swtpm/tpm.sock
chmod 777 /var/run/swtpm/tpm.state
2) run bhyve
Code:
sudo bhyve -c 16,sockets=2,cores=2,threads=4 -m 32G -A -H -w -S \
  -s 0,hostbridge \
  -s 3,ahci-hd,/troj/bsd/vms/w11_srv1.img \
  -s 5,ahci-cd,/troj/iso/virtio-win-0.1.240.iso \
  -s 6,virtio-net,tap1 \
  -s 7,passthru,59/0/0 \
  -s 8,hda,play=/dev/dsp,rec=/dev/dsp \
  -s 29,fbuf,tcp=0.0.0.0:5901,w=1920,h=1200,wait \
  -s 30,xhci,tablet \
  -s 31,lpc \
  -l com1,stdio \
  -l tpm,swtpm,/var/run/swtpm/tpm.sock \
  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,/troj/bsd/vms/w11vars/BHYVE_UEFI_VARS.fd \
  w11

Server 2
run bhyve
Code:
sudo bhyve -c 16,sockets=2,cores=2,threads=4 -m 32G -A -H -w -S \
  -s 0,hostbridge \
  -s 3,ahci-hd,/sarita/bsd/vms/w11_srv2.img \
  -s 5,ahci-cd,/sarita/iso/virtio-win-0.1.240.iso \
  -s 6,virtio-net,tap2 \
  -s 7,passthru,216/0/0 \
  -s 8,hda,play=/dev/dsp,rec=/dev/dsp \
  -s 29,fbuf,tcp=0.0.0.0:5902,w=1920,h=1200,wait \
  -s 30,xhci,tablet \
  -s 31,lpc \
  -l com1,stdio \
  -l tpm,passthru,/dev/tpm0 \
  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,/sarita/bsd/vms/w11vars/BHYVE_UEFI_VARS.fd \
  w11

Where '-s 7,passthru,59/0/0' and '-s 7,passthru,216/0/0' are:

Code:
xhci2@pci0:59:0:0: class=0x0c0330 rev=0x03 hdr=0x00 vendor=0x1912 device=0x0014 subvendor=0x1912 subdevice=0x0014
vendor = 'Renesas Technology Corp.'
device = 'uPD720201 USB 3.0 Host Controller'
class = serial bus
subclass = USB

xhci3@pci0:216:0:0: class=0x0c0330 rev=0x03 hdr=0x00 vendor=0x1912 device=0x0014 subvendor=0x1912 subdevice=0x0014
vendor = 'Renesas Technology Corp.'
device = 'uPD720201 USB 3.0 Host Controller'
class = serial bus
subclass = USB
 
Last edited:
GPU passthrough also works (I have an ASpeed AST2500 with 64MB on the motherboard). However, since TigerVNC only supports a framebuffer, I have to use xfreerdp instead. But in the end, Windows 11 remains just as slow as it was before.

Code:
ppt0@pci0:2:0:0:        class=0x030000 rev=0x41 hdr=0x00 vendor=0x1a03 device=0x2000 subvendor=0x1043 subdevice=0x86ed
    vendor     = 'ASPEED Technology, Inc.'
    device     = 'ASPEED Graphics Family'
    class      = display
    subclass   = VGA

Code:
xfreerdp /u:user \
/p:password \
/v:192.168.1.109 \
/from-stdin \
/bpp:24 \
/sound:sys:oss \
+fonts \
-sec-nla \
/sec-tls \
/cert:ignore \
/clipboard \
/dynamic-resolution \
/size:1920x1200

server1_rdp.png
 
The Sophia script runs under powershell 7 and will effectively remove win11 bloat.

Download the entire PS7 install files to a temp location then put the Sophia directory under PS.

No installation required as PS7 is a messy install in parallel with PS5.1 .

Customize the Sophia.ps1 file by commenting what you want to keep. I find the default is too severe and causes problems, and had to restore from a fresh checkpoint Sophia makes at startup.

BTW… I hate Win11 and won’t use it for myself except 1x yearly in a VM for TurboTax.
 
I hate Windows 11 too, but I can't give it up because our customers use it in their development. They use C++ from Visual Studio 2026, and we have to integrate our source code into a single CMakefile for CMake 4, which uses the Tool Gnerator for C++ 18.x. And we, on our side, are required to build and test joint project.
 
I hate Windows 11 too, but I can't give it up because our customers use it in their development. They use C++ from Visual Studio 2026, and we have to integrate our source code into a single CMakefile for CMake 4, which uses the C++ 18.x codebase. And we, on our side, are required to build and test joint project.
I use VS2026 insider and CMake 4.5 nightlies on Win10 (C++ desktop dev with Win11 SDK)
 
BTW… I hate Win11 and won’t use it for myself except 1x yearly in a VM for TurboTax.
Last year my employer offered up TurboTax for free via their HR website. The catch was that I had to use the web version. I fought off my anxiety and gave it a shot. It was actually no worse than the disc version you buy at Costco... my last remaining reason to keep a Windows VM available no longer exists. The fact that I'm still holding on to a VM that never runs says more about my packrat tendencies than anything else.
 
I run ESXi and have some 20-odd specialized VMs with different operating systems and applications.

For example my Delphi compiler had its own VM and Visual Studio on another.

One more VM for TurboTax is no problem.

One of my clients runs VMware Workstation on his Win10 machine just for TurboTax.
 
Back
Top