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

[macOS] podman machine start fails with the error message "qemu-system-x86_64: CPU model 'host' requires KVM" #10555

Closed
tnk4on opened this issue Jun 4, 2021 · 9 comments
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.

Comments

@tnk4on
Copy link
Contributor

tnk4on commented Jun 4, 2021

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

/kind bug

Description

On macOS, when I run podman machine init and then podman machine start, I get an error message "qemu-system-x86_64: CPU model 'host' requires KVM" and the VM fails to start.

Steps to reproduce the issue:

On the Mac client:

  1. Run "podman machine init".
$ ./podman machine init test
Extracting compressed file
  1. Run "podman machine start", it will stop with an error.
$ ./podman machine start test
Waiting for VM ...
qemu-system-x86_64: CPU model 'host' requires KVM
Error: dial unix /var/folders/df/vy1htn753fd_w4420rltfg0w0000gn/T/podman/test_ready.sock: connect: connection refused

Describe the results you received:

$ ./podman machine start test
Waiting for VM ...
qemu-system-x86_64: CPU model 'host' requires KVM
Error: dial unix /var/folders/df/vy1htn753fd_w4420rltfg0w0000gn/T/podman/test_ready.sock: connect: connection refused

Describe the results you expected:

The VM will be successfully started.

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

Output of podman version:

$ ./podman --version
podman version 3.2.0

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

podman

https://github.com/containers/podman/releases/download/v3.2.0/podman-remote-release-darwin.zip

qemu

$ qemu-system-x86_64 --version
QEMU emulator version 6.0.0
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
$ brew info qemu
qemu: stable 6.0.0 (bottled), HEAD
Emulator for x86 and PowerPC
https://www.qemu.org/
/usr/local/Cellar/qemu/6.0.0 (161 files, 573MB) *
  Poured from bottle on 2021-06-04 at 11:21:31
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/qemu.rb
License: GPL-2.0-only

VM image

$ ls ~/.local/share/containers/podman/machine/qemu/*.qcow2.xz |xargs basename
fedora-coreos-34.20210529.1.0-qemu.x86_64.qcow2.xz

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.):

  • MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)
  • macOS Big Sur Version 11.3.1 (20E241) Updated to 11.4
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 4, 2021
@tnk4on
Copy link
Contributor Author

tnk4on commented Jun 4, 2021

I was able to start the VM by adding the QEMU option.

$ vi ~/.config/containers/podman/machine/qemu/test.json`

  "-accel",
  "hvf",
$ ./podman machine start test
Waiting for VM ...
$ ./podman machine list
NAME        VM TYPE     CREATED         LAST UP
test        qemu        33 seconds ago  Currently running

Hypervisor.framework is supported on macOS

$ sysctl -a | grep kern.hv_support
kern.hv_support: 1

@afbjorklund
Copy link
Contributor

afbjorklund commented Jun 5, 2021

For some reason it is only added on arm64, but not on amd64:
pkg/machine/qemu/options_darwin_arm64.go: "-accel", "hvf",
pkg/machine/qemu/options_linux_amd64.go: "-accel", "kvm",
pkg/machine/qemu/options_linux_arm64.go: "-accel", "kvm",

Note: this was in v3.2.0

@mheon
Copy link
Member

mheon commented Jun 6, 2021

@baude PTAL

@rhatdan
Copy link
Member

rhatdan commented Jun 6, 2021

@ashley-cui PTAL also.

@baude
Copy link
Member

baude commented Jun 7, 2021

distribution information and qemu version ?

@tnk4on
Copy link
Contributor Author

tnk4on commented Jun 7, 2021

I've added the information to the top comments.

  • VM image: FCOS 34.20210529.1.0
  • QEMU : v6.0.0

@baude
Copy link
Member

baude commented Jun 7, 2021

Ok, thank you. We were testing with version 5.0. I will try v6.0 and report back.

baude added a commit to baude/podman that referenced this issue Jun 8, 2021
On intel macs, we need to accel=hvf to work correctly.

Fixes: containers#10555

[NO TESTS NEEDED]

Signed-off-by: Brent Baude <[email protected]>
@ashley-cui
Copy link
Member

closed via #10605

@tnk4on
Copy link
Contributor Author

tnk4on commented Jun 15, 2021

I've got v3.2.1 working fine. Also, #10578 seems to have been fixed.
Thanks!

@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 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

No branches or pull requests

6 participants