34.1 Installing Windows 11 with bhyve and vm-bhyve
vm-bhyve is a command-line management tool for bhyve that wraps the underlying bhyve commands, simplifying virtual machine configuration management.
This section is based on FreeBSD 14.2-RELEASE and Windows 11 IoT Enterprise LTSC, covering the installation, environment configuration, and system image preparation of the bhyve virtual machine management tool.
Preparing the Windows Image
Windows 11 IoT Enterprise LTSC, version 24H2 (x64) - DVD (English) system download link (from MSDN I Tell You: https://next.itellyou.cn/):
The IoT version lists the Trusted Platform Module (TPM) as an optional requirement, and installation limits such as memory size are also more relaxed, lowering the deployment barrier.
SHA-256 checksum: 4F59662A96FC1DA48C1B415D6C369D08AF55DDD64E8F1C84E0166D9E50405D7A
Magnet link: magnet:?xt=urn:btih:7352bd2db48c3381dffa783763dc75aa4a6f1cff&dn=en-us_windows_11_iot_enterprise_ltsc_2024_x64_dvd_f6b14814.iso&xl=5144817664
Loading Kernel Modules
First, the kernel modules related to virtual machine management need to be loaded. vmm is the virtual machine monitor provided by the FreeBSD kernel, offering hardware-assisted virtualization support for bhyve. This module only needs to be loaded once; afterward, vm-bhyve will manage it automatically.
Tip
After a system reboot, there is no need to manually load it; vm-bhyve will automatically load this module.
# kldload vmm # Load the FreeBSD virtual machine management module (vmm)View the loaded vmm-related kernel modules. Among them, vmm.ko is the bhyve virtual machine monitor module, and vmmemctl.ko is the VMware memory balloon driver, which is unrelated to bhyve:
# kldstat | grep vmm
7 1 0xffffffff83320000 44b0 vmmemctl.ko
10 1 0xffffffff83400000 33e438 vmm.koInstalling vm-bhyve Related Software
Next, install the Unified Extensible Firmware Interface (UEFI) firmware, Virtual Network Computing (VNC) client, and vm-bhyve management tool. The UEFI firmware provides modern boot support for virtual machines, and the VNC client is used to access the virtual machine graphical interface.
Install using pkg:
Or install using Ports:
Configuring vm-bhyve
Edit the /etc/rc.conf file to enable the vm service and specify the virtual machine storage directory:
Tip
The
/home/yklashown in the examples in this section is a sample path; please replace it with the actual user home directory in your environment.
Create the template path:
Copy templates to the virtual machine template location:
Next, configure the virtual network. public is the virtual switch name specified by the template, and ue0 is the current host's physical network interface name; please modify it according to your actual network card (you can check it with the ifconfig command). The virtual switch uses bridge(4) to complete network bridging, connecting the virtual machine network stack to the host's physical network interface, allowing the virtual machine to directly access the physical network.
After creation, view the newly added vm-public:
Tip
If created incorrectly, you can delete the virtual switch with the following command:
View the assigned virtual switches:
To use the xHCI mouse on hosts running FreeBSD 13.0 and above, the USB HID subsystem must be enabled. Add the following to the /boot/loader.conf file:
Related file structure:
Configuring the Virtual Machine Template
Virtual machine templates are the base configuration files for creating virtual machines. The following demonstrates how to create and configure a Windows virtual machine template.
Tip
If running a version prior to Windows 10, or when installing Microsoft SQL Server on a Windows system, you need to use the parameter
disk0_opts="sectorsize=512"to set the disk sector size to 512.
Create a Windows virtual machine based on the template with a 40 GB disk:
Tip
Command to destroy a virtual machine:
The default template has issues and needs to be modified. The configuration file path is /home/ykla/vm/winguest/winguest.conf:
Note
In older versions of FreeBSD (prior to FreeBSD 14.0), /home/ is a symbolic link to /usr/home/, and both are identical.
Since FreeBSD 14, symbolic links are no longer used; the /home/ directory is used directly.
Installing the Windows System
In installation mode, vm-bhyve will wait for a VNC client to connect before starting the virtual machine, in order to capture the "Press any key to boot from a CD/DVD" prompt that Windows may display. At this point, vm list will show the virtual machine in a locked state:
Accessing Win11 via VNC
After the virtual machine starts, you must connect with a VNC client to complete the system installation:

After the Press any key to boot from a CD/DVD prompt appears, quickly press Enter a few times.
Tip
If you miss the key press and fall back to the UEFI Shell, stop the virtual machine and re-execute the installation steps above.



Change the second item to "Chinese (Simplified, Mainland China)".

Select "Chinese (Simplified, Mainland China)".

During installation, the VNC connection may disconnect several times; reconnecting will resume the session.
In tigervnc-viewer, enter localhost, click Connect, and then press any key to continue the installation process.
Tip
To stop the virtual machine: prefer using the
vm stopcommand to send an ACPI shutdown signal to the virtual machine. If the virtual machine is blocking the host shutdown, you can pressCtrl+Cin the tty to skip the wait and force a shutdown.If
vm stopis ineffective, use the SIGTERM signal:Wait approximately 10-30 seconds to confirm the process has exited, then run
bhyvectl --destroy --vm=winguestto clean up. Only usekill -9as a last resort if SIGTERM fails after multiple attempts (Warning: this may cause virtual machine disk data corruption).
Post-Installation Configuration
After the system installation is complete, initial configuration is required. The steps are as follows:

Select "China".
Start the virtual machine after installation:
Open a VNC connection to proceed.

Enter a username.

Enter a password.

Re-enter the password.

Enter security questions; the system will repeat this three times, requiring three different questions to be set.

Privacy settings. Adjust as needed, then click "Accept".

During installation, the system will perform updates; you can try to skip this step (testing has shown that oobe\bypassnro is ineffective), depending on your situation.


Chinese environment configuration:






Troubleshooting and Unresolved Issues
This section lists issues that may be encountered when using bhyve virtual machines and their solutions.
If you encounter problems, please restart the host first; if the problem persists, you can use ifconfig to check and remove extra network interfaces.
If the virtual machine remains in the stopped state for a long time, please check the network configuration.
View network configuration (virtual machine off):
View network configuration (virtual machine on); an additional network interface tap0 will appear:
Optional Configuration
The following are additional virtual machine management commands:
View all virtual machine statuses:
View a specific virtual machine status:
References
vm-bhyve Project. vm-bhyve/wiki/Running-Windows[EB/OL]. vm-bhyve Project, [2026-03-25]. https://github.com/churchers/vm-bhyve/wiki/Running-Windows. The tutorial primarily references this source, which details Windows virtual machine deployment; a Chinese version is available at vm-bhyve Wiki.
bhyve dev. The win11 release ISO requires the install-time regedit TPM workaround[EB/OL]. Twitter, (2021-10-08)[2026-03-25]. https://twitter.com/bhyve_dev/status/1446404943020056581. Provides a Windows 11 TPM bypass method.
rootbert. windows 11 on bhyve[EB/OL]. The FreeBSD Forums, [2026-03-25]. https://forums.freebsd.org/threads/windows-11-on-bhyve.82371/. Community discussion on Windows 11 deployment issues and solutions.
dadv. FreeBSD, bhyve и Windows 11[EB/OL]. livejournal.com, [2026-03-25]. https://dadv.livejournal.com/209650.html. Provides a Russian Windows 11 deployment guide.
FreeBSD Project. wiki/bhyve/Windows[EB/OL]. FreeBSD Wiki, [2026-03-25]. https://wiki.freebsd.org/bhyve/Windows. Official Wiki providing Windows virtual machine support information.
vm-bhyve Project. churchers/vm-bhyve/wiki[EB/OL]. vm-bhyve Project, [2026-03-25]. https://github.com/churchers/vm-bhyve/wiki. vm-bhyve official documentation.
srobb.net. Using Windows on FreeBSD's vm-bhyve[EB/OL]. srobb.net, [2026-03-25]. https://srobb.net/vm-bhyve.html. Provides a practical configuration guide for Windows virtual machines.
Microsoft. Minimum system requirements - Windows IoT Enterprise[EB/OL]. [2026-04-17]. https://learn.microsoft.com/en-us/windows/iot/iot-enterprise/hardware/system_requirements. Microsoft Learn. Windows 11 IoT Enterprise LTSC lists TPM 2.0 as an optional requirement.
FreeBSD Project. usbhid(4)[EB/OL]. [2026-04-17]. https://man.freebsd.org/cgi/man.cgi?query=usbhid&sektion=4. FreeBSD USB HID subsystem manual page.
Microsoft. Firmware WEG: Frequently asked questions (FAQ)[EB/OL]. [2026-04-17]. https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/frequently-asked-questions. Microsoft Learn. Windows UEFI boot requirements explanation; 64-bit Windows 7 requires CSM or 64-bit UEFI firmware support.
Last updated
