Running FreeBSD on Hyper-v

Hyper-V supports both emulated and Hyper-V-specific devices for Linux and FreeBSD virtual machines. When running with emulated devices, no additional software is required to be installed. However emulated devices do not provide high performance and cannot leverage the rich virtual machine management infrastructure that the Hyper-V technology offers. In order to make full use of all benefits that Hyper-V provides, it is best to use Hyper-V-specific devices for Linux and FreeBSD. The collection of drivers that are required to run Hyper-V-specific devices are known as Linux Integration Services (LIS) or FreeBSD Integration Services (BIS).

Microsoft has worked with the FreeBSD community to contribute those BIS synthetic device drivers as well as corresponding daemons to FreeBSD 10.0. Furthermore, Microsoft is improving networking and storage performance running on Hyper-v and enriching functionalities, such as live backup VM. As for detailed feature description, refer to

In addition, Microsoft provides ports that contain the installable BIS drivers and corresponding daemons for older FreeBSD releases 9.x and 8.4.

This article will provide instructions on how to bring up latest FreeBSD 10.1 image on Hyper-v and use FreeBSD 9.3 as an example to highlight networking configuration and ports installation.

Create a FreeBSD VM

In short, follow “New Virtual Machine Wizard” to create a FreeBSD VM.

Please pay attention on “Specify Generation” and “Assign Memory”. Currently, BIS does not support Generation 2 VM and dynamic memory.

As for “Connect Virtual Hard Disk”, you could create a virtual hard disk and then install an operating system from a bootable CD/DVD-ROM, or use an existing hard disk.


Install FreeBSD

If you use existing virtual hard disk, ignore this step.

Review BIS running in FreeBSD VM

Run below commands in your FreeBSD VM, then you will see hv_*.ko and symbols for VMBUS, Storage, Networking and Utility. 

  #cd /boot/kernel
  #ls –l | grep hv

Run below command and then you will see KVP daemon is running.

  #ps –auxww | grep hv


Additional Notes for FreeBSD 9.x/8.4


If you need to use networking before BIS ports are installed, create “Legacy Network Adapter” first and then switch to “Network Adapter” after the synthetic networking driver of BIS is installed and loaded.

Please make sure following entry is present in /etc/rc.conf – ifconfig_de0="SYNCDHCP" and then reboot or run

  #ifconfig de0 down 
  #ifconfig de0 up
  #dhclient de0

Ports installation

Before using ports, you must first obtain the Ports Collection /usr/ports directory. The portsnap command allows you to install ports collection over the Internet. To grab collection and then extract the snapshot into /usr/ports, run

  # portsnap fetch
  # portsnap extract

And you will find BIS ports named “hyperv-is” under “/usr/ports/emulators”. To compile ports, you will need kernel source code. If it is not under “/usr/src/sys”, run  

  #mv src.txz / 
  #cd / 
  #tar –xf src.txz

To install BIS ports on FreeBSD 9.x, you need to add UUIDs for all devices listed in fstab before installation. For more information, see Add UUIDs for all devices listed in fstab.

To install BIS ports on FreeBSD 8.x, you need to disable the fast IDE driver or create GEOM labels. For more information, see Disable the Fast IDE Driver or Create GEOM labels on FreeBSD 8.x.

Now let us start to install ports. Run

  #cd /usr/ports/emulators/hyperv-is
  #make install
  #cd files
  #/bin/sh pkg-message.A
  #/bin/sh pkg-message.B

Reboot. You could run below commands and then see VMBUS, Storage, Networking and Utility drivers are loaded and also could see the network adapter named “hn0” now. Please also make sure following entry is present in /etc/rc.conf – ifconfig_hn0="SYNCDHCP".


 Appendix: Step-by-step Instructions

  • Create a FreeBSD VM

If you have existing FreeBSD virtual hard disk or download it from FreeBSD community FTP, you could go ahead with the option “Use an existing virtual hard disk”.

  •  Install FreeBSD 10.1


  • Create "legacy network adapter" for FreeBSD 9.3

  • Install BIS ports on FreeBSD9.3

Please follow Add UUIDs for all devices listed in fstab first. Otherwise, ports pre-install will fail.

Comments (7)
  1. Bayu Sanjaya says:

    Has anyone tried to compare KVM/XEN vs hyper-v?

  2. Mikhail Komarov says:

    If you use DHCP on FREEBSD, you need add ifconfig_hn00="DHCP" to file  /etc/rc.conf

  3. Mikhail Komarov says:

    If you use DHCP client on FREEBSD, you need add ifconfig_hn00="SYNCDHCP" to file  /etc/rc.conf

  4. Przemek says:

    Dear Kylie, Installed FreeBSD 10.1-RELEASE as VM guest on Windows 2012 R2 HyperV Server. It worls fine, but I've got two questions:

    1) hv_kvp_daemon started fine after install for first time, after second (an so on) reboots it not start anymore.

    2) Why attached virtual disk to guest is visible twice? It's visiblle as ada0 and da0… It's shown on your screenshots above, and the same happened to me.

    Thank for great post 🙂

  5. Tomek says:

    Dear Przemek,

    i have the same problem (1) as you. Did you solved it?

  6. Kentain says:

    As far as I can tell, ada0 is SATA, and da0 is SAS.. it appears that Kylie has it installed on both, and indicates to use ada0 on the step-by-step – although I'm unsure why, I would think that da0 would have been preferred?


    Mikhail talks about adding a line to rc.conf for DHCP client, but doesn't indicate why it's needed, or if it should be done before the reboot, or how to go about performing that task – I don't know what I'm doing but, I've gathered you'll want to get to the shell (command line) and use a built in text editor (like vi) to make that change.


    I understand that a great deal of this is out of scope for Microsoft, but when they decided to end their perimeter/unified threat management offerings/caching proxy (ISA/TMG) many of their customers are left with little choice but to learn this stuff.

    So far I've managed to use Windows Server 2008 R2 Hyper V to build a pfSense virtual machine (based on FreeBSD), which involved making sure every driver and firmware on the host was the absolute latest version. Now I'm working on FreeBSD, which apparently has some unresolved compatibility problem between 10.2 and 2008R2.. but 10.1 appears to work.. sort of ..

  7. Stuart says:

    How can I tell how fast my virtual NIC is connected at?  If I look at the results of ifconfig I don't see a Media option.  The Host NIC is a 1Gbps NIC so I'm expecting the same for the Host.  My Solarwinds network monitoring software only see's the NIC as a 10Mbps NIC though.

Comments are closed.

Skip to main content