FreeBSD Virtual Machines on Microsoft Hyper-v

Introduction

Hyper-V supports both emulated and Hyper-V-specific devices for 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 FreeBSD. The collection of drivers that are required to run Hyper-V-specific devices are known as FreeBSD Integration Services (BIS).

For older FreeBSD releases (before 10.0), Microsoft provides ports which is available here:

http://svnweb.freebsd.org/ports/head/emulators/hyperv-is/

It contains the installable BIS drivers and corresponding daemons for FreeBSD virtual machines.

For newer FreeBSD releases, BIS is built in to the FreeBSD operating system, and no separate download or installation is required except for a KVP ports download that is needed for FreeBSD 10.0.

FreeBSD Integration Services (BIS) on Hyper-v

BIS provide Core, Networking, Storage, Memory, Video and other functionalities. For feature availability in each FreeBSD version, it is published here:

https://technet.microsoft.com/en-us/library/dn848318.aspx.

And it will be updated for upcoming FreeBSD releases. You also could learn best practices for running FreeBSD on Hyper-v and get detailed feature description.

Source code

Errata

FreeBSD 10.1 and 10.2 users should refer to the below 2 errata to update the kernels. FreeBSD 10.3 has included the fixes.

FreeBSD 11 users should refer to the below 1 errata to update the kernels.

Best Practice

  1. During startup, device nodes are created as new devices are discovered. This can mean that device names can change when new devices are added. If you get a ROOT MOUNT ERROR during startup, you should create labels for each IDE partition to avoid conflicts and changes. As for how, refer to https://www.freebsd.org/doc/handbook/geom-glabel.html.

  2. If the virtual switch on the host is based on wireless network adapter, reduce the ARP expiration time to 60 seconds by "sysctl net.link.ether.inet.max_age=60". Otherwise the networking of the VM may stop working after a while.
  3. How to connect to Virtual Machine on Hyper-V through virtual serial? For Generation 1 Virtual Machine, it is straightforward to add hardware – COM. For Generation 2 Virtual Machine, follow below steps.
    1. On the host, run below PowerShell command Set-VMComPort to add a virtual serial for the VM. Please run PowerShell as administrator.

      • Set-VMComPort -VMName <vm_name> -number 1 -path \\.\pipe\Testpipe
    2. Enable the serial in the VM. Below is the example of FreeBSD VM.
      • echo 'console="comconsole"' >> /boot/loader.conf
    3. Use putty to connect to the named pipe which is \\.\pipe\Testpipe in above example.

News

Contacts

FreeBSD

Microsoft

Further Information


CategoryVirtualization

HyperV (last edited 2018-03-12 18:50:33 by MarkLinimon)