Close

Running Docker Desktop on Windows means you can't use VirtualBox. Workaround 1: VirtualBox

A project log for Learning Docker

Docker is a popular containerization (OS-level virtualization) tool. I'm learning how to use it. You can follow along if you want.

pointyointmentPointyOintment 02/18/2019 at 06:531 Comment

Using Docker Desktop for Windows makes it impossible to simultaneously use hardware virtualization apps like VirtualBox and VMware Workstation (Player). This post discusses one workaround: running Docker Engine on Linux, inside a VirtualBox hardware virtual machine running on a Windows host. This is a workaround that I do not intend to try at this time, and it has its limitations, but it also has some advantages.

The next post will discuss another workaround: using Docker Toolbox, which includes Docker Machine, to run Docker on Windows without using Hyper-V.


When you install Docker Desktop on Windows, it requires and automatically enables Hyper-V[1], a hypervisor from Microsoft. Hyper-V replaces your Windows OS as the host on the computer, and your Windows OS becomes a virtual machine. Unfortunately, inside this virtual machine, Windows no longer has access to the CPU's virtualization features. These features are necessary for running hardware virtualization applications like VirtualBox and VMware Workstation (Player).[2][3]

I need to be able to run VMware Workstation Player on a weekly basis for school at present, so I cannot reasonably install Docker Desktop on the Windows OS that's on my school laptop. Another reason is that I am still running Windows 7, which I think does not support Hyper-V, though a classmate has told me it worked for him.

I have not been able to find out in detail why Docker actually requires Hyper-V when running on Windows—people seem to just say what amounts to "that is a reasonable requirement" without explaining it. (I read—though I have forgotten where—that Docker may have plans to stop requiring Hyper-V when running on Windows, but even if they do end up doing that, it does not help us now.)

You probably noticed that I said "when running on Windows" a couple of times in the previous paragraph. Indeed, Docker does not require Hyper-V when running on Linux. Hyper-V isn't even available there. That is also the case for macOS—though on macOS, Docker runs its own hypervisor (using HyperKit, which is Mac-only because it is based on a macOS framework)[4].

This leads to the idea of a potential solution to the problem of running Docker while keeping the ability to run hardware VMs: create a hardware VM running Linux and run Docker inside that. This may not be practical for other purposes, such as serious development or production, where you might need Docker running directly on Windows for various reasons, but for just experimenting with Docker, it should be sufficient. But even in serious use cases, you might find it preferable to run Docker inside a Linux VM, because Docker on Linux can be more stable and easier to manage.

The VM cannot run Windows as the guest OS, because then you would be back to running Docker on Windows, in which case it would need to run Hyper-V, which is impossible inside a VM, because only one hypervisor can run at a time on an x86 CPU—VirtualBox on the host OS is already using the CPU's virtualization features, so they are unavailable to the guest OS (Hyper-V). (It is theoretically possible for VirtualBox to provide these features inside its VMs, but it does not yet do so because this would be difficult to implement.[5])

Discussions about running Docker inside a Linux hardware VM on Windows are easy to find online. However, I will not be pursuing this option at this time, so I will end this post with some further-reading links:

References

  1. "Install Docker Desktop for Windows." Docker. Retrieved 2019-02-17.
  2. "Answer to: Why VirtualBox or VMware can not run with Hyper-V enabled Windows 10". Veovis. 2017-05-13. Retrieved 2019-02-17.
  3. "Answer to: What is Hyper-V for". LawrenceC. 2014-03-23. Retrieved 2019-02-17.
  4. "Install Docker Desktop for Mac". Docker. Retrieved 2019-02-17.
  5. "[feature-request] Nested Virtualization: VT-in-VT". Technologov. 2009-05-16. Retrieved 2019-02-17.

Discussions

Neal Barrett wrote 06/07/2021 at 04:17 point

Nawaf "Frightening unimportant creature" Aldossary is a blog that is presented in some other language. This language is actually the best language and individuals with basic https://kingactivator.com/how-to-get-rid-of-the-activate-windows-watermark/ making information will like this blog to such an extent. I'm thinking to share this blog.

  Are you sure? yes | no