Using Docker Toolbox on Windows 10
So, apparently, my DELL M3800 laptop has an Intel chip that doesn’t play nice with Hyper-V on Windows 10. This is a long-running issue with no good solution (threads on the intel forum here and here). Fortunately, Docker has an alternative solution for older versions of Windows that stills works on Windows 10: Docker Toolbox with VirtualBox.
Unfortunately, out of the box, this experience left a bit to be desired compared to the virtually seemless experience I’ve enjoyed on Mac and on Windows 10 + Hyper-V on other machines.
First, make sure you install “Docker Toolbox”. Uninstall any other versions of Docker (I recommend a clean slate) as these may confuse or conflict with Docker Toolbox. I used the default settings.
Next, open Kitematic from the Docker Toolbox shortcut. By default, this will be under “”C:\Program Files\Docker Toolbox\kitematic\Kitematic.exe"”. Any other folder is a hint that you might’ve installed the wrong package. When Kitematic asks you, tell it to use VirtualBox.
When you setup containers, you will notice that ports are not automatically forwarded to them from your host machine. This is solved easily enough by shutting down the Docker VM (you can do this by going to Kitematic’s settings using the lower-left gear icon and telling it to “Shutdown Linux VM on closing Kitematic”), and running a command to forward the port(s) you need. For example, if I’m using mongo, I need port 27017, so I run: (inspired from this github issue):
“default” is the name of the VM as it appears in the VirtualBox GUI and all instances of “27017” can be replaced with the desired port. Once the Docker VM is started again, you can expect ports to be forwarded as long as your firewall isn’t blocking them.
Another issue you’ll notice is that docker commands don’t automatically work in your command/terminal window, saying “error during connect…The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.”
I found that there are several necessary docker environment variables that need to be set, which fixes this issue even without elevating the command window, using this one-liner:
Of course, you’re told to do this if you ever run “docker-machine env” to check the environment variables for the currently running docker machine instance.
From this point, with a properly configured shell, ports forwarded and a correctly configured firewall, things seem to work as I’d expect them to with Docker + VirtualBox.
