Sunday, January 14, 2018

Installing Windows 10 in TrueOS (FreeBSD) in a bhyve container using iohyve

Here's an abbreviated HOWTO install Windows 10 using iohyve on TrueOS.
iohyve is a handy script that helps manage virtual machines in bhyve. More information is available here.

  1. Download installation ISOs
    You can use the Windows Media Creation Tool to download .iso files for Windows 10.
    Download the Red Hat VirtualIO network adapter ISO.
  2. Install the prerequisite packages for iohyve and bhyve
    pkg install tigervnc bhyve-firmware uefi-edk2-bhyve iohyve
  3. Initialize iohyve if you have never used iohyve before
    iohyve setup pool=zfs_poolname_here net=network_nic_here kmod=1
  4. Initialize components
    iohyve cpfw /usr/local/share/uefi-firmware/BHYVE_UEFI.fd
    iohyve cpiso /path/to/Windows_10_installer.iso
    iohyve cpiso /path/to/virtio-win.iso
  5. Create and configure device (example uses 32 gigabytes for C:)
    iohyve create win10 32g
    iohyve set win10 loader=uefi ram=2G cpu=2 vnc=YES vnc_tablet=YES vnc_port=6901 vnc_wait=YES bargs="-H -w" fw=BHYVE_UEFI.fd
  6. Install Windows 10
    iohyve install win10 Windows_10_installer.iso
    vncviewer localhost:6901

    ... stuff happens.
  7. Once install is completed and the VM shuts down, install the virtio network driver
    iohyve install win10 virtio-win.iso

    Navigate the explorer to the "d:" drive, open the NetKVM directory for your architecture, find the .inf file and right-click it to "Install." Congratulations, your VM can now download teh viruz!
  8. Do cool things to your Windows using zfs commands.
Some caveats about bhyve:
  1. You can't run bhyve and VirtualBox at the same time.
  2. If you try to run bhyve, and then want to run VirtualBox, it seems that it is not possible to kldunload the byhve module vmm that occupies the hypervisor (it is possible to unload nmdm).

No comments: