How to use docker as well as VM Virtualbox (Hyper-V issue)

2

1

I am new to docker as well as virtual machines. When installing docker on Windows 10 for the first time it alerted me that it needed to enable Hyper-V. I don't really know what Hyper-V is, but I assume it has to do with virtualization, so I complied. However, for some tools I need to use a Linux environment so I am using Oracle's VM Virtualbox. When trying to run a VM in there, it kept giving me a blue screen. After searching, I found that to prevent this, I needed to disable Hyper-V. I did so, but now docker won't launch because the prerequisite of Hyper-V is not enabled.

What is the middle ground? How can I use Virtualbox as well as docker?

Bram Vanroy

Posted 2018-01-16T14:04:26.520

Reputation: 1 486

You can't. But there really isn't much of a reason to. Hyper-V is just another kind of virtualization. Alternatively you would have to use Docker different. Oracle VirtualBox from Docker Documentation. Depending on what you use on Linux you might also be able to look into the Linux Subsystem for Windows.

– Seth – 2018-01-16T14:11:28.217

Answers

2

There is no middle ground.

Both Hyper-V and Virtual Box do the exact same thing. They virtualize another OS on your system.

Docker uses the Hyper-V subsystem to create a virtual environment in which the Docker applications run, so Hyper-V needs to be active.

So why can't you have both Hyper-V and VirtualBox active at the same time?

The problem with virtualization is performance. Given that it emulates a computer, a fully software emulation is very slow. So to counter this, virtualization software communicates directly with your system's hardware. For this to be possible you have to enable vtx in the BIOS. These set of instructions allow the virtualization software to communicate directly with the main components such as your CPU and Graphics card, to keep performance high. The problem is that this is device exclusive. Once a claim on the hardware is made, no other software can get a claim. So VirtualBox and Hyper-V won't run side-by-side.

Is there really nothing I can do?

Well, you can recreate your VirtualBox inside Hyper-V. You can have a Hyper-V VM active while using Docker, so that is a way (probably the only way) to solve this issue. But Hyper-V and VirtualBox cannot be used at the same time.

LPChip

Posted 2018-01-16T14:04:26.520

Reputation: 42 190

I see, thank you for the information! Because I just started using Virtualbox, I can still switch to something else. I assume that Hyper-V has its own implementation in Windows, i.e. I can install Ubuntu through Hyper-V? Do you have any useful resources that I can use? I'm a complete novice. – Bram Vanroy – 2018-01-16T14:16:09.860

2Yes, You can use Hyper-V the same way as VirtualBox. It works slightly different, but google is your friend, given that Hyper-V is really well used. It can be installed through "Programs and Features" -> Add windows features, but given that you already have Docker, I bet you already have gone through this. Just start Hyper-V GUI and add a virtual machine. – LPChip – 2018-01-16T14:17:52.710

Thanks. Works great so far! Just can't get my internet to work, but I guess that's because of my employer's network configuration. – Bram Vanroy – 2018-01-16T15:09:44.363