Closed mathieubrd closed 4 years ago
@mathieubrochard Will it allow you to create the switch manually?
powershell -ExecutionPolicy ByPass -File "C:\ProgramFiles\Docker\Docker\resources\MobyLinux.ps1" -create -switchname DockerNAT
Hi @jasonbivins and thank you for your answer. Here is the result of the command:
.\MobyLinux.ps1 -create -switchname DockerNAT
Script started at 09:14:02.253
Module loaded at 09:14:04.507
Creating Switch: DockerNAT...
Hyper-V\Get-VMNetworkAdapter : Hyper-V was unable to find a virtual switch with name « DockerNAT ».
At character C:\Program Files\Docker\Docker\resources\MobyLinux.ps1:117 : 25
+ ... etAdapter = Hyper-V\Get-VMNetworkAdapter -ManagementOS -SwitchName $S ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument : (DockerNAT:String) [Get-VMNetworkAdapter], VirtualizationException
+ FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVMNetworkAdapter
Also, I tried to create the DockerNAT virtual switch manually using Hyper-V and here is the error: The issue seems to be related with Hyper-V, not Docker.
I'm facing the same problem. Are there any updates on this issue? I have already tried uninstalling Trend Micro, uninstalling Check Point Mobile VPN, upgrading Check Point Mobile VPN and reinstalling Hyper V (as mentioned in #324). Yet Docker is still unable to create the virtual switch.
The same problem. Uninstalling CheckPoint VPN fixed it.
@pabloperich Did you do anything else concerning Hyper-V after uninstalling Check Point VPN? Unfortunately uninstalling it, didn't work for me, even after rebooting and deleting the network adapter.
@ThomasGassmann I didn't change anything concerning Hyper-V, but after unistalling Check Point VPN, I had to restore factory settings for Docker. After that, I checked Hyper-V Manager and it had the MobyLinuxVM and the DockerNAT again.
Uninstalling Check Point VPN didn't work for me either. Is there any other solution known to this problem? When trying to create a virtual switch manually, I get the following message: I've tried reinstalling Hyper-V multiple times... trying to repair Hyper-V through MOFCOMP. None of it worked.
Same problem here... Any fix ?
Same problem. Windows 10 Pro Version 1803. Docker Version 18.03.1-ce-win65 (17513).
When I run powershell -ExecutionPolicy ByPass -File "C:\Program Files\Docker\Docker\resources\MobyLinux.ps1" -create -switchname DockerNAT
it also gives me the same result.
PS C:\WINDOWS\system32> powershell -ExecutionPolicy ByPass -File "C:\Program Files\Docker\Docker\resources\MobyLinux.ps1
" -create -switchname DockerNAT
Script started at 23:39:59.530
Module loaded at 23:40:01.159
Creating Switch: DockerNAT...
Switch created.
New-NetIPAddress : The object already exists.
At C:\Program Files\Docker\Docker\resources\MobyLinux.ps1:152 char:23
+ ... rkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAd ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (MSFT_NetIPAddress:ROOT/StandardCimv2/MSFT_NetIPAddress) [New-NetIPAddress
], CimException
+ FullyQualifiedErrorId : Windows System Error 5010,New-NetIPAddress
I have exactly the same problem as mathieubrochard. I think this is purely a HyperV problem.
PS C:\Program Files\Docker\Docker\resources> powershell -ExecutionPolicy ByPass -File "C:\Program Files\Docker\Docker\resources\MobyLinux.ps1" -create -switchname DockerNAT
Script started at 10:23:26.565
Module loaded at 10:23:28.446
Creating Switch: DockerNAT...
Hyper-V\Get-VMNetworkAdapter : Hyper-V was unable to find a virtual switch with name « DockerNAT ».
At character C:\Program Files\Docker\Docker\resources\MobyLinux.ps1:117 : 25
+ ... etAdapter = Hyper-V\Get-VMNetworkAdapter -ManagementOS -SwitchName $S ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument : (DockerNAT:String) [Get-VMNetworkAdapter], VirtualizationException
+ FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVMNetworkAdapter
@drou7 I recently installed a ton of windows updates and this exact issue popped up out of nowhere. What worked for me is I uninstalled Check Point VPN, then ran the powershell -Create script which then completed succesfully. I'll have to re-install Check Point later though. For the moment my docker issue has been resolved.
I don't know why, but today, when I started my PC Docker is now running and work well. This is whay I done yesterday:
netcfs -d
And now today, it works... I'm scared, I don't want to restart my PC now.
EDIT : After a restart, the same problem back...
It works well now. It was Trend OfficeScan.
If you have it : You must disable 'Protect OfficeScan agent registry keys' and 'Protect OfficeScan agent processes' Docker works perfectly now.
All errors with 0x80070005 means the access is denied. In this case, Hyper-V is not allowed to edit your network card. You must find which programm is blocking Hyper-V.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
comment.
Stale issues will be closed after an additional 30d of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen
comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
/remove-lifecycle stale
[19:09:58.387][Linux ][Error ] Failed to start: 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,
I am having this issue as well I had to uninstall Zone Aarm, then it worked. I reinstalled it and it worked for a few days (I had to switch firewall off before starting Docker). Now it's acting up again after today's latest update
Same issue here, but behind a corporate network. I will post the details if there's anything that could help others.
The issue seems to be with the service's right to logon that is given through a GPO policy. In some case, the right does not seems to be applied.
http://ventej.blogspot.com/2013/09/hyperv-virtual-mahine-creation-error.html
One way to fix this is to restart the Hyper-V management service:
# Done from an admin shell
net stop vmms
net start vmms
Restart Docker and it should be able to create the mobylinux VM now.
Although I have Trend Micro installed and had the same error, I was able to resolve this issue by running a Microsoft Easy Fix wizard and rebooting my system.
@infernalsirius - Thanks, this worked for me.
Hurray....
Try running these commands and restart docker. This worked for me.
# Done from an admin shell
net stop vmms
net start vmms
The issue seems to be with the service's right to logon that is given through a GPO policy. In some case, the right does not seems to be applied.
http://ventej.blogspot.com/2013/09/hyperv-virtual-mahine-creation-error.html
One way to fix this is to restart the Hyper-V management service:
# Done from an admin shell net stop vmms net start vmms
Restart Docker and it should be able to create the mobylinux VM now.
This worked like a charm.
For the ones that use Trend Micro as their antivirus, the solution is here: https://success.trendmicro.com/solution/1120119-unable-to-create-hyper-v-vswitch-on-a-windows-10-machine-with-officescan
More generally, you should do this as well as it's is a pre-requirements regardless of the antivirus used:
https://support.microsoft.com/en-us/help/3105657/recommended-antivirus-exclusions-for-hyper-v-hosts
Since disabling an antivirus is not an option nor a solution, this permanent fix would need to be applied. Otherwise, when you restart or stop/start the Docker service, it will destroy and recreate the v-switch and you'll get the same error again.
After working flawlessly for several days, Docker started giving me this error. I did not install any software and do not use a VPN or antivirus (except Windows Defender).
I restarted my pc and have restarted the vmms service. That did not help fix this issue. Here is a portion of the log file:
[23:22:36.571][PowerShell ][Info ] Run script with parameters: -Create True -VhdPathOverride -VhdSize 64000000000 -SwitchSubnetAddress 10.0.75.0 -SwitchSubnetMaskSize 24 -CPUs 2 -Memory 2048 -IsoFile C:\Program Files\Docker\Docker\Resources\docker-for-win.iso
[23:22:36.571][Firewall ][Info ] Removing all existing rules...
[23:22:36.573][HyperVGuids ][Info ] GUIDs installed
[23:22:36.593][HyperV ][Info ] Script started at 23:22:36.593
[23:22:36.597][Firewall ][Info ] All existing rules are removed.
[23:22:36.597][Firewall ][Info ] Opening ports for C:\Program Files\Docker\Docker\Resources\com.docker.proxy.exe...
[23:22:36.603][HyperV ][Info ] Modules loaded at 23:22:36.603
[23:22:36.603][Firewall ][Info ] Opening ports for SMB...
[23:22:36.610][Firewall ][Info ] Ports are opened
[23:22:36.624][HyperV ][Info ] Creating Switch: DockerNAT...
[23:22:36.791][NPS ][Info ] NPS user ceated on: 5/20/2019 3:30:20 PM -07:00, last survey: 1/1/0001 12:00:00 AM +00:00
[23:23:07.868][Linux ][Error ] Failed to start: 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,
same here.. Were you able to find the root cause?
I couldn’t get it to work on windows. I installed a Ubuntu vm and setup my docket there.
On Mon, Jun 3, 2019 at 12:31 PM sxmartin notifications@github.com wrote:
same here.. Were you able to find the root cause?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/docker/for-win/issues/2090?email_source=notifications&email_token=AJNHYEU4FAASJ3MB5AEAD4TPYVBN3A5CNFSM4FDZETOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWZ6WPA#issuecomment-498330428, or mute the thread https://github.com/notifications/unsubscribe-auth/AJNHYEQ2XB45QLM7WMT4E4TPYVBN3ANCNFSM4FDZETOA .
-- Regards Vivek
hi guys i got the same error here . make sure "Hyper-v extensible switch" is checked and click ok.
net stop vmms net start vmms
that indeed help, but not fully:
PS C:\WINDOWS\system32> powershell -ExecutionPolicy ByPass -File "C:\Program Files\Docker\Docker\resources\MobyLinux.ps1" -create -switchname DockerNAT
Script started at 14:49:02.996
Modules loaded at 14:49:04.137
Creating Switch: DockerNAT...
Switch created.
Set IP address on switch
ISO file at .\docker-for-win.iso does not exist
At C:\Program Files\Docker\Docker\resources\MobyLinux.ps1:402 char:5
+ throw "$args"
+ ~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (ISO file at .\d... does not exist:String) [], RuntimeException
+ FullyQualifiedErrorId : ISO file at .\docker-for-win.iso does not exist
after that I resetted Docker to factory defaults and it now works!
FYI; if you're running Trend Micro OfficeScan; see this article: https://success.trendmicro.com/solution/1120119-unable-to-create-hyper-v-vswitch-on-a-windows-10-machine-with-officescan
Once my IT department followed through with its recommendations, I was off to the races. If you use some other AV software; check out this article by Microsoft: https://support.microsoft.com/en-us/help/3105657/recommended-antivirus-exclusions-for-hyper-v-hosts
It appears that various AV programs have issues with Hyper-V on Windows due to how it works, and Microsoft recommends various actions for AV vendors to take in order to allow them to co-exist.
In my case, after adding the Docker folder to Trend Micro exclusions it worked.
I'm by no means an expert on Hyper-V internals, but looking on the web a common issue that causes the symptoms described in this thread is broken WMI registrations, which you can fix by running [as admin]:
MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof
I also have a hunch this is related to running Docker under Azure AD or domain accounts, as I've had issues with that in the past and creating a DockerNAT switch manually through the Hyper-V machine manager was giving me errors about accessing objects on the MACHINENAME
domain.
For those having this issue on Azure AD or Domain accounts, try:
docker-users
groupThis should successfully create the DockerNAT switch for you, at which point you may now reboot & sign-in to domain and continue to use docker.
None of these worked for me. I have tried countless of possible solutions reported by others. In the end, this rather old post helped: https://forums.docker.com/t/latest-failed-docker-update-makes-hyper-v-unable-to-create-virtual-ethernet-switch-0x80041002/44109
So to fix the issue:
Hyper-V
and Containers
features then rebootHyper-V
and Containers
features back then rebootHope this helps
Tried uncheck and check back after restart worked for me: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v
Uncheck and rechecking the features as above worked for me! (also, I didn't have to uninstall and re-installed docker) https://github.com/docker/for-win/issues/2090#issuecomment-567590149
Just uncheck than check Hyper-V in windows features than restart ( it works for me ) https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v
None of these worked for me. I have tried countless of possible solutions reported by others. In the end, this rather old post helped: https://forums.docker.com/t/latest-failed-docker-update-makes-hyper-v-unable-to-create-virtual-ethernet-switch-0x80041002/44109
So to fix the issue:
1. uninstall crippled Docker for Windows 2. remove both `Hyper-V` and `Containers` features then reboot 3. add `Hyper-V` and `Containers` features back then reboot 4. reinstall Docker for Windows then start it
Hope this helps
This worked for me. Thank you so much.
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen
comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
/remove-lifecycle stale
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen
comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked
Expected behavior
Docker daemon is running
Actual behavior
An error occur when starting the Docker daemon. Error is Hyper-V was unable to find a virtual switch with name "DockerNAT".
Information
I tried to disable Hyper-V, remove all the Hyper-V virtual adapters, uninstall Docker and reinstall it, same problem.
Steps to reproduce the behavior
Logs