
HowTo: Run Hyper-V/Docker on Hyper-V Virtual Machine
17 November 2016TL:DR; On the Hyper-V host run Set-VMProcessor -VMName “<Your Virtual Machine Name>” -ExposeVirtualizationExtensions $true
If you are like me, you may run all your Dev Environments from within Virtual Machines, leaving your base OS install as clean as possible – albeit with MS Office, Browsers etc. installed.
In recent projects I’ve been working with containerisation of system deployments with Docker. This has required me to have docker installed on my Virtual Machines. In order to run docker on Windows 10, i’ve needed to have Hyper-V installed… Hyper-V running on a VM !? Yup, it’s possible!
Prerequisites
- A Hyper-V host running Windows Server 2016 or Windows 10 Anniversary Update;
- A Hyper-V VM running Windows Server 2016 or Windows 10 Anniversary Update;
- A Hyper-V VM with configuration version 8.0 or greater;
- An Intel processor with VT-x and EPT technology.
Configure Nested Virtualisation
- Create a virtual machine.
- While the virtual machine is in the OFF state, run the following command on the physical Hyper-V host. This enables nested virtualisation for the virtual machine.
Set-VMProcessor -VMName “<Your Virtual Machine Name>” -ExposeVirtualizationExtensions $true - Start the virtual machine.
- Install Hyper-V within the virtual machine, just like you would for a physical server.
[…] Containerisation of system deployments with Docker requires me to have docker installed on my Dev Virtual Machines. Here's how to do it. […]
Works perfect. Thanks !
I am trying to follow the same steps but when I try to start VM inside windows10 guest operating system it is giving error – one of the hyperv component is not running
I am trying to follow the same steps but when I try to start VM inside windows10 guest operating system it is giving error – one of the hyperv component is not running
My mistake my VM configuration version was 7.0 , Working now thanks!
Nice one – I was using VirtualBox, then I spun up a VMWare player Linux system for dev work (everything web I do ends up running on linux once live), then I installed docker locally on my Win10 Pro host OS which needed Hyper-V thus preventing the other VM software from working…
Migrated a Win10 Pro VM from VirtualBox to Hyper-V with vGPU and wow it is way faster now to use Adobe products. This is my wife’s vm as her laptop is a real low spec HP Stream 11. So Now I’m figuring out how to move my stuff to Hyper-V VM and my curiosity was “so how about docker for windows inside a guest vm on hyper-v?” and here we are, cheers David. I’m actually considering running Server 2016 as the VM and then both wife & I just use this machine.
My laptop is beastly, i7-6820HK @ 3.8GHz / 64GB RAM DDR4 / GTX 980m 8GB GDDR5 and having to lug it to and fro between office and home sucks. We have 30Mbps up/down at home and the office, so should be able to simply leave the laptop at home and just RDP in with the remotefx vgpu thin client. fingers crossed!