I just installed Docker on Windows 10.
When I run Docker as an administrator I get the following error:
Unable to create: The running command stopped because the preference
variable "ErrorActionPreference" or common parameter is set to Stop: Hyper-V
encountered an error trying to access an object on computer 'WP2975' because
the object was not found. The object might have been deleted. Verify that
the Virtual Machine Management service on the computer is running.
at New-Switch, <No file>: line 121
at <ScriptBlock>, <No file>: line 411
at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters)
in C:\workspaces\stable 18.09.x\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeClient.cs:line 36
at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean
showWelcomeWindow, Boolean executeAfterStartCleanup) in
C:\workspaces\stable-
18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 92
at Docker.Actions.<>c__DisplayClass19_0.<Start>b__0() in
C:\workspaces\stable-
18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 74
at Docker.WPF.TaskQueue.<>c__DisplayClass19_0.<.ctor>b__1() in
C:\workspaces\stable-
18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.cs:line 59
I checked if Hyper-V is running on the computer.
I also did the following in powershell:
Ensure Windows Hyper-V featutes are enabled by running PowerShell cmdlet:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -Verbose
Ensure Windows Containers feature is enabled by running PowerShell cmdlet:
Enable-WindowsOptionalFeature -Online -FeatureName Containers -All -Verbose
Ensure Hypervisor is set to auto start in the Boot Configuration Database (BCD)
by running in elevated command prompt the command:
bcdedit /set hypervisorlaunchtype Auto
( Found it on: Failed to start the virtual machine 'MobyLinuxVM' because one of the Hyper-V components is not running )
But nothing helps.
I also reinstalled docker two times.
Please do make sure that the following three windows services are in running state
HV Host Service
Hyper-V Host Compute Service
Hyper-V Virtual Machine Management
If Windows 10 you're referring to has an ancient edition (lower then anniversary, i.e. 1607) there is no chance in hell you can get it working. To check version of your OS run 'winver'. The problem with these editions is that they don't support nested virtualization Docker require.
Now, it's not clear WHERE are you running your VM. If it's VMWare on your PC it should be relatively easy to fix, but if it's Cloud, can be a different story. The thing is that in Azure, for instance, not all VMs support nested virtualization, so if you hastened to provision a VM, it might be a problem. If you want to get it right, use v3 VM types and up (refer this article for more info).
In my case 'HV Host Service' didn't work as well, but fortunately I was able to resize a VM to a proper tier (v3) and voila! Docker started right away.
Related
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.
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!!!
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".
Why do I keep getting this error. It has been days now googling and trying to find a solution for this issue. I have no clue how to resolve this can someone please help me understand how to fix this ?
docker version:
Version 2.0.0.3 (31259)
Channel: stable
Build: 8858db3
Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Hyper-V was unable to find a virtual switch with name "DockerNAT".
at New-Switch, <No file>: line 121
at <ScriptBlock>, <No file>: line 411
at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeClient.cs:line 36
at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean showWelcomeWindow, Boolean executeAfterStartCleanup) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 92
at Docker.Actions.<>c__DisplayClass19_0.<Start>b__0() in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 74
at Docker.WPF.TaskQueue.<>c__DisplayClass19_0.<.ctor>b__1() in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.cs:line 59
I also spent days trying to install and get Docker working correctly on Windows. It turned out that the company's antivirus had rules to block the creation of virtual switches. Also, uninstalling Docker left things behind which prevents a fresh install. Here is what I suggest doing:
Uninstall Docker.
Disable antivirus.
Make sure '%userprofile%.docker' does not exist.
Enable 'Container' and 'Hyper-V' in 'Turn Windows features on or off'.
Install Docker for Windows.
After uninstalling and installing multiple times, despite 'Hyper-V' is enabled, I kept getting this error.
Running the MOFCOMP command and a reboot fixed this problem for me.
Running this command: (Command Prompt as administrator)
MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof
Then restart.
I had the same issue, here is what worked for me:
Turn off the Hyper-V setting in Control Panel->Programs and Features ->"Turn Windows features on or off"
Restart computer
After computer has been restarted, your existing docker instance will detect that your Hyper-V setting is turned off and will ask you if you want to allow docker to enable the Hyper-V feature
Click "Yes" to allow docker to enable the Hyper-V feature on your machine
From there allow docker to start and do its thing
After doing these steps the error went away and my docker instance was working again.
Hope this solves your issue. Enjoy!
I continue to get the following error when trying to start docker on Windows 10 pro. my HyperV is turned on and running:
Version 18.04.0-ce-win62 (17151)
Channel: edge
e0a85f6
Any help would be appreciated!
Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Hyper-V encountered an error trying to access an object on computer 'C001715587' because the object was not found. The object might have been deleted. Verify that the Virtual Machine Management service on the computer is running.
at New-Switch, : line 117
at , : line 394
at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeClient.cs:line 36
at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean showWelcomeWindow, Boolean executeAfterStartCleanup) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 75
at Docker.Actions.<>c__DisplayClass15_0.b__0() in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 59
at Docker.WPF.TaskQueue.<>c__DisplayClass19_0.<.ctor>b__1() in C:\gopath\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.cs:line 59
You may need to fix your "Control Flow Guard" settings for vmcompute.
(Be aware that CFG is an exploit-protection mechanism, so pay attention when changing it and understand why it exists.)
Open Windows Security
Open App & Browser control
Click Exploit protection settings
Switch to Program settings tab
Locate C:\WINDOWS\System32\vmcompute.exe in the list and expand it
Click Edit
Scroll down to Control flow guard (CFG) and uncheck Override system settings
Start vmcompute from powershell net start vmcompute (or alternately start the Hyper-V Host Compute Service from the system Services app)
Restart PC
Open Hyper-V as Administrator
Connect to Server, Local computer, OK
The above worked for me when I couldn't run docker, then I realized I couldn't connect to my local machine on hyper-v. This is what finally worked.
Try this. It's sorting the problem of many people.
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon
I tried to run it from C:\Program Files\Docker\Docker\Docker Desktop.exe
And it worked.
Also, one more thing I added is I kept the Cisco AnyConnect VPN service running (although none of the VPNs were connected). I know this point sounds weird but I thought to share it.
If You, like me, already have an installed wsl2 distro on Your system (at the time You install Docker Desktop) and all the answers above did not help, than look if Your distro is actually running by hitting the command wsl -l -v
wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Running 2
docker-desktop Running 2
docker-desktop-data Running 2
If so, then shutdown Your wsl instance by running wsl -t Ubuntu-20.04 this fixed the issue on my system. Docker Desktop window came immediately up after the wsl instance was down.
I think the problem is that I already have a docker installed in this wsl instance.
If you facing
Unable to stop Hyper-V VM: Service 'Hyper-V Host Compute Service
(vmcompute)' cannot be started due to the following error: Cannot
start service vmcompute on computer '.'.
this error then follow the steps:
Open "Window Security"
Open "App & Browser control"
Click "Exploit protection settings" at the bottom
Switch to "Program settings" tab
Locate "C:\WINDOWS\System32\vmcompute.exe" in the list and expand it
Click "Edit"
Scroll down to "Code flow guard (CFG)" and uncheck "Override system settings"
Start vmcompute from powershell "net start vmcompute"
The fix for me was to enable virtualisation in my bios. It'll be in Advanced > CPU Configuration > SVM - make sure it's enabled
I get the below error while starting of docker in Windows 10. Anyone can guide me to install docker correctly?
Unable to create: The running command stopped because the preference variable
"ErrorActionPreference" or common parameter is set to Stop: Hyper-V encountered
an error trying to access an object on computer 'XXXX' because the object was not
found. The object might have been deleted, or you might not have permission to
perform the task. Verify that the Virtual Machine Management service on the
computer is running. If the service is running, try to perform the task again by
using Run as Administrator.
at New-MobyLinuxVM, <No file>: line 242
at <ScriptBlock>, <No file>: line 362
at Docker.Backend.HyperV.RunScript(String action, Dictionary`2 parameters)
at Docker.Backend.ContainerEngine.Linux.Start(Settings settings)
at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass8_0.<Register>b__0(Object[] parameters)
at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)
Versions
OS : Windows 10 Enterprise
Version : 1607
OS Build : 14393.576
Docker Version : 1.12.3 (Stable)
Run “MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof” from command prompt in admin mode.
No need to restart machine as well after this execution, it worked for me.
I have also faced this same issue. I have solved it by removing all MobyLinuxVM virtual machines. Following are its steps.
Open Hyper-V Manager
Select all MobyLinuxVM from Virtual Machines.
Right click and delete all of these virtual machines.
Restart docker.
These steps has solved this issue on my system.
Assuming you are trying to run a Windows container:
Right click on the Docker system tray icon, then select “Switch to Windows Containers”.
It will eventually have you reboot the system, but will no longer attempt to run the MobyLinuxVm as mentioned in your error message.
If it helps anyone, I am on Apple hardware (MacOS) running a Windows 10 VM via Parallels. I also made sure that under my parallel settings > Processors and Memory > Advanced, I had Hypervision applications enabled.
This issue is very similar to this the another question Docker - The computer 'WINDOWS10-ON-SE' could not be resolved
See my answer at https://stackoverflow.com/a/45099242/279272
I was also facing the same issue but it was random in nature, I found it is due to some inaccessibility of network card by the docker start script. This inaccessibility further blocks the start up process of docker.
I found one hack and it is working fine on my windows machine
Hack
Open C:\Program Files\Docker\Docker\resources\mobylinux.ps1 with any editor in admin mode.
Find following code (around line 164)
$networkAdapter | Remove-NetIPAddress -Confirm:$false -ea SilentlyContinue
$networkAdapter | Set-NetIPInterface -Dhcp Disabled -ea SilentlyContinue
$networkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAddress -PrefixLength ($SwitchSubnetMaskSize) -ea Stop | Out-Null
Add a return after line 165 in a new line like below and save the file.
$networkAdapter | Remove-NetIPAddress -Confirm:$false -ea SilentlyContinue
$networkAdapter | Set-NetIPInterface -Dhcp Disabled -ea SilentlyContinue
return
$networkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAddress -PrefixLength ($SwitchSubnetMaskSize) -ea Stop | Out-Null
Now restart docker and after restart completion execute following commands in dos admin mode to setup the network card manually
netsh interface ipv4 set address name="vEthernet (DockerNAT)" static 10.0.75.1 255.255.255.0
You have to run this command everytime whenever you are doing system restart and docker completes start process (due to any reason).
TIP : create a batch file of this command and save somewhere handy.
Note: The ps hack would get undone by any docker update. so be aware...
to install docker, BIOS-level Hardware Virtualization support is required.
so you can do the following..
-Ensure that hardware virtualization support is turned on in the BIOS settings in your mother board settings when you start your computer, under (system security => virtualization technology VTX => enable it) then Save the BIOS settings and boot up the machine normally. then enable hyper v if it was not enabled by running this command in your powershell as an admin:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
For me updating windows 10 pro to version 1809 fixed the issue
On windows 10, I fixed the issue by executing the steps below:
French Windows version:
Close Docker Desktop
Go to "Contrôle des applications et du navigateur"
Click on "Paramètre d'exploit protection" under "Exploit protection"
Go to the tab "Paramètres du programme"
Search "C:\Windows\System32\vmcompute.exe" or "vmcompute.exe"
Click on update and untick all the checkboxes related to all the configurations and then apply
Run Docker Desktop again
English Windows version:
Close Docker Desktop
Go to "App & browser control"
Click on "Exploit protection settings" under "Exploit protection"
Go to the tab "Program settings"
Search "C:\Windows\System32\vmcompute.exe" or "vmcompute.exe"
Click on update and untick all the checkboxes related to all the configurations and then apply
Run Docker Desktop again
Hope this will help someone else.
when you starting windows and starting docker just a right click docker in right bottom bar and switch to windows container
I was trying Docker Desktop for Windows on a VM with Windows 10 Enterprise evaluation.
This is the error that I get:
I've searched round here but I haven't found nothing usefull. I have opened the log file and found error message like:
Failed to setup server socket listening on hyperv-connect://... Failed
to contact the database on \.\pipe\dockerDataBase.... File not found
Unable to write to database (continue like image above)
Nobody have idea? I've accepted the initial prompt when Docker asks me if I want to enable the Hyper-V feature and restart the computer after activation. Could it be a problem of nested virtualization?
I had the same problem and I solved it after I executed this command on a Powershell window:
bcdedit /set hypervisorlaunchtype Auto
I also had to enable CPU virtualization on the hardware properties of the virtual machine (I'm using VMWare vCenter, that might not be needed in your case)
The problem was the nested virtualization. Docker for Windows use Hyper-V behind the scene, Hyper-V was on the host machine too, so there's two nested virtual machine.
The steps are:
Create virtual machine named Docker (the one where Docker will be installed on) without dynamic memory allocation
Open Powershell and Set-VMProcessor -VMName "Docker" -ExposeVirtualizationExtensions $true
Install SO and Docker for Windows as usual
Be aware host machine and guest machine must share the same build number and both needs to be a Windows 10 or Windows Server 2016.