Since upgrading my Windows 10 to version 2004, my Virtualbox hosted virtual machines acted up. My Windows 10 forensic analysis machine would crash on boot and while my Kali and Ubuntu based Linux machines seemingly ran properly, I encountered a “Hash sum mismatch” error when using apt update and git clone refused to clone with an “invalid distance too far back” error.
As it turns out, the error was caused by Hyper-V and Virtualbox.
Before the upgrade to Windows 10 2004 I used the Windows Subsystem for Linux (WSL) along with a Kali Linux distro. Additionally, I had the above-mentioned virtual machines running in Virtualbox. This setup worked perfectly well because WSL does not require any form of virtualization. Instead, it uses a compatibility layer which translates Linux calls into native Windows calls. However, with the update to Windows 10 version 2004 WSL got updated to WSL2 which introduces Hyper-V as a virtualization solution for it’s kernel. Having Virtualbox, or any other virtualization solution installed on the same machine as Hyper-V will result in problems.
Microsoft and Oracle both state that Virtualbox is compatible with WSL2. Virtualbox would fallback to Hyper-V using Microsoft provided APIs. This would come at the expense of performance and, as observed by myself and others, does not really work well.
The solution to this is simple: disable Hyper-V. This can be done either by uninstalling the feature or by turning it off temporarily. If you decide to turn off Hyper-V and, as a result not use WSL2 anymore, go to the “Turn Windows features on or off” section and deselect “Virtual Machine Platform”.
After a reboot, Virtualbox will not use the Hyper-V fallback anymore but run it’s virtual machines using it’s own virtualization and the above-mentioned issues will be solved.
If you like working with WSL2 and don’t use Virtualbox regularly, you can disable Hyper-V temporarily without removing it from the system.
Open a powershell or cmd terminal as Administrator and issue the following command:
bcdedit /set hypervisorlaunchtype off
This will disable Hyper-V during the boot phase of Windows 10.
To re-enable Hyper-V, issue the following command:
bcdedit /set hypervisorlaunchtype auto
If you still want to use Linux inside of WSL along with virtual machines in Virtualbox, consider downgrading some or all your Linux distros from WSL2 to WSL. To do that, open a powershell or cmd terminal as Administrator and enter the following command to list all installed Linux distros in WSL:
wsl --list --verbose
This will list all installed Linux distros on your computer along with the configured WSL version. With the following command, Linux distros can be converted from WSL2 to WSL:
wsl --set-version kali-linux 1
13 thoughts on “Fix Virtualbox on Windows 10 2004”
Thanks a lot, it has been hours now trying to fix that hash sum mismatch error. I usually use wsl 2 and vbox repetitively! I really don’t understand why would hypervisor affect the files being downloaded on the vbox?
Can you elaborate on what happens, please?
Thank you for your feedback. I was actually wondering the same 🙂
I don’t have a definitive answer, but I believe it has something to do with performance. The release notes of Virtualbox 6.0.0 (you can find it here: https://www.virtualbox.org/wiki/Changelog-6.0), mentions that when Hyper-V and Virtualbox run on the same machine, Virtualbox will use a fallback mode, which will have an impact on performance. My observations were that none of my Windows machines would run, and the Linux machines would run, but with the issues described in my article. I assume that the performance impact is in such manner that Windows would just crash, but the more lightweight Linux would run, but run into timeout problems when searching for packages. But honestly, I don’t know.
Hell of performance issues! a simple enum cannot go smoothly on VBox machine, as well as many checksums, including those on git.
It’s really frustrating!
in september 2020 patch tuesday they broke wsl ,,,,
I could not run virtualbox vms at all … The only thing that cleared the problem was the
bcdedit /set hypervisorlaunchtype off
Make sure you do a full shutdown too
Hey, it is me again.
as I’m using wsl 2 I just wanted to stop the hypervisor as you showed here. yet, this didn’t solve the mismatch error even after reboot. moreover, my wsl2 kali still available on wsl 2.
Searching further online no one else mentioned the `bcdedit` are you sure about it?
Thank you for your feedback. When you mention ‘reboot’, did you reboot the host machine or the VM? As the described change affects Boot Configuration Data (BCD), you need to reboot the host machine. For more background information about the different types of hypervisors and how bcdedit can help, visit: https://www.tenforums.com/tutorials/139405-run-hyper-v-virtualbox-vmware-same-computer.html
I actually did reboot the host machine. On bcdedit, it shows:
Windows Boot Loader
description Windows 10
Yet, My wsl 2 kali-linux machine still available, and my VBox still suffering 😀
For some reason it took effect today 😀
Thanks a lot 😀
Thank you for this!
THANK YOU LAD ! It’s been a while since i try to solve this problem and now it’s running !
Thank you so much! Should have known those weasels at Microsoft were back at it again.
Appreciate your help! Installed Docker desktop and the WSL2 that came with it broke all my VMs… Finally back to normal
I am glad it is working for you again. 🙂