---
---
⚡ Requirement | Lima >= 2.0 |
---|
Lima supports two types of drivers: internal and external. This architecture allows for extensibility and platform-specific implementations. Drivers are unware whether they are internal or external.
💡 See also: VM Types for user configuration of different virtualization backends.
Internal vs External Drivers
Internal Drivers are compiled directly into the limactl
binary and are registered automatically at startup by passing the driver object into registry.Register()
function and importing the package in the main limactl code using Go's blank import _
. For example:
qemu: registration file & import file
Build tags control which drivers are compiled as internal vs external (e.g., external_qemu
, external_vz
, external_wsl2
).
External Drivers are separate executables that communicate with Lima via gRPC. They are discovered at runtime from configured directories.
⚠️ Note: External drivers are experimental and the API may change in future releases.
Building Drivers as External
You can build existing internal drivers as external drivers using the ADDITIONAL_DRIVERS
Makefile variable:
This creates external driver binaries in _output/libexec/lima/
with the naming pattern lima-driver-<name>
(or lima-driver-<name>.exe
on Windows).
Driver Discovery
Lima discovers external drivers from these locations:
Standard directory:
<LIMA-PREFIX>/libexec/lima/
, where<LIMA_PREFIX>
is the location path where the Lima binary is presentCustom directories: Set path to the external driver's directory via
LIMA_DRIVERS_PATH
environment variable
The discovery process is handled by pkg/registry/registry.go
.
Creating Custom External Drivers
To create a new external driver:
Implement the interface: Your driver must implement the
driver.Driver
interface:
Create main.go: Use
server.Serve()
to expose your driver:
Build and deploy:
Build your driver:
go build -o lima-driver-mydriver main.go
Place the binary in a directory accessible via
LIMA_DRIVERS_PATH
Ensure the binary is executable
Use the driver: Explicitly specify the driver when creating instances:
Examples
See existing external driver implementations: