6

Can we install and run Ubuntu WSL for arm64 arch on x86_64 windows machine ?

2 Answers 2

9

Windows Subsystem for Linux doesn't support running ARM64 distributions on x86_64 architecture PCs.

WSL 1 translates Linux system calls into Windows system calls, allowing Linux binaries to run on the Windows kernel. There is no built-in support for running ARM binaries on an x86_64 architecture PC using WSL 1.

In WSL 2 Linux distributions run in a virtual machine, so there is no translation layer involved between the Linux applications and the Linux kernel itself. This VM is designed to run on the same architecture as the host system. Although WSL 2 uses virtualization, it does not support running ARM architecture distributions on x86_64 architecture PCs directly.

3
  • 1
    Note that qemu-user can be used to execute any binary in a wsl, so one can actually execute arm64 binaries in a windows with qemu-user running in wsl1. While that is not enough for a whole distro, it is close to that.
    – peterh
    Commented May 21 at 9:58
  • @peterh qemu-user is technically usable on WSL1, but it’s difficult to do so for anything other than an isolated static binary because you can’t use binfmt_misc with WSL1. With WSL2 though you can use binfmt_misc, so you can use qemu-user with any container system, or even just a chroot, to get a full cross-architecture environment just like you could on a regular Linux system. Commented May 21 at 10:54
  • 1
    @AustinHemmelgarn Yes, but WSL2 is a VM in the windows and not a subsystem. Already its name is a lie, exactly to cover that using WSL2, you are closed into a VM. I would never use WSL2, I would use virtualbox or qemu instead (but most happily, linux would be my host machine and my win would be the VM).
    – peterh
    Commented May 21 at 12:21
5

WSL2, as it runs a full Linux kernel, can use standard Linux emulation software. Specifically, qemu-user-static is a package that will allow Linux to execute binaries of different architectures. Fully adding a new image that Windows understands as a new WSL distribution will likely be difficult, but you can get most of the way there with chroot. A sample script is available here to set this up.

Alternatively, you can use Docker. Docker Desktop is a native Windows app with qemu built-in that can set up Docker containers, which combines chroot with a few more techniques. Simply executing the following command will drop you into an ARM Ubuntu shell:

docker run -it --rm --platform linux/arm64 ubuntu

Additional flags can be given to share folders, variables, and graphical access.


If you are interested in adding this as a new WSL2 distribution, you may be able to import the Docker image or the chroot folder. Although I haven't tested it, because emulators are shared between WSL2 distributions, adding it in one OS may give emulation capabilities to the others.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .