Forum Discussion
doctordns
Mar 21, 2021Brass Contributor
[server 20303] Issues running containers
I have installed containers on my host ( a Hyper-V VM named CH1. After installation and installing PWSH and VS Code, I used this script to configure the server for docker: https://github.com/doctor...
- Mar 25, 2021
docker run hello-world --isolation-hyperv
should be
docker run --isolation=hyperv hello-world
Things after the container name are taken as parameters to the container execution, and so docker isn't seeing the "--isolation-hyperv" parameter when you add it, or it would have told you that it was an unknown parameter, as it needs to be "--isolation=hyperv" or "--isolation hyperv".
The hello-world container will need to run with Hyper-V isolation for you, because it's based on nanoserver:1809, i.e. Windows Server LTSC 2019. If you're following a guide for Windows 10, note that on Windows 10, Hyper-V isolation is the default for Docker, so they won't use --isolation=hyperv in examples like this.
To use process isolation, you'll need to use an insider container image base matching the installed build, e.g. mcr.microsoft.com/windows/nanoserver/insider:10.0.20303.1 . Sadly, I don't think many (or any) image sources in the wild produce builds based on the insider versions, so if you're not building your own containers, you'll need to use Hyper-V isolation until this version of Windows Server is shipped, and container builders add it to their CI pipelines.
ViniciusApolinario
Microsoft
Mar 22, 2021The version issue is not related to docker and Windows, but to the container host version and the container image. First, see that Windows container hosts can only run Windows images. Also, the host and container image versions must match. See more details at: https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility?tabs=windows-server-20H2%2Cwindows-10-20H2
As for the hyper-v isolation, since you're using a VM, you'll need to enable nested virtualization on that VM so the container can run with hypervisor isolation.
Regards,
Vinicius
Twitter.com/vrapolinario
As for the hyper-v isolation, since you're using a VM, you'll need to enable nested virtualization on that VM so the container can run with hypervisor isolation.
Regards,
Vinicius
Twitter.com/vrapolinario
doctordns
Mar 23, 2021Brass Contributor
Thsanks for your reply
1. Regarding enabling virtualization - I have already set nested virtualization:
PS C:\Foo> Get-VM -VMName ch1
Name State CPUUsage(%) MemoryAssigned(M) Uptime Status Version
---- ----- ----------- ----------------- ------ ------ -------
CH1 Off 0 0 00:00:00 Operating normally 10.0
PS C:\Foo> Get-VMProcessor -vmname ch1 | fl *virt*
ExposeVirtualizationExtensions : True
So that is not a solution. 😞
I do understand that the issue is between the container host version and the container image, but so far, I can find actually ZERO containers that can run with Windows Server 2022, with or without virtualization.
If you look at the scripts I have tested, none of them works, whereas these all worked to a degree with
Windows Server 2019. This feels like a regression in 2022.
Are containers actually tested prior to Insiders released? If so, can you share the tests so I can see how to get containers to run successfully??