Blog: 2024-10-03

From razwiki
Jump to navigation Jump to search

Got podman working with lima

podman $ ./bin/podman --url unix:///Users/razzi/.lima/podman/sock/podman.sock run -it debian
root@e6f3c2aa79b5:/# 
exit
./⏎                                                                             podman $ ./bin/podman --version
podman version 5.3.0-dev

Needed this lima command to start the podman machine:

limactl start template://podman

I got the url from lima's source:

lima $ cat cmd/podman.lima 
#!/bin/sh
set -eu
: "${LIMA_INSTANCE:=podman}"
: "${PODMAN:=podman}"

if [ "$(limactl ls -q "$LIMA_INSTANCE" 2>/dev/null)" != "$LIMA_INSTANCE" ]; then
  echo "instance \"$LIMA_INSTANCE\" does not exist, run \`limactl create --name=$LIMA_INSTANCE template://podman\` to create a new instance" >&2
  exit 1
elif [ "$(limactl ls -f '{{ .Status }}' "$LIMA_INSTANCE" 2>/dev/null)" != "Running" ]; then
  echo "instance \"$LIMA_INSTANCE\" is not running, run \`limactl start $LIMA_INSTANCE\` to start the existing instance" >&2
  exit 1
fi
PODMAN=$(command -v "$PODMAN" || true)
if [ -n "$PODMAN" ]; then
  CONTAINER_HOST=$(limactl list "$LIMA_INSTANCE" --format 'unix://{{.Dir}}/sock/podman.sock')
  export CONTAINER_HOST
  exec "$PODMAN" --remote "$@"
else
  export LIMA_INSTANCE
  exec lima podman "$@"
fi

Even simpler:

env LIMA_INSTANCE=podman lima podman run -it debian


https://github.com/runfinch/finch seems similar but it's a gui app or something?

Also this is the command I ran to get limactl to not prompt me. It ended with an error but seemed to work...?

lima $ limactl start template://podman --tty=false
INFO[0000] Terminal is not available, proceeding without opening an editor 
WARN[0000] treating lima version "5db1b15" from "/Users/razzi/.lima/podman/lima-version" as very latest release 
WARN[0000] treating lima version "5db1b15" from "/Users/razzi/.lima/debian/lima-version" as very latest release 
WARN[0000] treating lima version "5db1b15" from "/Users/razzi/.lima/default/lima-version" as very latest release 
WARN[0000] treating lima version "5db1b15" from "/Users/razzi/.lima/podman/lima-version" as very latest release 
INFO[0000] Starting the instance "podman" with VM driver "qemu" 
INFO[0000] Attempting to download the image              arch=x86_64 digest="sha256:ac58f3c35b73272d5986fa6d3bc44fd246b45df4c334e99a07b3bbd00684adee" location="https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2"
Downloading the image (Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2)
379.06 MiB / 379.06 MiB [----------------------------------] 100.00% 23.78 MiB/s
INFO[0017] Downloaded the image from "https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2" 
WARN[0017] [hostagent] treating lima version "5db1b15" from "/Users/razzi/.lima/podman/lima-version" as very latest release 
INFO[0018] [hostagent] debug build detected, adding more guest agent candidates: /usr/_output/share/lima/lima-guestagent.Linux-x86_64 
WARN[0020] [hostagent] GRPC port forwarding is experimental 
INFO[0020] [hostagent] hostagent socket created at /Users/razzi/.lima/podman/ha.sock 
INFO[0021] [hostagent] Using system firmware ("/usr/local/share/qemu/edk2-x86_64-code.fd") 
INFO[0021] [hostagent] Starting QEMU (hint: to watch the boot progress, see "/Users/razzi/.lima/podman/serial*.log") 
INFO[0021] SSH Local Port: 60208                        
INFO[0021] [hostagent] Waiting for the essential requirement 1 of 4: "ssh" 
INFO[0031] [hostagent] Waiting for the essential requirement 1 of 4: "ssh" 
INFO[0107] [hostagent] Waiting for the essential requirement 1 of 4: "ssh" 
INFO[0117] [hostagent] Waiting for the essential requirement 1 of 4: "ssh" 
INFO[0128] [hostagent] Waiting for the essential requirement 1 of 4: "ssh" 
INFO[0130] [hostagent] The essential requirement 1 of 4 is satisfied 
INFO[0130] [hostagent] Waiting for the essential requirement 2 of 4: "user session is ready for ssh" 
INFO[0140] [hostagent] Waiting for the essential requirement 2 of 4: "user session is ready for ssh" 
INFO[0142] [hostagent] The essential requirement 2 of 4 is satisfied 
INFO[0142] [hostagent] Waiting for the essential requirement 3 of 4: "sshfs binary to be installed" 
INFO[0182] [hostagent] Waiting for the essential requirement 3 of 4: "sshfs binary to be installed" 
INFO[0223] [hostagent] Waiting for the essential requirement 3 of 4: "sshfs binary to be installed" 
INFO[0230] [hostagent] The essential requirement 3 of 4 is satisfied 
INFO[0230] [hostagent] Waiting for the essential requirement 4 of 4: "fuse to \"allow_other\" as user" 
INFO[0237] [hostagent] The essential requirement 4 of 4 is satisfied 
INFO[0237] [hostagent] Mounting "/Users/razzi" on "/Users/razzi" 
INFO[0237] [hostagent] Mounting "/tmp/lima" on "/tmp/lima" 
INFO[0238] [hostagent] Waiting for the optional requirement 1 of 1: "user probe 1/1" 
INFO[0238] [hostagent] Forwarding "/run/user/501/podman/podman.sock" (guest) to "/Users/razzi/.lima/podman/sock/podman.sock" (host) 
INFO[0238] [hostagent] Forwarding "/run/lima-guestagent.sock" (guest) to "/Users/razzi/.lima/podman/ga.sock" (host) 
INFO[0238] [hostagent] Guest agent is running           
INFO[0238] [hostagent] Not forwarding TCP 127.0.0.54:53 
INFO[0238] [hostagent] Not forwarding TCP 0.0.0.0:22    
INFO[0238] [hostagent] Not forwarding TCP 127.0.0.53:53 
INFO[0238] [hostagent] Forwarding TCP from 0.0.0.0:5355 to 127.0.0.1:5355 
INFO[0238] [hostagent] Not forwarding TCP [::]:22       
INFO[0238] [hostagent] Forwarding TCP from [::]:5355 to 127.0.0.1:5355 
INFO[0238] [hostagent] Not forwarding UDP 127.0.0.54:53 
INFO[0238] [hostagent] Not forwarding UDP 127.0.0.53:53 
INFO[0238] [hostagent] Not forwarding UDP 127.0.0.1:323 
INFO[0238] [hostagent] Not forwarding UDP 0.0.0.0:47962 
INFO[0238] [hostagent] Not forwarding UDP 0.0.0.0:5353  
INFO[0238] [hostagent] Not forwarding UDP 0.0.0.0:5355  
INFO[0238] [hostagent] Not forwarding UDP [::]:39039    
INFO[0238] [hostagent] Not forwarding UDP [::1]:323     
INFO[0238] [hostagent] Not forwarding UDP [::]:5353     
INFO[0238] [hostagent] Not forwarding UDP [::]:5355     
INFO[0279] [hostagent] Waiting for the optional requirement 1 of 1: "user probe 1/1" 
INFO[0319] [hostagent] Waiting for the optional requirement 1 of 1: "user probe 1/1" 
INFO[0361] [hostagent] Waiting for the optional requirement 1 of 1: "user probe 1/1" 
INFO[0401] [hostagent] Waiting for the optional requirement 1 of 1: "user probe 1/1" 
INFO[0442] [hostagent] Waiting for the optional requirement 1 of 1: "user probe 1/1" 
INFO[0482] [hostagent] Waiting for the optional requirement 1 of 1: "user probe 1/1" 
INFO[0523] [hostagent] Waiting for the optional requirement 1 of 1: "user probe 1/1" 
INFO[0564] [hostagent] Waiting for the optional requirement 1 of 1: "user probe 1/1" 
INFO[0586] [hostagent] The optional requirement 1 of 1 is satisfied 
INFO[0586] [hostagent] Waiting for the guest agent to be running 
INFO[0586] [hostagent] Waiting for the final requirement 1 of 1: "boot scripts must have finished" 
FATA[0617] did not receive an event with the "running" status 
lima $ limactl start template://podman --tty=false
INFO[0000] Terminal is not available, proceeding without opening an editor 
FATA[0000] instance "podman" already exists ("/Users/razzi/.lima/podman")