In this article, we will see how to solve "podman-machine-default_ready.sock: connect: no such file or directory" error which you might get sometimes whenever you try to start default machine using podman machine start command. It is possible that when you freshly installed podman in your System and try to initialize and start a vm then you might run into some error. This is one such error faced by many while trying to start the vm. In my case, this error was showing on my MacBook machine however it is possible that the same error could show in other Unix/Linux system as well.
Solved "podman-machine-default_ready.sock: connect: no such file or directory"
Also Read: Solved "Error while dialing dial unix /var/run/dockershim.sock"
So as i stated earlier, when I tried to start default machine using podman machine start
command then I noticed Error: dial unix /var/folders/c4/1bhbmy092gzcnbktg334mry9000gp/T/podman/podman-machine-default_ready.sock: connect: no such file or directory
on the output as shown below.
[cyberithub@mac1066 ~ % podman machine start Starting machine "podman-machine-default" WARN[0000] podman helper is installed, but was not able to claim the global docker sock Waiting for VM ... Error: dial unix /var/folders/c4/1bhbmy092gzcnbktg334mry9000gp/T/podman/podman-machine-default_ready.sock: connect: no such file or directory
Not just above error but when I tried using podman images
command to list out the images then I noticed below failed to connect: ssh: handshake failed
error which was kind of expected after facing podman-machine-default_ready.sock: connect: no such file or directory
error. This is simply because default machine was not initialized properly with podman machine init
command which failed to create podman-machine-default_ready.sock
file.
Another reason for the error could be that you might have denied the incoming ssh connections when asked during the machine initialization. This was the case happened with me. When it asked me to allow the incoming ssh connection then I clicked on deny
instead of allow
hence the error.
[cyberithub@mac1066 ~ % podman images Error: failed to connect: ssh: handshake failed: read tcp 127.0.0.1:52515->127.0.0.1:52453: read: connection reset by peer
So to solve the above error you need to first stop the default machine by using podman machine stop
command as shown below.
[cyberithub@mac1066 ~ % podman machine stop Waiting for VM to exit... Machine "podman-machine-default" stopped successfully
Then remove the VM by using podman machine rm
command as shown below. This will remove all the file and contents related to the default machine.
[cyberithub@mac1066 ~ % podman machine rm The following files will be deleted: /Users/cyberithub/.ssh/podman-machine-default /Users/cyberithub/.ssh/podman-machine-default.pub /Users/cyberithub/.config/containers/podman/machine/qemu/podman-machine-default.ign /Users/cyberithub/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-38.20230414.2.0-qemu.x86_64.qcow2 /Users/cyberithub/.local/share/containers/podman/machine/qemu/podman.sock /Users/cyberithub/.config/containers/podman/machine/qemu/podman-machine-default.json Are you sure you want to continue? [y/N] y
Finally, reinitialize the machine with podman machine init
command as shown below. After this, if you now run podman machine start
command again then it should start the machine without any error.
[cyberithub@mac1066 ~ % podman machine init Extracting compressed file Image resized. Machine init complete To start your machine run: podman machine start
This solved the error in my system. Hope it works for you as well. However in some cases, it is possible that the above solution does not work for you. In that case, I would request you to please let me know in the comment box so that we can work together to solve your error.