Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error running linux container on windows 2019 server

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.

like image 451
MiguelSlv Avatar asked Oct 08 '19 15:10

MiguelSlv


People also ask

Can Linux container run on Windows Server 2019?

Running Linux Containers on Windows Server 2019 Out of the box, Docker on Windows only run Windows container. To use Linux containers on Windows Server, you need to use the Docker Enterprise Edition Preview which includes a full LinuxKit system for running Docker Linux containers.

Can you run a Linux Docker container on Windows?

It is now possible to run Docker containers on Windows 10 and Windows Server, leveraging Ubuntu as a hosting base. Imagine running your own Linux applications on Windows, using a Linux distribution you are comfortable with: Ubuntu!

Can container run on both Linux and Windows?

🔗 You can run both Linux and Windows programs and executables in Docker containers. The Docker platform runs natively on Linux (on x86-64, ARM and many other CPU architectures) and on Windows (x86-64).


Video Answer


2 Answers

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!!!

like image 174
Marc Nealer Avatar answered Oct 12 '22 23:10

Marc Nealer


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".

like image 35
Niklas Avatar answered Oct 13 '22 01:10

Niklas