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

QEMU Error Initializing Podman on M1 Mac - 'qemu exited unexpectedly with exit code -1' #16262

Closed
CCranney opened this issue Oct 22, 2022 · 7 comments
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

Comments

@CCranney
Copy link

CCranney commented Oct 22, 2022

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

/kind bug

Description

I am trying to initialize a podman machine/container, but it fails at podman machine start. I have a 2021 Mac Pro with an M1 Max chip.

Steps to reproduce the issue:

  1. Install podman: brew install podman

  2. Initialize with podman machine init
    Which has the following output:

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

	podman machine start
  1. Then I try to run the machine with podman machine start

Describe the results you received:
Running the above creates the following error:

Starting machine "podman-machine-default"
Waiting for VM ...
Error: qemu exited unexpectedly with exit code -1, stderr: qemu-system-x86_64: Unknown Error

Describe the results you expected:
The podman machine to successfully start.

Additional information you deem important (e.g. issue happens only occasionally):
I ran through the various solutions detailed in issue #14303 to no avail. None of those users indicated this specific error, and can't find an instance of anyone encountering this error aside from this stack overflow post.

I'm not seeing anybody post this error on the qemu issue page, and thought I would start with making an issue here.

Output of podman version:

Error: failed to connect: dial tcp [::1]:50544: connect: connection refused

I followed up with podman --version:

podman version 4.3.0

Output of podman info:

Error: failed to connect: dial tcp [::1]:50544: connect: connection refused

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

==> podman: stable 4.3.0 (bottled), HEAD
Tool for managing OCI containers and pods
https://podman.io/
/usr/local/Cellar/podman/4.3.0 (185 files, 48MB) *
  Poured from bottle on 2022-10-22 at 12:23:21
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/podman.rb
License: Apache-2.0 and GPL-3.0-or-later
==> Dependencies
Build: go-md2man ✔, [email protected] ✔
Required: qemu ✔
==> Options
--HEAD
	Install HEAD version
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions

To restart podman after an upgrade:
  brew services restart podman
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/podman/bin/podman system service --time=0
==> Analytics
install: 20,623 (30 days), 67,681 (90 days), 214,865 (365 days)
install-on-request: 19,782 (30 days), 65,646 (90 days), 212,430 (365 days)
build-error: 0 (30 days)

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

Yes

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

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 22, 2022
@CCranney CCranney changed the title QEMU Error on M1 Mac - 'qemu exited unexpectedly with exit code -1' QEMU Error Initializing Podman on M1 Mac - 'qemu exited unexpectedly with exit code -1' Oct 22, 2022
@Luap99
Copy link
Member

Luap99 commented Oct 24, 2022

What MacOS and qemu versions are you using?
@baude @ashley-cui PTAL

@Luap99 Luap99 added the machine label Oct 24, 2022
@ashley-cui
Copy link
Member

This looks like a Rosettta issue. Please make sure you are not using Rosetta with your Homebrew install.

@CCranney
Copy link
Author

MacOS: macOS Monterey 12.5 with an M1 Max chip.
qemu: 7.1.0

Near as I can tell I do use Rosetta in my Homebrew install. I'm not sure exactly which website I used to do that setup when I first got this computer, but it's akin to the instructions found here. I installed podman using my duplicate Rosetta-Terminal application.

@ashley-cui
Copy link
Member

Using Rosetta with Podman will not work on M1.

@CCranney
Copy link
Author

Ah, sorry I misread your comment. I will look into re-installing Homebrew, though my initial attempts are not going well. I believe I've managed to get docker running appropriately for my current needs, so won't be working on this as directly as before, so will close this comment. If I come back to this and run into errors even after a new Homebrew installation I'll reopen the issue.

@mehemken
Copy link

mehemken commented Jan 28, 2023

This looks like a Rosettta issue. Please make sure you are not using Rosetta with your Homebrew install.

Is there a command that tells me if my homebrew is using Rosetta? I found an article that says upgrading brew should do it. So I did:

podman machine rm
brew uninstall podman
brew update
brew upgrade
brew install podman
podman machine init

and finally:

❯ podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Error: qemu exited unexpectedly with exit code -1, stderr: qemu-system-x86_64: Unknown Error

In my humble opinion this issue should be reopened. The instructions still do not work for M1 silicon. If there is a workaround, it should be clearly noted on the installation page.


EDIT:

I followed the instructions in this youtube video to uninstall Rosetta. Also had to uninstall/reinstall Homebrew and all the things I had already installed with brew. Then I tried the instructions again and podman machine started up successfully. I'm so happy. I've been trying to do that for two years.

@steezeburger
Copy link

steezeburger commented Apr 21, 2023

I didn't uninstall Rosetta, but I did have to uninstall and reinstall brew :/

# make backup list of brew apps
brew bundle dump

# uninstall brew
PATH=/usr/local/bin:$PATH arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

# ensure arm terminal
env /usr/bin/arch -arm64 /bin/zsh --login

# reinstall brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# install previous packages from bundle dump
brew bundle install --file=/path/to/Brewfile

@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 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 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
Projects
None yet
Development

No branches or pull requests

5 participants