From dd4ea030982946b80f0a3537d7b723ac0a1bc53f Mon Sep 17 00:00:00 2001 From: Nicholas Rodrigues Lordello Date: Tue, 22 Sep 2026 20:08:35 +0200 Subject: Use Passt with Podman+Krun by Default TSI has some known limitations (such as mapping `:0` ports on the guest incorrectly). For this to work, some additional `passt` configuration was needed: - Enable `passt` in the `krun` configuration - `passt` cannot bind to service ports, so an additional sysctl in the container to remove all ports from the service port range. This does not affect the user in the guest - Additional `pasta` flags to make connections from the guest to the host not look like local ones on loopback (doesn't prevent access to the host over the network, but makes it look like another system on the local network). In general network isolation is still lacking and needs to be generally improved (but I lack understanding to make it work). --- dbx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dbx b/dbx index e226c95..f9a4bd2 100755 --- a/dbx +++ b/dbx @@ -529,7 +529,8 @@ elif [ "$OS" = "Linux" ] && has_commands podman krun; then cat <"$(krun_vmconfig)" { "cpus": $((cpus <= 32 ? (cpus + 1) / 2 : 16)), - "ram_mib": $(((mem + 1) / 2)) + "ram_mib": $(((mem + 1) / 2)), + "use_passt": 1 } CONFIG fi @@ -538,7 +539,9 @@ CONFIG --runtime=krun \ --name="$name" \ --hostname="$name" \ + --network="pasta:--no-map-gw,--map-guest-addr,none" \ --publish="127.0.0.1::22" \ + --sysctl="net.ipv4.ip_unprivileged_port_start=0" \ "$image" \ >/dev/null podman cp "$(ssh_id).pub" "$name:/etc/ssh/authorized_keys" -- cgit v1.2.3