
Lima (LInux MAchine) is the simplest way I know of to get that virtual machine. Once it’s setup you just type lima in a terminal window to be placed in a Linux VM but with all your files and ports available.
Lima launches Linux virtual machines with automatic file sharing and port forwarding (similar to WSL2).
✅ Automatic file sharing
✅ Automatic port forwarding
✅ Built-in support for containerd (Other container engines can be used too)
✅ Intel on Intel
✅ ARM on ARM
✅ Various guest Linux distributions: AlmaLinux, Alpine, Arch Linux, Debian, Fedora, openSUSE, Oracle Linux, Rocky, Ubuntu (default), …
Lima is powered by QEMU and is frequently used (via colima) to run containers on macOS. That is, it can be used as an alternative to docker desktop.
mac
brew install lima
linux
git clone <https://github.com/lima-vm/lima.git>
cd lima
make
make install
By default, the VM has read-only accesses to /Users/<USERNAME> and read-write accesses to /tmp/lima.