Hyper-V inside a Server 2016 VM


Recommended Posts

Update

Thanks to Bungy's post I think I moved one step closer, however still no real success.

Appending the kvm-intel nested to the syslinux config did something right I think.

 

Before I couldn't install Hyper-V due to: "The processor does not have required virtualization capabilities".

However no Windows says I can't install Hyper-V due to: "The processor does not have second level address translation (SLAT) capabilities".

 

My CPU is 6800k and supports SLAT / EPT.

So now I'm stuck here :(

Link to comment

I just tried this out for myself and it worked on unRAID 6.3.2. No errors when enabling Hyper-V in Server Manager. Below is my XML for your reference:

 

<domain type='kvm' id='2'>
  <name>Server2016_2</name>
  <uuid>c0803c6e-8ce7-4efd-8143-cbc328512d12</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows Server 2016" icon="windows.png" os="windows2016"/>
  </metadata>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='8'/>
    <vcpupin vcpu='1' cpuset='9'/>
    <vcpupin vcpu='2' cpuset='24'/>
    <vcpupin vcpu='3' cpuset='25'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.7'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='2' threads='2'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='writeback'/>
      <source file='/mnt/user/domains/Server2016_2/Server2016.qcow2'/>
      <backingStore/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/ISO/Virtio/virtio-win-0.1.126.iso'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:49:a9:ad'/>
      <source bridge='br0'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/2'>
      <source path='/dev/pts/2'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-2-Server2016_2/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'>
      <alias name='input1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='vnc' port='5901' autoport='yes' websocket='5701' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none' model='none'/>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+0:+100</label>
    <imagelabel>+0:+100</imagelabel>
  </seclabel>
</domain>

Link to comment

I just tried this out for myself and it worked on unRAID 6.3.2. No errors when enabling Hyper-V in Server Manager. Below is my XML for your reference:

 

<domain type='kvm' id='2'>
  <name>Server2016_2</name>
  <uuid>c0803c6e-8ce7-4efd-8143-cbc328512d12</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows Server 2016" icon="windows.png" os="windows2016"/>
  </metadata>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='8'/>
    <vcpupin vcpu='1' cpuset='9'/>
    <vcpupin vcpu='2' cpuset='24'/>
    <vcpupin vcpu='3' cpuset='25'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.7'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='2' threads='2'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='writeback'/>
      <source file='/mnt/user/domains/Server2016_2/Server2016.qcow2'/>
      <backingStore/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/ISO/Virtio/virtio-win-0.1.126.iso'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:49:a9:ad'/>
      <source bridge='br0'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/2'>
      <source path='/dev/pts/2'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-2-Server2016_2/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'>
      <alias name='input1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='vnc' port='5901' autoport='yes' websocket='5701' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none' model='none'/>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+0:+100</label>
    <imagelabel>+0:+100</imagelabel>
  </seclabel>
</domain>

Thanks Bungy, just compared your setup with my setup line by line and found:

1) I used Unraid 6.3.0

2) GPU Passthrough

3) I'm using Win10 you are using Server 2016

4) It seems your setup is on SeaBios and not OVMF.

 

I've tried to resolve 1 and 2, upgraded unraid to 6.3.2 and using VNC. Still no luck.

Only difference now is SeaBios vs OVMF and Windows 10 vs Server 2016.

 

So question now becomes is it only Server 2016 that can do this? Shoudn't this also work with win 10? I've not been able to google anything that makes this a difference.

Would seabios vs ovmf make any difference here?

Maybe OVMF doesn't nest/support SLAT/EPT?

Link to comment

Win10 should work also. I originally tried ovmf and couldn't even get hyper-v enabled without using PowerShell. It worked once I switched to seabios. I'll give windows 10 a shot with the above XML and let you know how that works out.

 

Sent from my Nexus 5X using Tapatalk

 

 

Link to comment

Win10 should work also. I originally tried ovmf and couldn't even get hyper-v enabled without using PowerShell. It worked once I switched to seabios. I'll give windows 10 a shot with the above XML and let you know how that works out.

 

Sent from my Nexus 5X using Tapatalk

Oh, thanks :) I'm already installing Win10 on SeaBios to try it. So I'm already doing it myself, I'll confirm here when done.

 

Edit:

Blargh! Maybe I could have just changed the XML to SeaBios instead.

Anyways, I needed a secondary to experiment with anyways, so it's installing now anyways xD

 

Update:

Can confirm Hyper-V can install successful as soon as running on SeaBios.

So I guess that's it.

Link to comment

Win10 should work also. I originally tried ovmf and couldn't even get hyper-v enabled without using PowerShell. It worked once I switched to seabios. I'll give windows 10 a shot with the above XML and let you know how that works out.

 

Sent from my Nexus 5X using Tapatalk

Hey Bungy, thanks for your help so far. I've booted a Win10 and installed Hyper-V manager succesfully through "Programs and Features". However, I still can't seem to boot a VM in Hyper-V, it errors with same error message as I originally had.

 

Would you be able to try and see if your setup boots a VM in HyperV?

 

For me it doesn't want to boot anything, no matter if I select a physical disk, or create a new vhd.

Google doesn't give me much except the same problems using VMWare as main hypervisor.

 

Edit:

I'm afraid this leads back to the thread/bug that jonp is referencing: https://bugzilla.kernel.org/show_bug.cgi?id=106621

They specially state: "This, together with "-cpu host,-hypervisor,+vmx will allow Hyper-V to be installed. It will however not allow to start these Virtual Machines."

 

I'm really curious as to whether your setup can boot the VM in HyperV bungy :)

Link to comment

Win10 should work also. I originally tried ovmf and couldn't even get hyper-v enabled without using PowerShell. It worked once I switched to seabios. I'll give windows 10 a shot with the above XML and let you know how that works out.

 

Sent from my Nexus 5X using Tapatalk

Hey Bungy, thanks for your help so far. I've booted a Win10 and installed Hyper-V manager succesfully through "Programs and Features". However, I still can't seem to boot a VM in Hyper-V, it errors with same error message as I originally had.

 

Would you be able to try and see if your setup boots a VM in HyperV?

 

For me it doesn't want to boot anything, no matter if I select a physical disk, or create a new vhd.

Google doesn't give me much except the same problems using VMWare as main hypervisor.

 

Edit:

I'm afraid this leads back to the thread/bug that jonp is referencing: https://bugzilla.kernel.org/show_bug.cgi?id=106621

They specially state: "This, together with "-cpu host,-hypervisor,+vmx will allow Hyper-V to be installed. It will however not allow to start these Virtual Machines."

 

I'm really curious as to whether your setup can boot the VM in HyperV bungy :)

My Sunday got away from me and I couldn't get started on this. I'll try to boot a VM tonight. While you wait for my progess, you can try to downgrade unRAID to the earlier 6.3 release candidates and see if it works there. I think I remember it working in rc3. Hopefully I'll have some news for you soon.

 

Sent from my Nexus 5X using Tapatalk

 

 

Link to comment
  • 1 year later...
  • 1 year later...

Hi, I get the same experience as L0rdRaiden using unraid 6.8.3 and hyperv 2019.

 

nested virtualisation enabled. Windows server 2019 boots, I can install the hyperv role successfully then system reboots to complete role installation. Looks like a crash occurs and the system boots to the recovery screen (asking for language).

 

Any thoughts would be appreciated.

 

Thanks.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.