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

podman cannot connect on macos m1 install #17893

Closed
theganyo opened this issue Mar 22, 2023 · 9 comments · Fixed by #18388
Closed

podman cannot connect on macos m1 install #17893

theganyo opened this issue Mar 22, 2023 · 9 comments · Fixed by #18388
Assignees
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. machine macos MacOS (OSX) related

Comments

@theganyo
Copy link

Issue Description

Can install, init, and start podman machine, but cannot connect. Error is:

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 socket: Get "http://d/v4.3.1/libpod/_ping": ssh: rejected: connect failed (open failed)

Steps to reproduce the issue

$ podman machine init
Extracting compressed file
Image resized.
Machine init complete
To start your machine run:

	podman machine start

$ podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users/theganyo:/Users/theganyo
Error: invalid configuration: the specified mapping 100000:1000000 in "/etc/subuid" includes the user UID
Error: invalid configuration: the specified mapping 100000:1000000 in "/etc/subuid" includes the user UID
WARN[0038] API socket failed ping test

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

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

Machine "podman-machine-default" started successfully

$ 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 socket: Get "http://d/v4.3.1/libpod/_ping": ssh: rejected: connect failed (open failed)

Describe the results you received

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 socket: Get "http://d/v4.3.1/libpod/_ping": ssh: rejected: connect failed (open failed)

Describe the results you expected

Print information about podman containers.

podman info output

podman version 4.3.1
Macos version 13.2.1
Apple M1 Pro

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

Additional environment details

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

@theganyo theganyo added the kind/bug Categorizes issue or PR as related to a bug. label Mar 22, 2023
@Luap99
Copy link
Member

Luap99 commented Mar 23, 2023

Error: invalid configuration: the specified mapping 100000:1000000 in "/etc/subuid" includes the user UID

Sounds like this is causing the problem. Does podman machine ssh work when the machine is running?

Also what is your user ID on macos?

@Luap99 Luap99 added machine macos MacOS (OSX) related labels Mar 23, 2023
@theganyo
Copy link
Author

Yes, I can ssh in, although I do get the config error:

$ podman machine ssh
Connecting to vm podman-machine-default. To close connection, use `~.` or `exit`
Fedora CoreOS 37.20230303.2.0
Tracker: https://github.com/coreos/fedora-coreos-tracker
Discuss: https://discussion.fedoraproject.org/tag/coreos

Last login: Wed Mar 22 11:35:57 2023 from 192.168.127.1
Error: invalid configuration: the specified mapping 100000:1000000 in "/etc/subuid" includes the user UID

Note: The /etc/subuid only exists on the podman machine.

My userid on my host laptop is theganyo (uid: 434053). Seems unrelated.

@Luap99
Copy link
Member

Luap99 commented Mar 23, 2023

My userid on my host laptop is theganyo (uid: 434053). Seems unrelated.

This is definitely the issue then. The VM setup keeps your uid in the VM the same so the user in the VM also has the id 434053 and this uid is in the range 100000-1100000 so it will not work.

Our VM ignition setup should be smart enough to exclude the user UID from that range or choose another range to fix this issue.
For now you could edit /etc/subuid and /etc/subuid to use 434054:1000000 as range instead

cc @baude @ashley-cui

@theganyo
Copy link
Author

Very interesting!

So how can I edit /etc/subuid? core doesn't have permissions and I can't find information about the su password.

@Luap99
Copy link
Member

Luap99 commented Mar 23, 2023

sudo should work without password

@theganyo
Copy link
Author

Excellent, this works. Thank you so much!

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Apr 24, 2023

@baude @ashley-cui Is this something you intend to fix?

@ashley-cui
Copy link
Member

I'll give it a stab this week

@ashley-cui ashley-cui self-assigned this Apr 24, 2023
@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 Aug 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 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. machine macos MacOS (OSX) related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants