VM launch fail on Windows 10 when WSL2 and Docker is enabled

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Krotow
Posts: 8
Joined: 18. Jan 2008, 10:49

VM launch fail on Windows 10 when WSL2 and Docker is enabled

Post by Krotow »

We are using Docker containers and Vagrant + VirtualBox virtual machines in Windows 10 (now 20H2). Would be very convenient to make both parties (Docker+WSL2 and VirtualBox) working together on same machine. However when Docker Desktop with WSL2 support is installed, existing VirtualBox virtual machines (Linux 64-bit quests with installed VirtualBox Guest additions) fail to launch. Instead error message appear:
WHvCapabilityCodeHypervisorPresent is FALSE! Make sure you have enabled the 'Windows Hypervisor Platform' feature. (VERR_NEM_NOT_AVAILABLE).
VT-x is not available (VERR_VMX_NO_VMX).
"Windows Hypervisor Platform" feature enabling in Windows features does not change anything. It is not possible to change paravirtualization interface type under VM "Settings - System - Acceleration" too - OK button remain disabled.

To get VirtualBox VMs running again either "hypervisorlaunchtype" must be disabled through Windows Command Prompt with command

Code: Select all

bcdedit /set hypervisorlaunchtype off
or Docker Desktop must be uninstalled together with "Windows Hypervisor Platform", "Virtual Machine Platform" and "Windows Subsystem for Linux" feature disabling in Windows Features with subsequential Windows restart. Both actions obviously permit Docker container using together with VirtualBox.

Are there is another way how to use VirtualBox 64-bit VMs in Windows host together with WSL2 + Docker installed in same Windows host? From information in Internet it seems already known problem. However Oracle state that Hyper-V support is introduced via VirtualBox versions 6.1.18 and 6.1.22. From what I see it does not work yet. Made a VirtualBox ticket #20357 about this (have also attached VM log).

Environment:
Host: Windows 10 20H2, 64-bit
VirtualBox 6.1.22
Guests: Ubuntu Linux 18.04 LTS, 64-bit. Installed VirtualBox Guest Additions 6.1.22
Hardware: Dell OptiPlex 980, Intel Core i5-750 CPU (64-bit, has VT-x support), 16 GB RAM
Dell BIOS, version A18, VT-x is enabled
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM launch fail on Windows 10 when WSL2 and Docker is enabled

Post by mpack »

The paravirtualization settings of the VM are the API we present to the guest so that a modern hypervisor-aware guest OS can talk to the hypervisor. This setting has nothing whatever to do with whether (and what) the host is using as a hypervisor.

The bcdedit command name is short for "boot config data editor", i.e. it alters the boot config i.e. changes do not take effect until the next boot. I saw no mention that you rebooted but presumably you did if you say that this works.

Neither Docker nor Vagrant are supported here. If you use non-standard installations then you need to visit the appropriate third party site for support.

You seem to have made a series of observations. What actually is your question? I note that the same problem is true with the ticket you raised. It mentions some already well known facts, i.e. that other uses of VT-x/AMD-v can conflict with VirtualBox. That is a subject of current development, so I'm not sure what purpose the ticket serves.
Krotow
Posts: 8
Joined: 18. Jan 2008, 10:49

Re: VM launch fail on Windows 10 when WSL2 and Docker is enabled

Post by Krotow »

Message was about permanently failed VM launch if Windows has enabled features required for Docker and WSL2. It is clear enough.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VM launch fail on Windows 10 when WSL2 and Docker is enabled

Post by scottgus1 »

At this time it is not possible to say if Docker/Hyper-V can coexist with Virtualbox on any particular PC. In some few cases Hyper-V can be enabled and Virtualbox will run. In most cases, Hyper-V and therefore Docker have to be disabled to allow Virtualbox to run. It's a work in progress and is not there yet.
Post Reply