notes/cmd/lima.md
2024-06-26 11:27:51 +02:00

2 KiB
Raw Blame History

https://medium.com/@harry-touloupas/when-mac-m1-m2-met-ebpf-a-tale-of-compatibility-6b9a6bc53f3e

  • brew install lima
  • create file ubuntu-lts-ebpf.yaml:
  • images:
    

Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months.

Fallback to the latest release image.

memory: "2GiB" cpus: 2 disk: "30GiB" ssh:

You can choose any port or omit this. Specifying a value ensures same port bindings after restarts

Forwarded to port 22 of the guest.

localPort: 2222

We are going to install all the necessary packages for our development environment.

These include Python 3 and the bpfcc tools package.

provision:

  • mode: system script: | #!/bin/bash set -eux -o pipefail export DEBIAN_FRONTEND=noninteractive apt update && apt-get install -y vim python3 bpfcc-tools linux-headers-$(uname -r)
  • mode: user script: | #!/bin/bash set -eux -o pipefail sudo cp /home/$(whoami).linux/.ssh/authorized_keys /root/.ssh/authorized_keys

* ```bash
  limactl start --name=ebpf-lima-vm ./ubuntu-lts-ebpf.yaml
  • cat ~/.lima/ebpf-lima-vm/ssh.config >> ~/.ssh/config. #It appends Limas SSH configuration options to your default SSH options just to make it easier for PyCharm to connect to the VM.