Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Mac OS Big Sur & Monterey podman machine starts but doesn't connect #12751

Closed
unicman opened this issue Jan 5, 2022 · 32 comments · Fixed by #13750
Closed

On Mac OS Big Sur & Monterey podman machine starts but doesn't connect #12751

unicman opened this issue Jan 5, 2022 · 32 comments · Fixed by #13750
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@unicman
Copy link

unicman commented Jan 5, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

brew installed podman on my Mac OS laptop properly. podman init also downloaded fedora image and created podman machine. However podman start remains at Waiting for VM prompt forever.

Steps to reproduce the issue:

  1. brew install podman

  2. podman machine init --disk-size 100 --cpus 4 --memory 4

  3. podman machine start

 $ podman machine start
INFO[0000] waiting for clients...                       
INFO[0000] listening tcp://127.0.0.1:7777               
INFO[0000] new connection from  to /var/folders/bx/gd38cjwd69g74tzf5p042xq40000gn/T/podman/qemu_podman-machine-default.sock 
Waiting for VM ...

Describe the results you received:

Refer above.

Describe the results you expected:

It should not hang forever. It should come out and connect.

Additional information you deem important (e.g. issue happens only occasionally):

Also following commands should do same.

Besides that podman machine stop should stop this zombie machine. It doesn't show anything and doesn't stop. podman machine rm fails too. So there is no way but to restart laptop to reset status of this podman machine.

 $ podman machine ssh
Connecting to vm podman-machine-default. To close connection, use `~.` or `exit`
kex_exchange_identification: Connection closed by remote host
Error: exit status 255

 $ podman system info
Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman. failed to create sshClient: Connection to bastion host (ssh://core@localhost:49261/run/user/1000/podman/podman.sock) failed.: ssh: handshake failed: read tcp [::1]:49822->[::1]:49261: read: connection reset by peer

 $ podman info
Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman. failed to create sshClient: Connection to bastion host (ssh://core@localhost:49261/run/user/1000/podman/podman.sock) failed.: ssh: handshake failed: read tcp [::1]:49826->[::1]:49261: read: connection reset by peer

Output of podman version:

 $ podman version
Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman. failed to create sshClient: Connection to bastion host (ssh://core@localhost:49261/run/user/1000/podman/podman.sock) failed.: ssh: handshake failed: read tcp [::1]:49847->[::1]:49261: read: connection reset by peer

Output of podman info --debug:

 $ podman info --debug
Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman. failed to create sshClient: Connection to bastion host (ssh://core@localhost:49261/run/user/1000/podman/podman.sock) failed.: ssh: handshake failed: read tcp [::1]:49851->[::1]:49261: read: connection reset by peer

Package info (e.g. output of rpm -q podman or apt list podman):

N.A. Mac OS so apm / rpm not there.

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

Mac OS Laptop. Big Sur.

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 5, 2022
@mheon
Copy link
Member

mheon commented Jan 5, 2022

@baude @ashley-cui PTAL

@ashley-cui
Copy link
Member

Are you on a M1 or an intel mac?

@unicman
Copy link
Author

unicman commented Jan 5, 2022 via email

@samhclark
Copy link

Same issue. I can add info about the install though, and confirm it on Podman 3.4.4

$ brew info podman
 podman: stable 3.4.4 (bottled), HEAD
 Tool for managing OCI containers and pods
 https://podman.io/
 /usr/local/Cellar/podman/3.4.4 (170 files, 40MB) *
   Poured from bottle on 2021-12-21 at 12:11:30
 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/podman.rb
 License: Apache-2.0
 ==> Dependencies
 Build: go ✘, go-md2man ✘
 Required: qemu ✔
 ==> Options
 --HEAD
         Install HEAD version
 ==> Caveats
 zsh completions have been installed to:
   /usr/local/share/zsh/site-functions
 ==> Analytics
 install: 11,435 (30 days), 37,387 (90 days), 79,805 (365 days)
 install-on-request: 11,436 (30 days), 37,393 (90 days), 79,798 (365 days)
 build-error: 2 (30 days)

That's on macOS Big Sir (11.5.2) on an Intel Mac.

@unicman unicman changed the title On Mac OS Big Sur podman machine starts but doesn't connect On Mac OS Big Sur & Monterey podman machine starts but doesn't connect Jan 10, 2022
@unicman
Copy link
Author

unicman commented Jan 10, 2022

Over the weekend, upgraded laptop to Monterey to see whether the issue gets fixed.

After upgrading OS, following steps are performed:

brew uninstall podman

rm -fr ~/.config/containers/
rm -fr ~/.local/share/containers/

#### Below command asked again to allow networking changes which are approved.

 $ brew install podman
Running `brew update --preinstall`...
==> Downloading https://ghcr.io/v2/homebrew/core/podman/manifests/3.4.4
Already downloaded: /Users/manishbhandekar/Library/Caches/Homebrew/downloads/d32df84b2cbf85c73570ce5974435a3974d46afa144d092bd21e927847fd7c48--podman-3.4.4.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/podman/blobs/sha256:7e7b2ff7395
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Pouring podman--3.4.4.monterey.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/podman/3.4.4: 170 files, 40MB
==> Running `brew cleanup podman`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).


 $ podman machine ls
NAME        VM TYPE     CREATED     LAST UP     CPUS        MEMORY      DISK SIZE

#### Below command asked for allowing networking changes and they were approved too.

 $ podman machine init --disk-size 100 --cpus 4 --memory 4
Downloading VM image: fedora-coreos-35.20220103.2.0-qemu.x86_64.qcow2.xz: done  
Extracting compressed file
Image resized.

 $ podman machine start
INFO[0000] waiting for clients...                       
INFO[0000] listening tcp://127.0.0.1:7777               
INFO[0000] new connection from  to /var/folders/bx/gd38cjwd69g74tzf5p042xq40000gn/T/podman/qemu_podman-machine-default.sock 
Waiting for VM ...

##### Again podman got hung with same message.

In a separate window executed following command:

 $ podman machine ssh
Connecting to vm podman-machine-default. To close connection, use `~.` or `exit`
kex_exchange_identification: read: Connection reset by peer
Connection reset by ::1 port 51963
Error: exit status 255

#### It failed but after that above podman machine start terminal window showed one error:

 $ podman machine start
INFO[0000] waiting for clients...                       
INFO[0000] listening tcp://127.0.0.1:7777               
INFO[0000] new connection from  to /var/folders/bx/gd38cjwd69g74tzf5p042xq40000gn/T/podman/qemu_podman-machine-default.sock 
Waiting for VM ...
2022/01/10 10:57:02 tcpproxy: for incoming conn [::1]:52054, error dialing "192.168.127.2:22": connect tcp 192.168.127.2:22: no route

It is not clear where did 192.168.127.2 comes from and why the route is not available.

@baude
Copy link
Member

baude commented Jan 10, 2022

are these all upgrades vs clean installs?

@unicman
Copy link
Author

unicman commented Jan 10, 2022

Hi @baude - Mac OS Big Sur to Monterey was upgrade... if you were asking about OS.
As for podman itself... clean install with commands executed above... if you were asking about podman.

@unicman
Copy link
Author

unicman commented Jan 10, 2022

Heads up ... following worked for me:

podman machine init
podman start

It is not clear why it fails if machine is created with following syntax:

podman machine init --disk-size 100 --cpus 4 --memory 4

My laptop has 200GB available. It's i7 quad and 16G memory so should have worked.

But anyway... for now I'm unblocked by using podman machine init.

@unicman unicman closed this as completed Jan 10, 2022
@desilinguist
Copy link

What's interesting is that I have the same issue where it seems to hang at "Waiting for VM" on my M1 MacBook Pro but if I run podman machine ssh in another terminal, I am able to ssh just fine. Very strange.

@chafidz0000000
Copy link

Mine was solved by changing the default podman system connection.
When I run podman system connection list it seems that podman still using my old connection configuration as the default (running using Debian-minimal on VirtualBox, and the virtual machine has been removed a few months ago).
Running podman system connection default podman-machine-default(or whatever the podman machine name you've created) command solved the problem

@desilinguist
Copy link

Thanks @chafidz0000000! I tried the following:

  • Ran podman machine start which "hangs" on "Waiting for VM"
  • Ran podman system connection default podman-machine-default in another terminal.
  • Running podman system connection list shows that the change did take place.

However, the podman machine start command is still hanging even after a restart. Of course, like I said in my previous comment, podman machine ssh does work so it's not like it's not working - just this weird hang.

@rhatdan
Copy link
Member

rhatdan commented Jan 11, 2022

Podman is waiting for output back from qemu, which is it never getting for some reason.

@mithucste30
Copy link

mithucste30 commented Mar 10, 2022

I having this same issue. MacOS monetery 12.2.1, and i am not even able to make ssh.

podman machine ssh
Connecting to vm podman-machine-default. To close connection, use `~.` or `exit`
kex_exchange_identification: read: Connection reset by peer
Connection reset by ::1 port 54852
Error: exit status 255

server log

❯ podman machine start
INFO[0000] waiting for clients...
INFO[0000] listening tcp://127.0.0.1:7777
INFO[0000] new connection from  to /var/folders/h2/ql3p5y_n3_x71xz9vk3xncd40000gn/T/podman/qemu_podman-machine-default.sock
Waiting for VM ...
qemu-system-aarch64: -accel hvf: invalid accelerator hvf
qemu-system-aarch64: falling back to tcg
2022/03/10 12:23:54 tcpproxy: for incoming conn [::1]:49501, error dialing "192.168.127.2:22": connect tcp 192.168.127.2:22: no route

podman info

/opt/homebrew/bin/brew info podman
podman: stable 3.4.4 (bottled), HEAD
Tool for managing OCI containers and pods
https://podman.io/
/opt/homebrew/Cellar/podman/3.4.4 (170 files, 41.0MB) *
  Poured from bottle on 2022-03-10 at 11:56:39
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/podman.rb
License: Apache-2.0
==> Dependencies
Build: go ✘, go-md2man ✘
Required: qemu ✔
==> Options
--HEAD
	Install HEAD version
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Analytics
install: 10,147 (30 days), 37,023 (90 days), 101,448 (365 days)
install-on-request: 10,142 (30 days), 37,011 (90 days), 101,430 (365 days)
build-error: 16 (30 days)

@xsa
Copy link

xsa commented Mar 21, 2022

Experiencing issue here too... Machine doesn't even start. Recently upgrade to macOs Monterey and podman 4.0.2. Temporary folder exists. Tried to reboot, same issue. Thinking there might be some default "forbid connections" policy in macOS. Thoughts anyone?

$ podman machine start
Starting machine "podman-machine-default"
INFO[0000] waiting for clients...                       
ERRO[0000] Error listening on socket: /Users/<my user>/.local/share/containers/podman/machine/podman-machine-default/podman.sock: listen unix /Users/<my user>/.local/share/containers/podman/machine/podman-machine-default/podman.sock: bind: invalid argument 
Error: dial unix /var/folders/2t/z2mhsw3s6tn1zsrzbhsdmgbh0000gn/T/podman/qemu_podman-machine-default.sock: connect: no such file or directory

@n1hility
Copy link
Member

n1hility commented Mar 21, 2022

@mithucste30 @xsa You might be experiencing an incompatible machine (#13510). Try double checking you are on 4.0.2, copy any files off that you want and then try recreating the machine instance (machine rm followed by machine init)

@mithucste30
Copy link

@mithucste30 @xsa You might be experiencing an incompatible machine (#13510). Try double checking you are on 4.0.2, copy any files off that you want and then try recreating the machine instance (machine rm followed by machine init)

I have solved this issue by install coreutils. Not sure why it wasnt installed with brew at first place.

@xsa
Copy link

xsa commented Mar 21, 2022

@mithucste30 @xsa You might be experiencing an incompatible machine (#13510). Try double checking you are on 4.0.2, copy any files off that you want and then try recreating the machine instance (machine rm followed by machine init)

I have solved this issue by install coreutils. Not sure why it wasnt installed with brew at first place.

coreutils is now installed (it wasn't at the time of reporting my problem, but had to install it for something else in the meantime). Unfortunately issue persists with the same error message.

$ brew info coreutils
coreutils: stable 9.0 (bottled), HEAD
[...]

@xsa
Copy link

xsa commented Mar 21, 2022

@mithucste30 @xsa You might be experiencing an incompatible machine (#13510). Try double checking you are on 4.0.2, copy any files off that you want and then try recreating the machine instance (machine rm followed by machine init)

Thanks @n1hility - I'm indeed on 4.0.2, and had already performed the steps you advised before posting my issue. Still no dice.

@n1hility
Copy link
Member

n1hility commented Mar 21, 2022

@xsa can you check the following:

  1. Does /Users/<my user>/.local/share/containers/podman/machine/podman-machine-default/ exist?
  2. Is there any stale qemu processes running (e.g. ps -ef | grep qemu)
  3. When you do a podman machine rm; podman machine init, do you get any errors there, or is it successful?
  4. When you run podman machine start and get the EINVAL, is there a qemu process running afterwords?

@xsa
Copy link

xsa commented Mar 22, 2022

@n1hility

@xsa can you check the following:

1. Does `/Users/<my user>/.local/share/containers/podman/machine/podman-machine-default/` exist?

Yes.

2. Is there any stale qemu processes running (e.g. ps -ef | grep qemu)

No.

3. When you do a podman machine rm; podman machine init, do you get any errors there, or is it successful?

No errors. All successful.

4. When you run podman machine start and get the EINVAL, is there a qemu process running afterwords?

Nope.

@baude
Copy link
Member

baude commented Mar 22, 2022

my assumption is also you have rm'd the machine at least once and done a new init? If so, can you provide the output from podman --log-level=debug <your_command>. Perhaps it will reveal something.

@xsa
Copy link

xsa commented Mar 22, 2022

my assumption is also you have rm'd the machine at least once and done a new init? If so, can you provide the output from podman --log-level=debug <your_command>. Perhaps it will reveal something.

Correct @baude -- And here's the output you asked.

$ podman --log-level=debug machine start
INFO[0000] podman filtering at log level debug          
DEBU[0000] [/usr/local/bin/qemu-system-x86_64 -m 2048 -smp 1 -fw_cfg name=opt/com.coreos/config,file=/Users/<my user>/.config/containers/podman/machine/qemu/podman-machine-default.ign -qmp unix://var/folders/2t/z2mhsw3s6tn1zsrzbhsdmgbh0000gn/T/podman/qmp_podman-machine-default.sock,server=on,wait=off -netdev socket,id=vlan,fd=3 -device virtio-net-pci,netdev=vlan,mac=5a:94:ef:e4:0c:ee -device virtio-serial -chardev socket,path=/var/folders/2t/z2mhsw3s6tn1zsrzbhsdmgbh0000gn/T/podman/podman-machine-default_ready.sock,server=on,wait=off,id=podman-machine-default_ready -device virtserialport,chardev=podman-machine-default_ready,name=org.fedoraproject.port.0 -machine q35,accel=hvf:tcg -cpu host -drive if=virtio,file=/Users/<my user>/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-35.20220305.dev.0-qemu.x86_64.qcow2] 
DEBU[0000] [/usr/local/bin/qemu-system-x86_64 -m 2048 -smp 1 -fw_cfg name=opt/com.coreos/config,file=/Users/<my user>/.config/containers/podman/machine/qemu/podman-machine-default.ign -qmp unix://var/folders/2t/z2mhsw3s6tn1zsrzbhsdmgbh0000gn/T/podman/qmp_podman-machine-default.sock,server=on,wait=off -netdev socket,id=vlan,fd=3 -device virtio-net-pci,netdev=vlan,mac=5a:94:ef:e4:0c:ee -device virtio-serial -chardev socket,path=/var/folders/2t/z2mhsw3s6tn1zsrzbhsdmgbh0000gn/T/podman/podman-machine-default_ready.sock,server=on,wait=off,id=podman-machine-default_ready -device virtserialport,chardev=podman-machine-default_ready,name=org.fedoraproject.port.0 -machine q35,accel=hvf:tcg -cpu host -drive if=virtio,file=/Users/<my user>/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-35.20220305.dev.0-qemu.x86_64.qcow2] 
Starting machine "podman-machine-default"
[/usr/local/opt/podman/libexec/gvproxy -listen-qemu unix:///var/folders/2t/z2mhsw3s6tn1zsrzbhsdmgbh0000gn/T/podman/qemu_podman-machine-default.sock -pid-file /var/folders/2t/z2mhsw3s6tn1zsrzbhsdmgbh0000gn/T/podman/podman-machine-default.pid -ssh-port 56105 -forward-sock /Users/<my user>/.local/share/containers/podman/machine/podman-machine-default/podman.sock -forward-dest /run/user/501/podman/podman.sock -forward-user core -forward-identity /Users/<my user>/.ssh/podman-machine-default --debug]
DEBU[0000] Using search domains: [emea.xxx.com xxx.com xxxx.com xxxxx.com xxxxxx.com xxxxx.com] 
INFO[0000] waiting for clients...                       
ERRO[0000] Error listening on socket: /Users/<my user>/.local/share/containers/podman/machine/podman-machine-default/podman.sock: listen unix /Users/<my user>/.local/share/containers/podman/machine/podman-machine-default/podman.sock: bind: invalid argument 
Error: dial unix /var/folders/2t/z2mhsw3s6tn1zsrzbhsdmgbh0000gn/T/podman/qemu_podman-machine-default.sock: connect: no such file or directory

@baude
Copy link
Member

baude commented Mar 22, 2022

@xsa ok, two ideas ... just to confirm, are you on an Intel Mac? Second, can you gert onto libera irc and join #podman? maybe we can figure some things out?

@xsa
Copy link

xsa commented Mar 22, 2022

@xsa ok, two ideas ... just to confirm, are you on an Intel Mac? Second, can you gert onto libera irc and join #podman? maybe we can figure some things out?

Correct, MacBook Air (Retina, 13-inch, 2019) 1.6 GHz Dual-Core Intel Core i5. I'm not on libera irc but I can join. Meet you there.

@carljmosca
Copy link
Contributor

was seeing same on M1...uninstalled and reinstalled and now getting this:

Error: dial unix /var/folders/l8/h2xpqsn1385dzpl58_cz84zh0000gn/T/podman/podman-machine-default_ready.sock: connect: connection refused
ERRO[0003] cannot receive packets from , disconnecting: cannot read size from socket: EOF
ERRO[0003] cannot read size from socket: EOF

any additional cleanup needed in addition to this from above?

rm -fr ~/.config/containers/ rm -fr ~/.local/share/containers/

@baude
Copy link
Member

baude commented Mar 31, 2022

carl, i think you might be exceeding the max length of filenames for sockets in macos... can you try:

podman machine init test podman machine start test
`
and see if this is any better?

@carljmosca
Copy link
Contributor

Thank you for the suggestion Brent; that got me going again on the M1.

Will try on an Intel Mac a bit later. Did not realize I could name the machine (guess if I had looked at the usage that would have been obvious). :)

baude added a commit to baude/podman that referenced this issue Apr 1, 2022
to avoid errors on macos, we use symlinks to long socket names.

Fixes: containers#12751
Fixes: containers#13609

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
baude added a commit to baude/podman that referenced this issue Apr 1, 2022
to avoid errors on macos, we use symlinks to long socket names.

Fixes: containers#12751
Fixes: containers#13609

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
baude added a commit to baude/podman that referenced this issue Apr 1, 2022
to avoid errors on macos, we use symlinks to long socket names.

Fixes: containers#12751
Fixes: containers#13609

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
baude added a commit to baude/podman that referenced this issue Apr 1, 2022
to avoid errors on macos, we use symlinks to long socket names.

Fixes: containers#12751
Fixes: containers#13609

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
baude added a commit to baude/podman that referenced this issue Apr 4, 2022
to avoid errors on macos, we use symlinks to long socket names.

Fixes: containers#12751
Fixes: containers#13609

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
baude added a commit to baude/podman that referenced this issue Apr 4, 2022
to avoid errors on macos, we use symlinks to long socket names.

Fixes: containers#12751
Fixes: containers#13609

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
baude added a commit to baude/podman that referenced this issue Apr 5, 2022
to avoid errors on macos, we use symlinks to long socket names.

Fixes: containers#12751
Fixes: containers#13609

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
baude added a commit to baude/podman that referenced this issue Apr 6, 2022
to avoid errors on macos, we use symlinks to long socket names.

Fixes: containers#12751
Fixes: containers#13609

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
gbraad pushed a commit to gbraad-redhat/podman that referenced this issue Jul 13, 2022
to avoid errors on macos, we use symlinks to long socket names.

Fixes: containers#12751
Fixes: containers#13609

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
@vallamost
Copy link

vallamost commented Jul 20, 2022

I'm having similar issues as a new user of Podman. I can't get a clean socket connection. Using an Intel Mac with Monterey.

╰─ian@macbook$ podman machine start test
Starting machine "test"
Waiting for VM ...
Mounting volume... /Users/gxdt:/Users/gxdt

This machine is currently configured in rootless mode. If your containers
require root permissions (e.g. ports < 1024), or if you run into compatibility
issues with non-podman clients, you can switch using the following command:

	podman machine set --rootful test

API forwarding listening on: /var/run/docker.sock
Docker API clients default to this address. You do not need to set DOCKER_HOST.

Machine "test" started successfully

╭─√ [~]
╰─ian@macbook$ podman ps
Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman. failed to create sshClient: connection to bastion host (ssh://core@localhost:65464/run/user/506/podman/podman.sock) failed: dial tcp [::1]:65464: connect: connection refused

╰─ian@macbook$ podman restart --all
Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman. failed to create sshClient: connection to bastion host (ssh://core@localhost:65464/run/user/506/podman/podman.sock) failed: dial tcp [::1]:65464: connect: connection refused

╭─Exit code: 125 [~]
╰─ian@macbook$ podman system connection list
Name                         URI                                                         Identity                                 Default
podman-machine-default       ssh://core@localhost:65464/run/user/506/podman/podman.sock  /Users/gxdt/.ssh/podman-machine-default  true
podman-machine-default-root  ssh://root@localhost:65464/run/podman/podman.sock           /Users/gxdt/.ssh/podman-machine-default  false
test                         ssh://core@localhost:49451/run/user/506/podman/podman.sock  /Users/gxdt/.ssh/test                    false
test-root                    ssh://root@localhost:49451/run/podman/podman.sock           /Users/gxdt/.ssh/test                    false

╰─ian@macbook$ podman machine list
NAME                     VM TYPE     CREATED         LAST UP            CPUS        MEMORY      DISK SIZE
test                     qemu        5 minutes ago   Currently running  1           2.147GB     107.4GB
podman-machine-default*  qemu        15 minutes ago  12 minutes ago     1           2.147GB     107.4GB

╭─√ [~]
╰─ian@macbook$

@Joerg-Schoemer
Copy link

Joerg-Schoemer commented Aug 4, 2022

the --memory takes MB so you've to set --memory 4096 for 4 GB

@Joerg-Schoemer
Copy link

Heads up ... following worked for me:

podman machine init
podman start

It is not clear why it fails if machine is created with following syntax:

podman machine init --disk-size 100 --cpus 4 --memory 4

My laptop has 200GB available. It's i7 quad and 16G memory so should have worked.

But anyway... for now I'm unblocked by using podman machine init.

the --memory takes MB so you've to set --memory 4096 for 4 GB

@swapzero
Copy link

swapzero commented Aug 24, 2022

In case somebody is still interested (Monterey 12.5.1):

So, I had the same problem and what I did to fix it was to use --log-level=debug while bringing up the default machine and then just copied the ssh command, added a -v and ran the command to see what's going on. Well, I figured out that ssh was trying keys from the ssh agent eventually leading to failure...so I brutally cleaned all identities from the agent and it all started to work again.

@just4id
Copy link

just4id commented Oct 14, 2022

Met the same issue on Monterey 12.6, brew info podman: podman: stable 4.2.1 (bottled), HEAD.
While podman machine rm the old vm and then init & start new VM, the issue disappeared.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 12, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.