Lima: Lightweight Linux VMs with Automatic File Sharing and Port Forwarding
Intro
If you've ever spun up a Linux VM on macOS just to test something quickly, you know the pain. You install Docker, or fire up VirtualBox, wait forever, configure networking, mount folders manually, and then pray everything works. It's a lot of friction for what should be a simple task.
Lima is a tool that cuts through that nonsense. It gives you lightweight Linux VMs with automatic file sharing and port forwarding, right out of the box. Think of it as "Docker for VMs" but way more focused — it's built for running Linux containers natively on macOS (and soon on other hosts) without the overhead of a full hypervisor setup.
What It Does
Lima creates QEMU-based Linux virtual machines that are optimized for container workloads. You install it once, run limactl start, and you get a ready-to-use Linux environment. Files on your macOS host are automatically shared with the VM (no manual SSHFS or SMB setup). Ports exposed inside the VM are automatically forwarded to your host, so you can access services at localhost.
Under the hood, Lima uses user-mode networking with automatic port mapping, and it optionally integrates with Docker's containerd or Podman. The result: you can run docker or nerdctl commands inside the VM as if you were on a Linux machine, and everything just works.
Why It's Cool
The killer features are the automatic file sharing and port forwarding. No config files. No ssh -L tricks. You start the VM, edit files on your Mac, and they're immediately visible inside Linux. Run a web server in the VM, and it's instantly accessible at http://localhost:XXXX on your host.
But there's more. Lima is built on top of QEMU with KVM acceleration (via hvf on macOS), so the VMs are actually fast. Boot times are in seconds, not minutes. Memory usage is minimal. You can spin up multiple VMs for different projects, each isolated and disposable.
For developers, this is perfect for testing Linux-only tools, running CI pipelines locally, or setting up reproducible development environments. It's also a great alternative to Docker Desktop for those who want to avoid its licensing changes or resource bloat.
How to Try It
The easiest way to get started is with Homebrew on macOS:
brew install lima
Then launch your first VM:
limactl start
This will download the default Ubuntu-based image and start the VM. You can then access it with:
limactl shell
Or run a command directly:
limactl shell -- sudo apt update
To use Lima with Docker, install nerdctl inside the VM (it's preinstalled in the default image) and just run:
nerdctl run -d -p 8080:80 nginx
Visit http://localhost:8080 on your host. Done.
For more options (like using Fedora, Alpine, or custom images), check the official quick start guide.
Final Thoughts
Lima doesn't try to be the next big thing. It solves a specific, annoying problem — running Linux VMs on macOS — and does it really well. If you've ever wanted a quick Linux environment for testing, without the overhead of a full desktop VM or the complexity of Docker networking, Lima is worth 5 minutes of your time.
It's lightweight, it's fast, and it works. That's exactly the kind of tool that makes you go "why didn't I try this sooner?"
Find more projects like this at @githubprojects
Repository: https://github.com/lima-vm/lima