PS > wsl -d docker-desktop
docker-desktop:/tmp/docker-desktop-root/run/desktop/mnt/host/c# qemu-system-x86_64 --version
-sh: qemu-system-x86_64: not found
docker-desktop:/tmp/docker-desktop-root/run/desktop/mnt/host/c# qemu
-sh: qemu: not found
Normally Docker Desktop on Windows just uses a VM. qemu is for emulating different hardware architecture. You can use it on Mac with ARM chip to run x86 binaries.
qemu-x86_64 version 8.1.5 (v8.1.5)
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developer
Explanation: Since the Docker daemon is running in a containr, qemu does not have to be in the PATH in the WSL distro directly. The command I shared runs the qemu command to get the version inside the container in which the Docker daemon is running.
It is, but it is needed in Docker Desktop to be able to emulate arm on amd as well, so it is in Docker Desktop on all platforms. It is of course not the same as the one on macOS which was the legacy virtualization method to run Docker Desktop’s VM itself.
docker run --rm -it --pid=host --privileged ubuntu:22.04 nsenter --all -t 1 qemu-arm --version
qemu-arm version 8.1.5 (v8.1.5)
but I wasn’t sure if this was the relevant version.
Since when building from amd to arm I get the error: qemu: uncaught target signal 11 (Segmentation fault) - core dumped windwos.
This sounds like nonsense. I gave wsl 40gb of RAM and 6 process cores, so suspicious of how Docker allocates resources to qemu.
I followed the standard recommendations from the internet to update qemu, supposedly the version is old. The command above shows the version, but the error still remained.
Now with the same build from amd to arm there is no qemu error, now just:
> [base 2/17] RUN apt-get upgrade && apt-get update && apt-get install -y g++ gcc cmake make git python3 libgl1-mesa-dev libdrm-dev libgles2-mesa-dev libboost-all-dev golang-go wget iputils-ping:
0.284 exec /bin/sh: no such file or directory
apparently this happened after another attempt to update qemu with some docker run command.
By the way, I’m building this:
FROM ubuntu:22.04 AS base
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get upgrade \
&& apt-get update \
&& apt-get install -y \
g++ \
gcc \
cmake \
make \
git \
python3 \
libgl1-mesa-dev \
libdrm-dev \
libgles2-mesa-dev \
libboost-all-dev \
golang-go \
wget \
iputils-ping
Since Qemu is in the virtualk machine, it will be as much resources as the VM has. On Windows, in case of WSL2, you can increase the resources of WSL which cannot be done through Docker Desktop.
But Segmentation fault does not sound like a resource allocation issue. If you think the version of Qemu installed in Docker Desktop has a bug, you can report it on GitHub
If it can be fixed with an updated version, the developers can do it. If anything needs to be done with the virtual machine, that means it needs to be done with WSL so that means the developers at Microsoft, but I’m sure Docker can contact them if needed.