Docker Object Not Found (Windows 10)
At some point my Docker installation on Windows 10 stopped working. It seems like there are a lot of issues running Linux VMs on Windows & Hyper-V. As a result I had to try endless combinations of fixes that didn’t work until eventually I found something that worked. Here’s my recipe; it might work for you. It’s also possible that one of the many things I tried beforehand had some effect, but I don’t think so.
The Error
This is the error in the docker log. After much messing around, the easiest way to get the same error (and so to home in on where the problem was) is to run Get-VM in an admin power shell.
Error: Hyper-V encountered an error trying to access an object on computer 'REDACTED' 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.The Evidence
I was able to compare with a fairly similar machine that was working. Eventually that helped me track things down. I found that using Hyper-V manager the MobyLinuxVM properties looked wrong — selecting the Memory tab in the bottom pane showed loading errors. A screen shot would have been nice here but it’s fixed now so you’ll have to use your imagination.
I could not start the MobyLinuxVM instance, or even to get its settings. This showed the same error (a big clue that the problem was with Hyper-V not docker per se). Also missing in action was the DockerNAT virtual switch. There was a switch called “nat” and I have no idea where that came from. That notably didn’t work e.g. trying to rename it assuming it really was DockerNAT crashed Hyper-V manager.
The Solution
The following sequence finally brought Docker back to life:
- Uninstall Docker
- Delete the MobyLinuxVM in Hyper-V manager
- Reinstall Docker
This looks like a pretty safe thing to do whatever your problems are — but your situation may vary and it’s at your own risk etc. etc.
I suspect you could shortcut this by running theMobyLinux.ps1 script instead of reinstalling Docker. But switching container types didn’t help so maybe not.