, ,

Troubleshooting Podman Machine

Podman runs Linux containers, which depend on a Linux operating system. This means that if a user is on a Mac or Windows, Podman needs to run inside a VM. Most of the time, a standard install of Podman machine just works out of the box. However, when something goes wrong, the complexity of the underlying machine system, which relies on Podman’s remote client to talking to Podman inside the VM through SSH, may make it confusing and difficult for the user to see what exactly went wrong. As Podman machine has been seeing more and more usage recently, especially on non-Linux platforms, we’ve seen a lot of common issues pop up, and so we’d like to show you how to resolve these issues.

Try this first:

Most of the time, if you are not particularly attached to your running machine and containers, a simple recreation of your machine should do the trick and reset your machine configuration.

podman machine rm
podman machine init --now

If you’ve tried this but still run into issues with Podman machine, here are a few common issues and how to resolve them.

Issue: Wrong Arch of Podman Installed

Symptom: You’re on an M1 Mac.  You probably also installed Podman using Homebrew. You get this error:

Error: qemu exited unexpectedly with exit code -1, stderr: qemu-system-x86_64: Unknown Error.

Solution: Make sure your homebrew installation is not done under Rosetta. Homebrew under Rosetta will install the incorrect build of Podman, and Podman machine will not be able to boot. This requires you to re-install native Homebrew, not under rosetta

Issue: Podman Machine Connection incorrectly Configured 

Symptom: You run a podman command and get this error:

Error: unable to connect to Podman socket: Get "http://d/v4.0.2/libpod/_ping": dial unix ///var/folders/kl/mjb_x3511yd21w18ht4sz62m0000gn/T/podman-run--1/podman/podman.sock: connect: no such file or directory

Explanation: The connection to your VM wasn’t able to be established. This usually means something happened to the SSH key setup. 

Solution: First, check your podman system connections. It should look something like this:

$ podman system connection list
Name                         URI                                                         Identity                                   Default

podman-machine-default       ssh://core@localhost:62840/run/user/501/podman/podman.sock  /Users/ashley/.ssh/podman-machine-default  true

podman-machine-default-root  ssh://root@localhost:62840/run/podman/podman.sock           /Users/ashley/.ssh/podman-machine-default  false

Make sure the connection to your desired machine is set as default. If it’s not, use this command to set your desired connection as the default connection:

podman system connection default podman-machine-default

Issue: SSH Keys incorrectly configured

Symptom: You run a podman command, and get this error:

Error: failed to connect: ssh: handshake failed: read tcp [::1]:56237->[::1]:49619: read: connection reset by peer 

Explanation: Something about your SSH keys or ssh-agent is misconfigured. 

Solution: Clean up your keys in your home/.ssh directory. Most likely, there may be a misconfigured key, or an old key with the same name as your VM. In this case, it’s best to delete all keys associated with podman-machine, and re-init your machine.

Issue: The time inside my VM is not correct

Symptom: When running containers using Podman and Podman machine, the time inside the VM is incorrect.

Explanation: While suspending and resuming the host Mac machine, the virtualized clock inside the VM drifts from the host clock.

Solution: At this time, Podman hasn’t been able to implement a fix for this issue. We’re aware of it and are prioritizing a fix, and progress can be tracked on the Github Issue. However, a simple re-start of the machine seems to fix things, and if that’s not possible, many community members have posted their workarounds in the linked issue.

Conclusion

The intention behind Podman machine was to abstract away the complexities of running Podman inside a VM, but hiding such abstractions means that when something goes wrong, it’s hard to track down where it went wrong and how to fix it.  Hopefully here, we were able to provide some solutions to the most common configuration issues.

If you’ve encountered an issue that isn’t mentioned here, please open an issue on our Github! You can also reach out to the Podman developers by joining our community, as we have a mailing-list, and a matrix/IRC room, as well as community meetings! 

2 responses to “Troubleshooting Podman Machine”

  1. Andreas Avatar

    $ podman run -dt -p 8080:8080/tcp -e HTTPD_VAR_RUN=/run/httpd -e HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \
    -e HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \
    -e HTTPD_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/httpd/ \
    registry.fedoraproject.org/f29/httpd /usr/bin/run-httpd
    ERRO[0055] unable to write pod event: “write unixgram @000d7->/run/systemd/journal/socket: sendmsg: no such file or directory”
    ERRO[0056] unable to write pod event: “write unixgram @000d7->/run/systemd/journal/socket: sendmsg: no such file or directory”
    ERRO[0056] unable to write pod event: “write unixgram @000d7->/run/systemd/journal/socket: sendmsg: no such file or directory”
    1c75d92b306e057dadeebebe796e7c60525986f508b0227f126d59f8e41e7569

  2. Andreas Avatar

    Why do I keep receiving the “/run/systemd/journal/socket: sendmsg: no such file or directory” every time I try to run a container. So, I’ve never been successful to run any container.
    I’ve tried to have the root create the ‘journal’ folder and the socket file, then granted it to my user. But it was always failed.
    How to fix this problem.

Leave a Reply

Subscribe

Sign up with your email address to receive updates by email from this website.


Categories


Search