Lima VM

Author: Jase Batchelor

Lima VM enables us to run virtualized Linux machines on MacOS.

For experiments with eBPF, Kubernetes, etc. I find it preferable to less customisable options such as Docker Desktop.

Additionally, we are able to reuse configuration scripts used with the Radxa SBCs. As such, we can have an identical virtualized environment for purposes such as demos.

 


Sections

 


Installation

Install QEMU and lima-vm

Install via homebrew

brew install lima qemu

image

REBOOT NOW !!
Otherwise you’re in for odd errors and nothing will work…

 


Configuration

By default configuration is stored in the $HOME/.lima directory.

It is possible to customise a number of settings including:

  • disk usage
  • CPU and RAM
  • Networking
  • Sharing with the host OS

image

 


Basic usage

 

Starting a virtual machine

Lima provides the limactl CLI to interact with the Linux VM(s).

To see a list of options, run the following:

limactl start -h

image

For the purposes of validating the installation we will use one of the default templates.

limactl start --list-templates

image

limactl start --name=default template://debian

image

image

 

Log in to the virtual machine
# Alternatively, use `lima` to start `default` VM
limactl shell default

image

 

Stop / remove the virtual machine

To stop up any virtual machines (and optionally remove) run the following:

limactl list
# NAME         STATUS     ...
# default      Running    ...

limactl stop default
limactl remove default

image

 


Advanced usage

todo ;)