How lima-vm/lima works
Main Components
a) Host-side Components:
• limactl (Control CLI)
• Host Agent Service
• Network Management System
• File System Sharing
• Port Forwarding System
b) Guest-side Components:
• Guest Agent Service
• Container Runtime Support
• Mount Management
• Network Stack
Key Architectural Elements
Top Layer: User Interface
• CLI Tools (limactl, lima)
• Third-party Integration Points (Docker, Kubernetes, etc.)
Middle Layer: Host Services
• Host Agent
• Network Management
• Port Forwarding
• File System Management
Bottom Layer: Virtual Machine Layer
• Guest OS
• Guest Agent
• Container Runtimes
• System Services
Important Relationships
a) Control Flow:
• User commands → limactl → Host Agent → Guest Agent
• Network traffic flow between host and guest
• File system mount points and sharing mechanisms
b) Integration Points:
• Container runtime connections (Docker, containerd, etc.)
• Kubernetes integration
• Port forwarding mappings
Technical Details
• VM Types Support (QEMU, Virtualization.Framework, WSL2)
• Network Modes (user, bridged)
• Storage Systems (9P, virtiofs)
• Container Runtime Sockets
Specific Implementation Notes
• The separation between host and guest environments
• The communication channels between components
• The plugin architecture for different VM backends
• The template system for VM configurations
Key Flows to Highlight
a) VM Lifecycle:
limactl start → Host Agent → VM Creation → Guest Agent → Service Setup
b) Container Operations:
Container Command → Lima CLI → Host Agent → Guest Agent → Container Runtime