I’m usually using Ubuntu for development with Docker and VirtualBox, but I’ve recently started using Windows 10. Docker and VirtualBox can’t be used at the same time if Hyper-V is used.
Hyper-V runs Windows virtualized, so other virtualization software can’t be used at the same time. This is how and why I switched to docker-machine instead so I could run docker and VirtualBox at the same time.
Uninstall Docker and disable Hyper-V (if installed)
If you have Docker installed, then you need to remove it.
Then disable Hyper-V by pressing the Windows key and search for Turn Windows features on or off. Remove the checkbox on Hyper-V if it’s enabled.
Open an elevated shell by pressing the windows button and search for PowerShell. Right-click it and runs it as administrator.
Run the following command:bcdedit /set hypervisorlaunchtype off
Then reboot.
Make sure Intel VT-x or AMD SVM is enabled
Press CTRL + ALT + DELETE and then Task Manager. Check if it says virtualization enabled as shown below.
If it’s not enabled then you need to enable it in your BIOS.
Install VirtualBox
You can download VirtualBox from the official site and install it.
Install Docker Toolbox
We’re going to use Docker Toolbox to run docker in virtualbox.
The official guide found here has some issues, at least on AMD hardware. It keeps complaining about virtualization not being enabled when it is, so we need to make a small modification to disable the virtualization check.
- Download Docker Toolbox from GitHub.
- Run the install file you just downloaded.
- Open Notepad as administrator and open the file
C:\Program Files\Docker Toolbox\start.sh
. Make sure you select “all files” if you can’t find it. - Find the line
"${DOCKER_MACHINE}" create -d virtualbox $PROXY_ENV "${VM}"
and replace it with"${DOCKER_MACHINE}" create -d virtualbox --virtualbox-no-vtx-check $PROXY_ENV "${VM}"
. - Save the changes.
- Start Docker Quickstart Terminal.
Docker should now be working, and you can continue following the official guide from step 3.
Have fun with Docker and VirtualBox at the same time, and a faster Windows experience as Windows no longer runs virtualized 😊