A Small Debian Dev VM on macOS with Lima
Lima makes it easy to run a small Linux VM on macOS. This creates a Debian VM with two CPUs, 2 GiB of memory, and a 10 GiB disk.
1 | brew install lima |
Inside the VM, install a C compiler and lsb_release:
1 | sudo apt update |
Create and compile a hello world program:
1 | cat > hello.c <<'EOF' |
The executable is an AArch64 ELF binary, not a macOS Mach-O binary:
1 | file hello |
Exit the VM, then stop it when it is not needed:
1 | exit |
Delete it completely with limactl delete debian-dev.
Finally, list all existing VMs and their status, architecture, and resources:
1 | limactl list |