Issues Starting MongoDB Version 5 and Above

If you are using a Hypervisor on a Windows OS, you might encounter some issues with deploying MongoDB version 5 and above, as MongoDB 5.0+ requires a CPU with AVX support.

CPUs with AVX Support have been around for a long time and this shouldn’t be a problem. However, on my PC, I am running Windows 11 OS with VirtualBox as a Hypervisor, and I am also using WSL for Ubuntu on the same machine, which requires some features of Hyper-V to be activated. As it turns out, Hyper-V has some unusual (at least for me) effects on the VMs running on VirtualBox.

Starting Podman or Docker MongoDB 5.0+ containers, inside of a VM running on VirtualBox resulted in the following error:

Traceback (most recent call last):
File "/usr/local/bin/docker-entrypoint.py", line 637, in
subprocess.run(get_final_command_line_args(), check=True)
File "/usr/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['mongod', '--bind_ip_all']' died with .

After some digging and searching, it turned out that the vCPU of the VM didn’t support AVX. To add AVX support to the vCPU, I had to disable all Hyper-V features/processes on my PC. Be warned though, this inevitably led to breaking WSL and losing access to all my data in the Linux systems running in WSL.

To deactivate all Hyper-V features, I did the following:

  1. Open Command Prompt (CMD) as administrator.
  2. Run the following commands.
    • bcdedit /set hypervisorlaunchtype off
    • DISM /Online /Disable-Feature:Microsoft-Hyper-V
  3. Restart the PC.

After completing the steps listed above, I noticed that the vCPU icon of the VM interface changed. Before:

After:

After that, I was able to run MongoDB 5.0+ containers. However, as mentioned, WSL was no longer working.

Leave a comment