Why docker switch to Linux containes error on Windows10 pc? - windows

I want to use docker on win 10. But I can not use images by "pull " because My engine is Windows . so I want to change to Linux . but something wrong with me . (I can use docker before switch to Linux containers)
maybe my hyper-v is not normal. but how to fix it .
There is my error info:
Unable to create: The command that stopped the run because the
preference variable "ErrorActionPreference" or the generic parameter
is set to Stop: Since an object was not found, Hyper-V tried to access
the object on the computer "DESKTOP-ILCQ0I2" To the wrong. Verify that
the virtual machine management service on this computer is running. In
New-Switch, : Line 121 In , : line 411
   In the Docker.Core.Pipe.NamedPipeClient.Send(String action,
Object[] parameters) location
C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Core\pipe
\NamedPipeClient.cs: line number 36    In the
Docker.Actions.<>c__DisplayClass28_0.b__0() location
C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs: OK No. 305    In the
Docker.WPF.TaskQueue.<>c__DisplayClass19_0.<.ctor>b__1() location
C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.
Cs: line number 59

try the following commands:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
reboot then:
Enable-WindowsOptionalFeature -Online -FeatureName Containers -All
if that does't work see this

Related

why Docker on Windows 10 after upgrade error?

Docker stopped running after upgrading to Docker version 20.10.14, build a224086 . At first, there was a long inscription Docker desktop starting, after Docker stopped. Updated through the built-in interface of the docker itself.
Windows 10
tried it :
dism / Online /Enable-Feature: Microsoft-Hyper-V /All
bcdedit /set hypervisorlaunchtype auto
When trying:
docker service rollback my-service = error (Error response from daemon: open \.\pipe\docker_engine_linux: The system cannot find the file specified.)

Problem with Docker on Windows Server 2019: not running Linux containers

I was trying to install Docker on a fresh Windows Server 2019 using this guide (other guides seem to use the same procedure).
NB: I was given a Windows Server 2019 with Hyper-V installed, but with no virtual machine.
My installation commands were:
Enable-WindowsOptionalFeature –Online -FeatureName Microsoft-Hyper-V –All -NoRestart
Install-WindowsFeature RSAT-Hyper-V-Tools -IncludeAllSubFeature
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Install-Package -Name docker -ProviderName DockerMsftProvider
Restart-Computer –Force
And then:
Get-VM WinContainerHost | Set-VMProcessor -ExposeVirtualizationExtensions $true
Which returns an error:
Get-VM : Hyper-V was unable to find a virtual machine with name "WinContainerHost".
At line:1 char:1
+ Get-VM WinContainerHost | Set-VMProcessor -ExposeVirtualizationExtens ...
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (WinContainerHost:String) [Get-VM], VirtualizationException
+ FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVM
Now, my first question is: what is WinContainerHost? Who did create it? I cannot see it in my Hyper-V Management Console.
Nevertheless, I try to go on with the Docker installation process:
Install-Module DockerProvider
Install-Package Docker -ProviderName DockerProvider -RequiredVersion preview
[Environment]::SetEnvironmentVariable(“LCOW_SUPPORTED”, “1”, “Machine”)
Restart-Service docker
After the process, typing docker --version, I get:
Docker version 17.10.0-ee-preview-3, build 1649af8
It seems that Docker is installed. I then try to launch a container with:
docker pull nginx:latest
which results in:
latest: Pulling from library/nginx
33847f680f63: Extracting [==================================================>] 27.15MB/27.15MB
dbb907d5159d: Download complete
8a268f30c42a: Download complete
b10cf527a02d: Download complete
c90b090c213b: Download complete
1f41b2f2bf94: Download complete
failed to register layer: failed to start service utility VM (applydiff 8f46920b86bdcdab20b89a73c657f59c52f0271fd2fa27bf87bb875c55c11f7a):
container 8f46920b86bdcdab20b89a73c657f59c52f0271fd2fa27bf87bb875c55c11f7a_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. (0xc0370102) extra info: {"SystemType"
:"container","Name":"8f46920b86bdcdab20b89a73c657f59c52f0271fd2fa27bf87bb875c55c11f7a_svm","Layers":null,"HvPartition":true,"HvRuntime":{"ImagePath"
:"C:\\Program Files\\Linux Containers","LinuxInitrdFile":"initrd.img","LinuxKernelFile":"bootx64.efi"},"ContainerType":"linux",
"TerminateOnLastHandleClosed":true}
My intuition tells me that the problem is with the Get-VM WinContainerHost | Set-VMProcessor -ExposeVirtualizationExtensions $true, but I cannot find a way to solve it.
Could someone please give me more insight on this? Thanks in advance.

SCCM - Configuration Item to check optional windows feature status

I have created a configuration item to check the status of the optional feature Internet Explorer.
The CI contains the following powershell script:
Get-WindowsOptionalFeature -FeatureName Internet-Explorer-Optional-amd64 -Online
The CI has been added to a Configuration Baseline and deployed to a test machine.
Running this powershell code manually outputs the following on a test machine
PS C:\WINDOWS\system32> Get-WindowsOptionalFeature -FeatureName Internet-Explorer-Optional-amd64 -Online
FeatureName : Internet-Explorer-Optional-amd64
DisplayName : Internet Explorer 11
Description : Finds and displays information and Web sites on the Internet.
RestartRequired : Required
State : Disabled
CustomProperties :
\SoftBlockLink : http://go.microsoft.com/fwlink/?LinkID=142507
and the related compliance rule is configured as follows:
I would assume this should result in being compliant - but actually it isn't.
I'm new to SCCM and therefor wondering if my rule is misconfigured.
Any ideas / input is highly appreciated.
Thanks in advance
Adjusted the powershell script to just output the actual state.
(Get-WindowsOptionalFeature -FeatureName Internet-Explorer-Optional-amd64 -Online).State

Issues enabling IIS-ASPNET module in windows nano server

I am running an application that requires IIS-ASPNET & IIS-ASPNET45 features enabled. When i run below commands in windowsservercore container it runs fine, but fails in nano server with below error message.
PS C:\> Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45 -all
Enable-WindowsOptionalFeature : Feature name IIS-ASPNET45 is unknown.
At line:1 char:1
+ Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45 -all
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Enable-WindowsOptionalFeature], COMExcepti
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand
Can someone help,
New Windows nanoserver images (1709+) do not feature IIS option anymore. Only older versions do. See comparison of original nanoserver image vs 1709.
Here is details link
PS C:\> docker run -it --rm microsoft/nanoserver powershell get-windowsoptionalfeature -FeatureName IIS-ASPNET45 -online
PS C:\> docker run -it --rm microsoft/nanoserver:1709 powershell get-windowsoptionalfeature -FeatureName IIS-ASPNET45 -online
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: container 19e874a98ea8bdd2175f2f1052adadc0b8ee015178f00441e874189addf729ad encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) extra info: {"CommandLine":"powershell get-windowsoptionalfeature -FeatureName IIS-ASPNET45 -online","User":"ContainerUser","WorkingDirectory":"C:\\","EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[64,213]}.

Docker hv-sock proxy (vsudd) is not reachable windows

I have docker 17.12.0-ce-win46 build installed on my window 10 laptop. Each time i start it I get the error below... I have followed all recommended solutions I could fine online on how to resolve this issue but the issue persist.
Docker hv-sock proxy (vsudd) is not reachable
at Docker.Backend.ContainerEngine.Linux.ConnectToVsud(TaskCompletionSource`1 vmId) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\ContainerEngine\Linux.cs:line 293
at Docker.Backend.ContainerEngine.Linux.DoStart(Settings settings, String daemonOptions) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\ContainerEngine\Linux.cs:line 260
at Docker.Backend.ContainerEngine.Linux.Start(Settings settings, String daemonOptions) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\ContainerEngine\Linux.cs:line 130
at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass9_0.b__0(Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeServer.cs:line 47
at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeServer.cs:line 145
For me, here is what I did to correct the error. Go to C:\Users\Public\Public Documents\Hyper-V directory, right click on Hyper-V folder, select Properties, and un-check the Read Only checkbox and Apply changes. Next, in the Windows task bar right click on the red Docker icon, or if it is located in the hidden icons, select Quit, then restart it.
You can revert to docker version 17.09.1.14687. 17.12.0-ce-win46 and 17.12.0-ce-win47 have this error.
Enable Hyper-V using PowerShell
Open a PowerShell console as Administrator.
Run the following command:
PowerShell
Copy
Enable-WindowsOptionalFeature -Online -FeatureName:Microsoft-Hyper-V -All
If the command couldn't be found, make sure you're running PowerShell as Administrator.
When the installation has completed you need to reboot the computer.
Enable Hyper-V with CMD and DISM
The Deployment Image Servicing and Management tool (DISM) helps configure Windows and Windows images. Among its many applications, DISM can enable Windows features while the operating system is running.
To enable the Hyper-V role using DISM:
Open up a PowerShell or CMD session as Administrator.
Type the following command:
PowerShell
Copy
DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
When the installation has completed you need to reboot the computer.
Please check if your system variable(Environment variable) if DOCKER_HOST is defined then remove and restart system and run the docker.

Resources