Reputation: 15113
I just install docker on a windows 2019 server to run linux containers.
I follow the this guide, "Running Linux Containers on Windows Server 2019" chapter. When i try to run the bash shell i got the following error:
docker.exe: failed to register layer: failed to start service utility VM (applydiffe53547ea1d150a4e4afba05378a3a45be5ea769d52fddf03ff25dbd09e43d20d): container e53547ea1d150a4e4afba05378a3a45be5ea769d52fddf03ff25dbd09e43d20d_svm encountered an error during CreateContainer: failure in a Windows system call: The virtual machine could not be started because a required feature is not installed.
Anyone knows what feature is missing?
Update: It seams the problem has to do with a first error on the procedure. When running:
Get-VM WinContainerHost | Set-VMProcessor -ExposeVirtualizationExtensions $true
it throws the error:
Get-VM : Hyper-V was unable to find a virtual machine with name "ContainerHost".
Witch i discard believing that was a guide in the script because there is no command to create this WinContainerHost virtual machine anyware.
Solving is more confusing, there are 2 types of containers, hyper-v and server containers, as posted in this guide. I am not sure what path to follow. I am pretty lost.
Upvotes: 14
Views: 9978
Reputation: 384
This is going to sound really DUMB, and I mean DUMB.
I have fixed this issue and I just cannot believe there are questions asked everywhere without and answer.
Basically you need to just create a Virtual machine in Hyper-V. It doesn't need an operating system or any special params.
This is it
New-VM -Name WinContainerHost -MemoryStartupBytes 1GB
After this the Get-VM works, Docker starts and runs linux containers.
I mean, what can I say!!!
Upvotes: 7
Reputation: 1620
Sorry, I don't have enough reputation to comment/ask more information.
Hyper-V containers or Moby VM are mandatory when running Linux containers - virtualization is required to run those containers. So in this case, you can't use "server containers".
Enable VT-x e.g. virtualization from BIOS - mandatory for nested virtualization. With AWS you need Bare Metal instance.
If these are OK, you could you try already mentioned command
Get-VM *WinContainerHost* | Set-VMProcessor -ExposeVirtualizationExtensions $true
Instead, if they name differs a bit. If still no success, Get-VM
command should list all VMs, what is the output?
You can install required modules for running LCOW with
Install-WindowsFeature -Name Hyper-V,Containers -IncludeAllSubFeature -IncludeManagementTools
And try again. If it still does not exist here is the script for creating "ContainerHost".
Upvotes: 5