Can we install and run Ubuntu WSL for arm64 arch on x86_64 windows machine ?
2 Answers
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.
- 122,292
- 133
- 301
- 332
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.
- 153