Fixing Windows Interop in Arch Linux WSL2
Contents
What Is WSL Interop
WSL Interop is a core feature of WSL2 that lets you invoke Windows executables directly from within a WSL terminal. For example:
powershell.exe -NoProfile -Command "Get-Process | Select-Object -First 5"
winget.exe search nushell
explorer.exe .The Windows filesystem is also accessible through /mnt/c/, /mnt/d/, and so on.
The Problem
On Arch Linux WSL2, you may find that all of the above commands fail with “exec format error” or “command not found.” This happens because WSL Interop registration depends on systemd-binfmt.service, which gets skipped on Arch Linux due to unmet condition checks — Arch doesn’t ship pre-existing binfmt.d configuration files like Ubuntu does.
Fix
Run the following in your WSL terminal:
sudo mkdir -p /etc/binfmt.d
sudo tee /etc/binfmt.d/wsl-interop.conf > /dev/null << 'EOF'
:WSLInterop:M::MZ::/init:P
EOFThen restart the service:
sudo systemctl restart systemd-binfmtVerification
# Check service status — should be active (exited), not skipped
systemctl status systemd-binfmt
# Check that WSLInterop is registered
cat /proc/sys/fs/binfmt_misc/WSLInterop
# Test invoking a Windows program
powershell.exe -NoProfile -Command "Write-Output 'interop OK'"The configuration file is persistent and takes effect automatically every time WSL starts — no need to repeat this step.