Freenas Virtio Drivers
VirtIO can provide better performance when the operating system installed in the VM supports VirtIO paravirtualized network drivers. By default, the VM receives an auto-generated random MAC address. To override the default with a custom value, enter the desired address in MAC Address.
If you plan on running Windows, it is highly advised that you are running FreeBSD 11+ and use UEFI graphics support. First of all you will need to make sure you have the UEFI firmware if not already installed: # pkg install bhyve-firmware Guest Configuration Create a guest using the Windows template. This guest defaults to 2 cpus and 2GB of memory.
It also uses an e1000 Intel network adapter which is support by Windows out-of-the-box. Use the vm configure guest command if you would like to change also configuration options. Note that if you are running a version of Windows older than Windows 10, you will need to set the disk sector size to 512 using the disk0_opts='sectorsize=512' option. # vm create -t windows winguest Installation Start the installation as normal by specifying the Windows iso file.
When run in install mode, vm-bhyve will wait until a VNC client is connected before starting the guest. This allows you to catch the 'Boot from CD/DVD' option that Windows may display. You can see in vm list that the guest will show as locked at this point. # vm install winguest Windows-Installer.iso Once connected with a VNC client, complete the Windows installation as normal. Adding VirtIO network drivers While the e1000 network adapter works out of the box and allows the guest to get network access, it is recommended to use the virtio-net device where possible. There are several ways of installing these drivers.
• If the machine has Internet access via the e1000 device, you can download and install the virtio drivers directly in the guest. Once installed, shutdown the guest, change the device in guest configuration and restart. • The guest can be booted in install mode, but specifying the VirtIO ISO file. # vm install winguest virtio-installer.iso • A CD device can be added to the guest and pointed at the ISO file disk1_type='ahci-cd' disk1_dev='custom' disk1_name='/full/path/to/virtio-installer.iso' Regarding CPUs Some versions of Windows (most desktop versions) do not support more than one physical CPU. By default, bhyve configures every virtual CPU and a separate package. The hw.vmm.topology.cores_per_package sysctl can be modified to tell bhyve to create multiple cores per CPU, rather than separate packages. For example, setting this sysctl to 4 will cause a guest with 8 vCPUs to have 2 x 4 core packages.
Hw.vmm.topology.cores_per_package must be set in /boot/loader.conf (and a reboot to take effect). On FreeBSD 12, when using vm-bhyve 1.3, it's possible to control CPU topology for each guest using configuration options - cpu=8 cpu_sockets=2 cpu_cores=4 cpu_threads=1.
Windows 10 installing on a FreeBSD 11.0 Bhyve VM With FreeBSD 11 comes a new version of Bhyve with a feature that makes installing Windows 10 a snap: a VNC accessible framebuffer driver! This lets any GUI OS, such as Windows, boot into graphics mode on the console. Previously getting Windows working was possible but required a lot of effort to create a custom install ISO and use Windows’ archaic installer command line interface.