Page 1 of 1

Virtualbox and Docker on the same host freezes host

Posted: 18. Dec 2014, 22:34
by bug.spencor
Hi,

when I started playing around with Docker I saw that when Docker is running, and I start a Virtualbox VM my host computer freezes. Both VirtualBox and Docker are running fine on their own.
When the host freezes I can only power off the computer, Ctrl-Alt-SysRq R-S-E-I-U-B does not work.

Theoretically, would it be possible to run Docker and Virtualbox simultaneously on one host?
Practically, do you have any experience on this?

Some details on my setup:
- Xubuntu 14.04, Kernel 3.13.0-43-generic
- Virtualbox 4.3.10 with Extension Pack
- Docker 1.0.1
- Hardware: ASUS UL80V Laptop with Intel CPU U7300, supports VT-x
- Virtualbox VM, which freezes the computer when it is started: Windows 7 guest, with I/O APIC, and Hardware Virtualization enabled

Any hints or explanations on this are welcome!

Re: Virtualbox and Docker on the same host freezes host

Posted: 18. Dec 2014, 22:59
by Perryg
You should not run two virtualizers at the same time. Bad things can happen.

Re: Virtualbox and Docker on the same host freezes host

Posted: 21. Apr 2017, 05:53
by Tudor
Sorry to dig up an old post, but is @Perryg's statement still true?

I'm drawing attention to it because this answer has been linked directly to a ServerFault question.

From a commonsense perspective, surely whatever virtualisation is going on has to behave correctly as a good kernel citizen. So the number and type of virtualisation shouldn't have any effect unless the environment doesn't behave as a good citizen. If it doesn't behave as a good citizen, surely the kernel should have isolated it enough not to affect other processes. Otherwise, it's not really "virtual", is it?

In my experience, I have a couple of servers running Virtualbox and Docker together and everything runs fine.

The only issue I'm having is with networking between the two architectures, but I think that's to do with the way the software bridge is implemented in one of them.

Re: Virtualbox and Docker on the same host freezes host

Posted: 21. Apr 2017, 13:54
by Perryg
Things like a good wine improve with age and so have VirtualBox and Docker. That said my statement still has merits today. You can have issues still just not as much or as often. The reasons being that neither know exactly what the other is doing and if a call is made that can cause an issue especially if both are actively working ( not idle ) ..... well you get the point.

Re: Virtualbox and Docker on the same host freezes host

Posted: 24. Apr 2017, 02:59
by Tudor
@Perryg Thanks for answering. Are you suggesting that the virtualisation is not abstracted and isolated well enough? At what level is that true?

When there are less issues in mixed architectures, it helps to know at what level they interact so that one can isolate the cause more quickly. In broad terms, my bad experiences have revolved more around the Docker -> Container relationship, where Docker is expecting the Container to behave a particular way, but the OS in the Container has not (yet) been designed for a virtualisation scenario. I haven't seen this VBox <-> Docker interaction that you're referring to, and I'm curious as to what resources are being shared but so poorly managed that they would cause a freeze and how deep into the kernel it may cause a problem.

Re: Virtualbox and Docker on the same host freezes host

Posted: 24. Apr 2017, 03:10
by Perryg
It is a very complex issue. You have the CPU ( pretty much a direct connection for VirtualBox ), nested paging even with large pages, as well as memory involved ( at least from the VirtualBox side, not sure about docker ) and the kernel. Any thing that accesses these things can be a potential issue. Now you add a second virtualizer given that these do not know what the other is doing really and you have the potential for a systemic issue. Granted the controlling factors are better these days but I for one still don't feel safe running parallel virtualizers even in a development environment. I honestly don't know why you would but it seems there are those that want to. I have in the past used various virtualizers and decided to stick with VirtualBox for several reasons. Speed, reliability ( for the most part ) and it does everything that I want. Not to mention it is open source and I can change and do things I want/need without waiting for a developer to find the time. As an example I build my own custom version with the features I want and eliminate the ones I don't. I might add that run this version in production and to date ( knock on wood ) have never had a failure ( except during the development phase ), hang, or any of the other issues that a lot of users have seen. I also run this on my own custom Linux build I create and maintain so if there were an issue I would be the first to know it, and I don't like issues.