SlideShare a Scribd company logo
CNCF TAG-Runtime meeting (Oct 6, 2022)
Akihiro Suda, NTT
1
Linux virtual machines, typically on macOS, for running containerd
https://github.com/lima-vm/lima
Relevant talk at KubeCon EU (May 2022): “Running containerd and k3s on macOS” - Akihiro Suda, NTT Corporation & Jan Dubois, SUSE
2
Lima joined CNCF Sandbox 🎉
https://www.cncf.io/projects/lima/
Why run containers on macOS?
● 2022 is The Year of the Linux Desktop™…
● But ordinary developers still need macOS (or Windows)
● Almost solely for the dev & test environment
● Not the best fit for running a production server
3
Existing methods
● Docker Desktop for Mac has been the popular solution
● Supports automatic host filesystem sharing
● Supports automatic port forwarding
● But proprietary
4
Existing methods
Just install Docker and Kubernetes inside a Linux VM?
Maybe via minikube?
● VMware Fusion and Parallels are proprietary
● VirtualBox is FLOSS but won’t support M1
● QEMU is FLOSS and supports M1, but still
○ Not easy to access the host FS from the containers
○ Not easy to access the container ports from the host
5
Our solution: Lima
● Similar to WSL2 but for macOS hosts
● Automatic host filesystem sharing
● Automatic port forwarding
● Built-in integration for containerd
6
https://github.com/lima-vm/lima
$ brew install lima
$ limactl start
$ lima nerdctl run ...
Lima = LInux MAchine
● Originally designed as “containerd machine” to mimic
Docker Machine
● The scope was extended immediately to cover other use
cases too
● Still focuses on containerd and k3s
7
containerd with Lima
containerd: the de facto standard container runtime
● CNCF Graduated project
● Not just made for Kubernetes
● Provides the docker-compatible CLI too: containerdctl
● With a lot of cutting-edge features
○ Lazy-pulling, IPFS, OCIcrypt, Faster rootless … 8
$ nerdctl build -t foo .
$ nerdctl run -d -p 127.0.0.1:80:80 foo
containerd with Lima
Lima provides built-in support for containerd
9
$ lima nerdctl build -t foo .
$ lima nerdctl run -d -p 127.0.0.1:80:80 foo
Build an image from a Dockerfile on the macOS home directory
Expose the container’s port 80 as the macOS’s http://localhost
containerd with Lima
10
$ lima nerdctl build --platform=amd64,arm64 ...
$ lima nerdctl run --platform=amd64 ...
Run an AMD64 container on M1/M2 (ARM64)
Build an AMD64/ARM64 dual-platform image
Even supports running Intel (AMD64) containers on M1/M2 (ARM64)
and vice versa, using tonistiigi/binfmt
k3s with Lima
k3s: Lightweight Kubernetes
● CNCF Sandbox project
● Adopts containerd as the CRI runtime
● Works with Lima too
11
$ limactl start template://k3s
$ limactl shell k3s sudo cat /etc/rancher/k3s/k3s.yaml ⧵
>~/.kube/config
$ kubectl ...
Extra: Docker with Lima
The original design was only to support containerd, but the
scope is now expanded to support Docker Engine too
(Docker Engine: Apache License 2.0, no proprietary GUI)
12
$ limactl start template://docker
$ brew install docker
$ docker context create lima --docker ⧵
"host=unix://$HOME/.lima/docker/sock/docker.sock"
$ docker context use lima
$ docker run ...
Extra: Podman with Lima
And even Podman
13
$ limactl start template://podman
$ brew install podman
$ podman system connection add lima ⧵
"unix://$HOME/.lima/podman/sock/podman.sock"
$ podman system connection default lima
$ podman run ...
How it works: Hypervisor
● Vanilla QEMU
● Supports both Intel and ARM
● Even supports Intel-on-ARM and ARM-on-Intel (slow though)
● FAQ: why not use Apple’s Virtualization.framework?
○ Proprietary
○ Limited functionalities
14
How it works: Filesystem sharing
● Lima < 1.0: reverse SSHFS
○ macOS works as an SSH client but as an SFTP server
○ Linux works an SSH server but as an SFTP client
● Lima ≥ 1.0: virtio-9p-pci , aka virtfs (not virtio-fs)
○ Less weirdness, tolerant of Ethernet failure
○ Lima 1.0 will be released by the end of the year
15
How it works: Filesystem sharing
● FAQ: why not use virtio-fs (faster than virtfs) ?
○ QEMU still doesn’t implement virtio-fs for macOS hosts
○ Apple’s Virtualization.framework implements virtio-fs,
but it is proprietary and lacks other functionalities
16
How it works: Port forwarding
● The guest ports are accessible as localhost from the
host
● Watch guest events, and run ssh -L to let SSH forward
TCP ports
● Event sources:
○ /proc/net/{tcp,tcp6}: For non-CNI ports
○ iptables, AUDIT_NETFILTER_CFG: For CNI ports 17
How it works: Networking
The default networking is QEMU’s -netdev user (aka slirp)
● No root privilege is needed at all
● The guest IP is not reachable from the host and other VMs
(But Lima forwards all localhost ports)
● Especially problematic for multi-node Kubernetes
18
How it works: Networking
Opt-in: socket_vmnet (https://github.com/lima-vm/socket_vmnet)
● Assign “real” IP reachable from the host, other VMs, and
even from other hosts (with bridge mode)
● Caveat: root privilege is needed for running socket_vmnet
daemon (not for QEMU)
19
How it works: Networking
FAQ: why not use QEMU’s -netdev vmnet-shared ?
(available since QEMU 7.1)
● Because it needs running the entire QEMU as the root
20
Third party FOSS projects
21
Lima-GUI https://github.com/afbjorklund/lima-gui
Colima https://github.com/abiosoft/colima
Rancher Desktop https://github.com/rancher-sandbox/rancher-desktop
Rancher Desktop
● GUI for containerd, moby, and k3s
● Rancher Dashboard for Kubernetes
● Test Kubernetes version upgrades
● Image scanning with Trivy
● Also works on Linux & Windows (WSL2)
● Free and open source
22
Recap
Lima provides a quick way to run containerd and k3s on macOS
● With automatic host filesystem sharing
● With automatic port forwarding
23
$ brew install lima
$ limactl start
$ lima nerdctl run -d -p 127.0.0.1:80:80 nginx:alpine
$ curl http://localhost
Join us!
● GitHub Discussions: https://github.com/lima-vm/lima/discussions
● CNCF Slack: #lima channel
24
https://github.com/lima-vm/lima

More Related Content

PDF
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
PDF
[KubeConEU2023] Lima pavilion
PPTX
OVN - Basics and deep dive
PPTX
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
PDF
Ceph Block Devices: A Deep Dive
PDF
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
PPTX
Meetup 23 - 02 - OVN - The future of networking in OpenStack
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
[KubeConEU2023] Lima pavilion
OVN - Basics and deep dive
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
Ceph Block Devices: A Deep Dive
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
Meetup 23 - 02 - OVN - The future of networking in OpenStack

What's hot (20)

PDF
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
PDF
eBPF - Rethinking the Linux Kernel
PPTX
Linux fundamentals
PDF
Deploy Application on Kubernetes
PDF
Ceph issue 해결 사례
PDF
ContainerDays Hamburg 2023 — Cilium Workshop.pdf
PDF
OpenWrt From Top to Bottom
PPTX
Introduction to the Container Network Interface (CNI)
PPTX
Kubernetes fundamentals
PDF
DevJam 2019 - Introduction to Kubernetes
PDF
Cumulus networks conversion guide
PDF
VLANs in the Linux Kernel
PPTX
Tutorial: Using GoBGP as an IXP connecting router
PDF
Large scale overlay networks with ovn: problems and solutions
PDF
Container Network Interface: Network Plugins for Kubernetes and beyond
PPTX
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
PDF
Meet cute-between-ebpf-and-tracing
PDF
오픈스택 기반 클라우드 서비스 구축 방안 및 사례
PPTX
OVN DBs HA with scale test
PPTX
Vxlan deep dive session rev0.5 final
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
eBPF - Rethinking the Linux Kernel
Linux fundamentals
Deploy Application on Kubernetes
Ceph issue 해결 사례
ContainerDays Hamburg 2023 — Cilium Workshop.pdf
OpenWrt From Top to Bottom
Introduction to the Container Network Interface (CNI)
Kubernetes fundamentals
DevJam 2019 - Introduction to Kubernetes
Cumulus networks conversion guide
VLANs in the Linux Kernel
Tutorial: Using GoBGP as an IXP connecting router
Large scale overlay networks with ovn: problems and solutions
Container Network Interface: Network Plugins for Kubernetes and beyond
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
Meet cute-between-ebpf-and-tracing
오픈스택 기반 클라우드 서비스 구축 방안 및 사례
OVN DBs HA with scale test
Vxlan deep dive session rev0.5 final
Ad

Similar to [CNCF TAG-Runtime 2022-10-06] Lima (20)

PDF
[KubeCon EU 2022] Running containerd and k3s on macOS
PDF
20241115 [KubeCon NA Pavilion] Lima.pdf_
PDF
[KubeConNA2023] Lima pavilion
PDF
20250402 [KubeCon EU Pavilion] Lima.pdf_
PDF
20240321 [KubeCon EU Pavilion] Lima.pdf_
PPT
2 Linux Container and Docker
PPT
Develop with linux containers and docker
PDF
OSCON: Advanced Docker developer workflows on Mac OS and Windows
PDF
Advanced Docker Developer Workflows on MacOS X and Windows
PPT
Linux containers and docker
PPTX
Central Iowa Linux Users Group: November Meeting -- Container showdown
PDF
An Updated Performance Comparison of Virtual Machines and Linux Containers
PDF
PDF
Evolution of containers to kubernetes
PPTX
Virtual machines and containers
PDF
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
PDF
Unikernels: Rise of the Library Hypervisor
PDF
Using Docker to build and test in your laptop and Jenkins
PDF
Containing the world with Docker
PPTX
Docker Meetup 08 03-2016
[KubeCon EU 2022] Running containerd and k3s on macOS
20241115 [KubeCon NA Pavilion] Lima.pdf_
[KubeConNA2023] Lima pavilion
20250402 [KubeCon EU Pavilion] Lima.pdf_
20240321 [KubeCon EU Pavilion] Lima.pdf_
2 Linux Container and Docker
Develop with linux containers and docker
OSCON: Advanced Docker developer workflows on Mac OS and Windows
Advanced Docker Developer Workflows on MacOS X and Windows
Linux containers and docker
Central Iowa Linux Users Group: November Meeting -- Container showdown
An Updated Performance Comparison of Virtual Machines and Linux Containers
Evolution of containers to kubernetes
Virtual machines and containers
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
Unikernels: Rise of the Library Hypervisor
Using Docker to build and test in your laptop and Jenkins
Containing the world with Docker
Docker Meetup 08 03-2016
Ad

More from Akihiro Suda (20)

PDF
20250617 [KubeCon JP 2025] containerd - Project Update and Deep Dive.pdf
PDF
20250616 [KubeCon JP 2025] VexLLM - Silence Negligible CVE Alerts Using LLM.pdf
PDF
20250403 [KubeCon EU] containerd - Project Update and Deep Dive.pdf
PDF
20250403 [KubeCon EU Pavilion] containerd.pdf
PDF
20241113 [KubeCon NA Pavilion] containerd.pdf
PDF
【情報科学若手の会 (2024/09/14】なぜオープンソースソフトウェアにコントリビュートすべきなのか
PDF
【Vuls祭り#10 (2024/08/20)】 VexLLM: LLMを用いたVEX自動生成ツール
PDF
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
PDF
20240320 [KubeCon EU Pavilion] containerd.pdf
PDF
20240201 [HPC Containers] Rootless Containers.pdf
PDF
[Podman Special Event] Kubernetes in Rootless Podman
PDF
[KubeConNA2023] containerd pavilion
PDF
[DockerConハイライト] OpenPubKeyによるイメージの署名と検証.pdf
PDF
[CNCF TAG-Runtime] Usernetes Gen2
PDF
[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...
PDF
The internals and the latest trends of container runtimes
PDF
[KubeConEU2023] containerd pavilion
PDF
[Container Plumbing Days 2023] Why was nerdctl made?
PDF
[FOSDEM2023] Bit-for-bit reproducible builds with Dockerfile
PPTX
Dockerからcontainerdへの移行
20250617 [KubeCon JP 2025] containerd - Project Update and Deep Dive.pdf
20250616 [KubeCon JP 2025] VexLLM - Silence Negligible CVE Alerts Using LLM.pdf
20250403 [KubeCon EU] containerd - Project Update and Deep Dive.pdf
20250403 [KubeCon EU Pavilion] containerd.pdf
20241113 [KubeCon NA Pavilion] containerd.pdf
【情報科学若手の会 (2024/09/14】なぜオープンソースソフトウェアにコントリビュートすべきなのか
【Vuls祭り#10 (2024/08/20)】 VexLLM: LLMを用いたVEX自動生成ツール
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240320 [KubeCon EU Pavilion] containerd.pdf
20240201 [HPC Containers] Rootless Containers.pdf
[Podman Special Event] Kubernetes in Rootless Podman
[KubeConNA2023] containerd pavilion
[DockerConハイライト] OpenPubKeyによるイメージの署名と検証.pdf
[CNCF TAG-Runtime] Usernetes Gen2
[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...
The internals and the latest trends of container runtimes
[KubeConEU2023] containerd pavilion
[Container Plumbing Days 2023] Why was nerdctl made?
[FOSDEM2023] Bit-for-bit reproducible builds with Dockerfile
Dockerからcontainerdへの移行

Recently uploaded (20)

PPTX
Online Work Permit System for Fast Permit Processing
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
ai tools demonstartion for schools and inter college
PDF
AI in Product Development-omnex systems
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Nekopoi APK 2025 free lastest update
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
L1 - Introduction to python Backend.pptx
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
top salesforce developer skills in 2025.pdf
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
Online Work Permit System for Fast Permit Processing
How to Choose the Right IT Partner for Your Business in Malaysia
Design an Analysis of Algorithms II-SECS-1021-03
ai tools demonstartion for schools and inter college
AI in Product Development-omnex systems
Softaken Excel to vCard Converter Software.pdf
CHAPTER 2 - PM Management and IT Context
Nekopoi APK 2025 free lastest update
Which alternative to Crystal Reports is best for small or large businesses.pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Operating system designcfffgfgggggggvggggggggg
Odoo Companies in India – Driving Business Transformation.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
L1 - Introduction to python Backend.pptx
Understanding Forklifts - TECH EHS Solution
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
top salesforce developer skills in 2025.pdf
ManageIQ - Sprint 268 Review - Slide Deck

[CNCF TAG-Runtime 2022-10-06] Lima

  • 1. CNCF TAG-Runtime meeting (Oct 6, 2022) Akihiro Suda, NTT 1 Linux virtual machines, typically on macOS, for running containerd https://github.com/lima-vm/lima Relevant talk at KubeCon EU (May 2022): “Running containerd and k3s on macOS” - Akihiro Suda, NTT Corporation & Jan Dubois, SUSE
  • 2. 2 Lima joined CNCF Sandbox 🎉 https://www.cncf.io/projects/lima/
  • 3. Why run containers on macOS? ● 2022 is The Year of the Linux Desktop™… ● But ordinary developers still need macOS (or Windows) ● Almost solely for the dev & test environment ● Not the best fit for running a production server 3
  • 4. Existing methods ● Docker Desktop for Mac has been the popular solution ● Supports automatic host filesystem sharing ● Supports automatic port forwarding ● But proprietary 4
  • 5. Existing methods Just install Docker and Kubernetes inside a Linux VM? Maybe via minikube? ● VMware Fusion and Parallels are proprietary ● VirtualBox is FLOSS but won’t support M1 ● QEMU is FLOSS and supports M1, but still ○ Not easy to access the host FS from the containers ○ Not easy to access the container ports from the host 5
  • 6. Our solution: Lima ● Similar to WSL2 but for macOS hosts ● Automatic host filesystem sharing ● Automatic port forwarding ● Built-in integration for containerd 6 https://github.com/lima-vm/lima $ brew install lima $ limactl start $ lima nerdctl run ...
  • 7. Lima = LInux MAchine ● Originally designed as “containerd machine” to mimic Docker Machine ● The scope was extended immediately to cover other use cases too ● Still focuses on containerd and k3s 7
  • 8. containerd with Lima containerd: the de facto standard container runtime ● CNCF Graduated project ● Not just made for Kubernetes ● Provides the docker-compatible CLI too: containerdctl ● With a lot of cutting-edge features ○ Lazy-pulling, IPFS, OCIcrypt, Faster rootless … 8 $ nerdctl build -t foo . $ nerdctl run -d -p 127.0.0.1:80:80 foo
  • 9. containerd with Lima Lima provides built-in support for containerd 9 $ lima nerdctl build -t foo . $ lima nerdctl run -d -p 127.0.0.1:80:80 foo Build an image from a Dockerfile on the macOS home directory Expose the container’s port 80 as the macOS’s http://localhost
  • 10. containerd with Lima 10 $ lima nerdctl build --platform=amd64,arm64 ... $ lima nerdctl run --platform=amd64 ... Run an AMD64 container on M1/M2 (ARM64) Build an AMD64/ARM64 dual-platform image Even supports running Intel (AMD64) containers on M1/M2 (ARM64) and vice versa, using tonistiigi/binfmt
  • 11. k3s with Lima k3s: Lightweight Kubernetes ● CNCF Sandbox project ● Adopts containerd as the CRI runtime ● Works with Lima too 11 $ limactl start template://k3s $ limactl shell k3s sudo cat /etc/rancher/k3s/k3s.yaml ⧵ >~/.kube/config $ kubectl ...
  • 12. Extra: Docker with Lima The original design was only to support containerd, but the scope is now expanded to support Docker Engine too (Docker Engine: Apache License 2.0, no proprietary GUI) 12 $ limactl start template://docker $ brew install docker $ docker context create lima --docker ⧵ "host=unix://$HOME/.lima/docker/sock/docker.sock" $ docker context use lima $ docker run ...
  • 13. Extra: Podman with Lima And even Podman 13 $ limactl start template://podman $ brew install podman $ podman system connection add lima ⧵ "unix://$HOME/.lima/podman/sock/podman.sock" $ podman system connection default lima $ podman run ...
  • 14. How it works: Hypervisor ● Vanilla QEMU ● Supports both Intel and ARM ● Even supports Intel-on-ARM and ARM-on-Intel (slow though) ● FAQ: why not use Apple’s Virtualization.framework? ○ Proprietary ○ Limited functionalities 14
  • 15. How it works: Filesystem sharing ● Lima < 1.0: reverse SSHFS ○ macOS works as an SSH client but as an SFTP server ○ Linux works an SSH server but as an SFTP client ● Lima ≥ 1.0: virtio-9p-pci , aka virtfs (not virtio-fs) ○ Less weirdness, tolerant of Ethernet failure ○ Lima 1.0 will be released by the end of the year 15
  • 16. How it works: Filesystem sharing ● FAQ: why not use virtio-fs (faster than virtfs) ? ○ QEMU still doesn’t implement virtio-fs for macOS hosts ○ Apple’s Virtualization.framework implements virtio-fs, but it is proprietary and lacks other functionalities 16
  • 17. How it works: Port forwarding ● The guest ports are accessible as localhost from the host ● Watch guest events, and run ssh -L to let SSH forward TCP ports ● Event sources: ○ /proc/net/{tcp,tcp6}: For non-CNI ports ○ iptables, AUDIT_NETFILTER_CFG: For CNI ports 17
  • 18. How it works: Networking The default networking is QEMU’s -netdev user (aka slirp) ● No root privilege is needed at all ● The guest IP is not reachable from the host and other VMs (But Lima forwards all localhost ports) ● Especially problematic for multi-node Kubernetes 18
  • 19. How it works: Networking Opt-in: socket_vmnet (https://github.com/lima-vm/socket_vmnet) ● Assign “real” IP reachable from the host, other VMs, and even from other hosts (with bridge mode) ● Caveat: root privilege is needed for running socket_vmnet daemon (not for QEMU) 19
  • 20. How it works: Networking FAQ: why not use QEMU’s -netdev vmnet-shared ? (available since QEMU 7.1) ● Because it needs running the entire QEMU as the root 20
  • 21. Third party FOSS projects 21 Lima-GUI https://github.com/afbjorklund/lima-gui Colima https://github.com/abiosoft/colima Rancher Desktop https://github.com/rancher-sandbox/rancher-desktop
  • 22. Rancher Desktop ● GUI for containerd, moby, and k3s ● Rancher Dashboard for Kubernetes ● Test Kubernetes version upgrades ● Image scanning with Trivy ● Also works on Linux & Windows (WSL2) ● Free and open source 22
  • 23. Recap Lima provides a quick way to run containerd and k3s on macOS ● With automatic host filesystem sharing ● With automatic port forwarding 23 $ brew install lima $ limactl start $ lima nerdctl run -d -p 127.0.0.1:80:80 nginx:alpine $ curl http://localhost
  • 24. Join us! ● GitHub Discussions: https://github.com/lima-vm/lima/discussions ● CNCF Slack: #lima channel 24 https://github.com/lima-vm/lima