Skip to content

eBPF-based security platform

lima: follow the shared Quickstart kernel setup

Andrea Lattuada76ddcbc748cd
diff --git a/Documentation/start/faq.rst b/Documentation/start/faq.rst
index a3ffeaa0..72bc1fb1 100644
--- a/Documentation/start/faq.rst
+++ b/Documentation/start/faq.rst
@@ -118,9 +118,9 @@ test VM also runs on arm64, and no riscv64 target has booted yet.
Can I try shirudo on macOS?
---------------------------
-Not natively: shirudo is Linux only. On an Apple M3 or later with macOS
-15 or later, :doc:`/start/quickstart-macos` runs the quickstart in a
-Lima VM, with the test VM nested inside it.
+shirudo runs only on Linux. On an Apple M3 or later with macOS 15 or
+later, :doc:`set up a Lima VM </start/quickstart-macos>` to run the
+quickstart. The test VM runs inside the Lima VM.
How much does shirudo cost on a target, and how far does it scale?
------------------------------------------------------------------
diff --git a/Documentation/start/index.rst b/Documentation/start/index.rst
index d1c4af08..54b10100 100644
--- a/Documentation/start/index.rst
+++ b/Documentation/start/index.rst
@@ -21,6 +21,5 @@ attesting a target.
who-is-shirudo-for
how-it-works
install
- quickstart-macos
guides/index
faq
diff --git a/Documentation/start/quickstart-macos.rst b/Documentation/start/quickstart-macos.rst
index dc743f67..d49289dd 100644
--- a/Documentation/start/quickstart-macos.rst
+++ b/Documentation/start/quickstart-macos.rst
@@ -5,8 +5,8 @@
:page-type: How-to
:audience: First-time users
-Run the quickstart on macOS
-===========================
+Set up a Linux host on macOS
+============================
shirudo builds and runs on Linux only, and its test VM needs KVM. On a
Mac, a Lima VM takes the place of the Linux host the
@@ -63,8 +63,7 @@ Create the VM
infra/lima/shirudo.yaml
The VM takes 8 GiB of memory and Lima's default of at most 4 CPUs.
- More CPUs shorten the kernel build; add ``--cpus=<count>`` to the
- command to give more.
+ Add ``--cpus=<count>`` to give the VM more CPUs.
2. From your checkout, open a shell in the VM:
@@ -91,9 +90,8 @@ Create the VM
Continue with the quickstart
----------------------------
-From here, follow the :doc:`/start/quickstart` from its section "Build a
-target kernel" in the VM shell. Every
-``operator$`` command runs in the Lima VM. The quick guides and
+In the VM shell, start the quickstart at :ref:`quickstart-kernel-artifact`.
+Every ``operator$`` command runs in the Lima VM. The quick guides and
:doc:`/contribute/code/develop-locally` work the same way; the VM has
Docker for the registry and the collector of the latter.
diff --git a/Documentation/start/quickstart.rst b/Documentation/start/quickstart.rst
index 57c25322..b23e2972 100644
--- a/Documentation/start/quickstart.rst
+++ b/Documentation/start/quickstart.rst
@@ -16,12 +16,17 @@ target's TPM what the target runs, and unload it again.
Your host plays the operator. The test VM plays the target: it boots the
way a production target does and enforces the same policy.
+.. toctree::
+ :hidden:
+
+ quickstart-macos
+
Before you begin
----------------
- A Linux host on x86-64 or arm64 with KVM. ``/dev/kvm`` must be readable
- and writable. On a Mac, :doc:`/start/quickstart-macos` sets up such
- a host in a Lima VM.
+ and writable. On a Mac, :doc:`use a Lima VM as your Linux host
+ </start/quickstart-macos>`.
- A locked-memory limit of ``unlimited`` (``ulimit -l``): the shirudo
binaries lock their memory and refuse to run without it. Root is not
needed; the test VM builds its initrd with dracut as you, without
diff --git a/infra/lima/shirudo.yaml b/infra/lima/shirudo.yaml
index 663297ce..fe4f4624 100644
--- a/infra/lima/shirudo.yaml
+++ b/infra/lima/shirudo.yaml
@@ -60,14 +60,14 @@ provision:
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends \
- build-essential pkg-config python3 git curl ca-certificates gpg jq \
+ build-essential pkg-config python3 git gh curl ca-certificates gpg jq \
openssl libssl-dev libcurl4-openssl-dev libelf-dev libluajit-5.1-dev \
libtpms-dev libtss2-dev zlib1g-dev libzstd-dev \
autoconf autoconf-archive automake libtool libltdl-dev \
bc bison flex cpio debhelper dpkg-dev fakeroot kmod libdw-dev \
libncurses-dev pahole rsync xz-utils zstd \
- qemu-system-arm qemu-utils swtpm swtpm-tools cloud-image-utils \
- libguestfs-tools dracut-core cryptsetup-bin e2fsprogs file \
+ qemu-system-arm qemu-utils swtpm swtpm-tools tpm2-tools libtss2-tcti-swtpm0t64 \
+ cloud-image-utils libguestfs-tools dracut-core cryptsetup-bin e2fsprogs file \
openssh-client iproute2 isc-dhcp-client docker.io
- mode: system
script: |
@@ -107,12 +107,9 @@ probes:
hint: See /var/log/cloud-init-output.log in the guest.
message: |
- Build and boot the test target as Documentation/start/quickstart.rst
- describes, in your checkout, which limactl shell opens in when you run
- it from there:
+ From your checkout, open a shell in the Lima VM:
------
limactl shell {{.Name}}
- make -C testing kernel
- make && make shirudo-build
- make -C testing vm VM_NAME=quickstart
------
+ Follow the test kernel artifact steps in Documentation/start/quickstart.rst
+ before building shirudo and booting the test target.