Rootless Podman on Mac M4 - on reboot, containers do not have access to remote host unless podman machine is restarted #28128
Replies: 1 comment 1 reply
-
|
This is a known pain point with Podman machine on macOS. The issue is a timing/ordering problem during automatic boot startup -- the VM's networking stack is not fully ready when your cron/launchd job starts it. Why stop+start fixes itWhen you manually run The fix: delay the start and do a clean cycleCreate a LaunchAgent that waits for network availability before starting the machine: <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.podman-machine-start</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-c</string>
<string>/usr/local/bin/podman machine stop 2>/dev/null; sleep 5; /usr/local/bin/podman machine start</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<dict>
<key>NetworkState</key>
<true/>
</dict>
<key>ThrottleInterval</key>
<integer>30</integer>
<key>StandardOutPath</key>
<string>/tmp/podman-machine-start.log</string>
<key>StandardErrorPath</key>
<string>/tmp/podman-machine-start.err</string>
</dict>
</plist>Save this to launchctl load ~/Library/LaunchAgents/com.user.podman-machine-start.plistThe Alternative: switch to pasta networkingYou mentioned using slirp4netns. If you are on Podman 5.x, try podman machine stop
podman machine rm
podman machine init --rootful
podman machine startPasta handles network namespace setup differently and may be more resilient to the boot timing issue. It is also faster than slirp4netns. Also check gvproxy logsIf the problem persists, check gvproxy logs after a broken boot: cat ~/Library/Logs/podman-machine-*.logThis should show whether gvproxy failed to bind or encountered a routing error during startup. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Rootless Podman on Mac M4 - on reboot, machine and containers do not have access to remote host unless podman machine is restarted with 'podman machine stop' then' podman machine start' from zsh terminal.
Running rootless podman as a local user on Mac. Loads a gitlab runner image. After reboot, everything loads, but machine and container's network is messed up and is denied access from 10.88.x to a remote host.
but if i do:
podman machine stop
podman machine start
Everything works fine. (can access remote hosts after this)
Mac M4 proc
Latest OS
Podman 5.8
Removed Desktop app
recreated podman machine, recreated runners, etc
using slirpy4netns (if i don't, then resolv.conf is messed up)
This is happening on 2 separate macs
I have delayed podman start on boot by using local user crontab. Tried Launchtl, tried using Automator, same thing. Tried to start, stop, then start again from cron.
Summary:
Thoughts? Suggestions?
Beta Was this translation helpful? Give feedback.
All reactions