Answered by:
Hyper-V in KVM

Question
-
Hello
I have a problem with running Hyper-V (MS Windows Server 2012 R2) in a KVM environment.
KVM is installed on a Ubuntu 14.0.04 LTS. The HyperV-VM has the vmx-Flag set, Model: Sandy-Bridge).
VT-X is enabled...
I installed Hyper-V with the command:
Invoke-Command -ScriptBlock { Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Online; Restart-Computer
Creating machines is no problem, but I can't start them.
Error: 'test' failed to start. (Virtual machien ID xxxx) The Virtual Machine Management Service failed to start the virtual machine 'test' because .....
In Device Manager everything seems to be good. Theres also "Microsoft Hyper-V Virtualization Infrastructure Driver" installed.
See output of Get-NestedVirtStatus.ps1-Script:
http://fs5.directupload.net/images/160316/htvvuc4c.png
I made also a test with the HyperV Server 2012 R2. The installations works fine, but same error on starting machines....
Does someone know why this error occurs?
Thx for your help.
Best regards
Michael
Wednesday, March 16, 2016 7:34 PM
Answers
-
Hi Michael,
I'm afraid your goal could not be achieved.
To use nested virtualization in Server 2016 TP4, both the physical Hyper-V host and the virtualized host need to run at least Windows Server 2016 Technical Preview 4 or Windows 10 build 10565.
Here are the details:
https://technet.microsoft.com/en-us/library/dn765471.aspx#BKMK_nested
Best Regards,
Leo
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.
- Marked as answer by MichaelSchwab Friday, March 18, 2016 7:21 AM
Thursday, March 17, 2016 9:11 AM
All replies
-
Hyper-V versions prior to 2016 cannot start virtual machines when nested.
Eric Siron
Altaro Hyper-V Blog
I am an independent blog contributor, not an Altaro employee. I am solely responsible for the content of my posts.- Proposed as answer by BrianEhMVP Wednesday, March 16, 2016 8:30 PM
Wednesday, March 16, 2016 8:08 PM -
Hello
Thanks for your answer. I tested it with Hyper-V 201Tech. 6 Preview 4.
Same error...
In Vmware Workstation everything works fine (also HyperV 2012), so I think it should also be possible with KVM.
Greatings
michael
Thursday, March 17, 2016 6:32 AM -
Hi Michael,
I'm afraid your goal could not be achieved.
To use nested virtualization in Server 2016 TP4, both the physical Hyper-V host and the virtualized host need to run at least Windows Server 2016 Technical Preview 4 or Windows 10 build 10565.
Here are the details:
https://technet.microsoft.com/en-us/library/dn765471.aspx#BKMK_nested
Best Regards,
Leo
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.
- Marked as answer by MichaelSchwab Friday, March 18, 2016 7:21 AM
Thursday, March 17, 2016 9:11 AM -
In Vmware Workstation everything works fine (also HyperV 2012), so I think it should also be possible with KVM.
I don't know why you would think that. KVM's virtualization technology is very different from VMware's. It will not work.Eric Siron
Altaro Hyper-V Blog
I am an independent blog contributor, not an Altaro employee. I am solely responsible for the content of my posts.Thursday, March 17, 2016 2:14 PM -
Lol, actually, it does work.
I've just installed Windows Server 2016 with hyper-v services & tools, inside a KVM virtual machine.
This lets me run Hyper-V Manager, and connect to another KVM virtual machine which has Hyper-V 2016R2 installed.
Both the Server 2016 VM and the Hyper-V VM are capable of running VMs themselves, so I have a fully functional Hyper-V cluster running under KVM on my linux host.
Wednesday, March 8, 2017 6:18 PM -
Yes, with 2016 it is possible. The question was not about 2016. It was about 2012 R2. If 2012 R2 detects that it is running inside a virtual machine, it will not start virtual machines of its own. This is a hardcoded block. If you've managed to use KVM to fool 2012 R2 into believing that it is not in a virtual machine, then stop gloating and share what you did so the OP can fix his issue.
Eric Siron
Altaro Hyper-V Blog
I am an independent contributor, not an Altaro employee. I accept all responsibility for the content of my posts. You accept all responsibility for any actions that you take based on the content of my posts.Wednesday, March 8, 2017 6:26 PM -
Bah, sorry I got a bit ahead of myself there.
You're correct in that i was only able to get the server 2016 VM to run another VM. The hyper-v VM is incapable of actually starting a VM.
What I find interesting is that you poo-pooh the idea because hyper-v is so "different" from vmware which will do nested virtualisation, & KVM which is happy to do nested virtualisation, but now you admit it's nothing to do with the capabilities of the nested environment provided by kvm to hyper-v - instead, it's a "hardcoded block", in hyper-v.
So, thanks a hell of a lot, to microsoft, for deliberately making this impossible, for no reason.
Wednesday, March 8, 2017 11:04 PM -
Le sigh.
If Hyper-V pre-2016 does not have direct access to specific hardware features, it will not be able to run virtual machines. That's why the VMs don't start. The hardcoded block is not some grand conspiracy. It is a great big void where there is no capability of properly running virtual machines when those hardware features are not directly available. Some other products will operate without those features because they are designed to operate without those features. That is because they are very different from Hyper-V.
If I take OP at his word, VMware Workstation is apparently able to fool 2012 R2 into thinking that it has direct access to those features, therefore Hyper-V 2012 R2 will run guest virtual machines nested in VMware Workstation. Unless someone has discovered something that no one else has, KVM is not able to fool 2012 R2 in a similar way. That is because VMware Workstation and KVM are very different.
2016 quite publicly addresses this very well-known feature disparity.
Eric Siron
Altaro Hyper-V Blog
I am an independent contributor, not an Altaro employee. I accept all responsibility for the content of my posts. You accept all responsibility for any actions that you take based on the content of my posts.Wednesday, March 8, 2017 11:32 PM -
Running Hyper-V nested in KVM is possible only with recent versions of KVM and it still has rough edges. Please take a look at:
https://ladipro.wordpress.com/2017/02/24/running-hyperv-in-kvm-guest/
https://ladipro.wordpress.com/2017/07/21/hyperv-in-kvm-known-issues/I have tried Windows Server 2012 R2 and it worked for me. You may need to pass something like -cpu SandyBridge,+vmx,-hypervisor to QEMU to make Hyper-V think that it's running on bare metal.
Tuesday, August 29, 2017 7:05 AM