When I try to execute a 32-bit file compiled with gcc -m32 main.c -o main
on Windows Subsystem for Linux, I get the following error: bash: ./main
WSL2 runs in a real virtual machine using a real Linux kernel, therefore it's actually possible to do anything a Linux VM can do, including running 32-bit code. Just install 32-bit libs by running
sudo dpkg --add-architecture i386
sudo apt-get update
For more information read