Skip to content
New issue

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

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

Already on GitHub? # to your account

Reduce the memory to <= 3 GiB, when QEMU >= 7.0 && macOS <= 12.3 && CPU == M1 #795

Closed
AkihiroSuda opened this issue Apr 13, 2022 · 5 comments · Fixed by #796
Closed

Reduce the memory to <= 3 GiB, when QEMU >= 7.0 && macOS <= 12.3 && CPU == M1 #795

AkihiroSuda opened this issue Apr 13, 2022 · 5 comments · Fixed by #796

Comments

@AkihiroSuda
Copy link
Member

AkihiroSuda commented Apr 13, 2022

QEMU 7.0 beta is known to cause host kernel panic on M1 (Prox/Max only?) when the guest memory exceeds 3GiB limit, but the host kernel panic is reported to be fixed in macOS 12.4 beta

https://gitlab.com/qemu-project/qemu/-/issues/903#note_911000975

But not all people can upgrade macOS immediately, so probably we should reduce the default memory to 3GiB when QEMU >= 7.0 && macOS <= 12.3 && CPU == M1 .

@AkihiroSuda AkihiroSuda added this to the v0.10.0 milestone Apr 13, 2022
@AkihiroSuda AkihiroSuda changed the title Reduce the default memory to 2GiB, when QEMU >= 7.0 && macOS <= 12.3 && CPU == M1 Reduce the memory to < 4 GiB, when QEMU >= 7.0 && macOS <= 12.3 && CPU == M1 Apr 14, 2022
@AkihiroSuda AkihiroSuda changed the title Reduce the memory to < 4 GiB, when QEMU >= 7.0 && macOS <= 12.3 && CPU == M1 Reduce the memory to <= 3 GiB, when QEMU >= 7.0 && macOS <= 12.3 && CPU == M1 Apr 25, 2022
@jbreiding
Copy link

jbreiding commented May 24, 2022

Is this still present in qemu 7.0.0 release?

Perhaps there is a better way to detect this state than just the version?

message from latest update of qemu today

> msg="[hostagent] Reducing the guest memory from 32GiB to 3GiB, to avoid host kernel panic on macOS <= 12.3 with QEMU >= 7.0; Please update macOS to 12.4 or later, or downgrade QEMU to 6.2; See https://github.com/lima-vm/lima/issues/795 for the further background."

lima info

lima: stable 0.11.0 (bottled), HEAD
Linux virtual machines
https://github.com/lima-vm/lima
/opt/homebrew/Cellar/lima/0.11.0 (52 files, 32.5MB) *
  Poured from bottle on 2022-05-23 at 07:52:52
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/lima.rb
License: Apache-2.0
==> Dependencies
Build: go ✔
Required: qemu ✔
==> Options
--HEAD
	Install HEAD version
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Analytics
install: 21,937 (30 days), 61,655 (90 days), 121,719 (365 days)
install-on-request: 14,230 (30 days), 39,715 (90 days), 82,143 (365 days)
build-error: 5 (30 days)

qemu info

qemu: stable 7.0.0 (bottled), HEAD
Emulator for x86 and PowerPC
https://www.qemu.org/
/opt/homebrew/Cellar/qemu/7.0.0 (162 files, 610.7MB) *
  Poured from bottle on 2022-05-24 at 10:06:28
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/qemu.rb
License: GPL-2.0-only
==> Dependencies
Build: libtool ✔, meson ✘, ninja ✘, pkg-config ✔
Required: glib ✔, gnutls ✔, jpeg ✔, libpng ✔, libslirp ✔, libssh ✔, libusb ✔, lzo ✔, ncurses ✔, nettle ✔, pixman ✔, snappy ✔, vde ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 33,340 (30 days), 133,221 (90 days), 378,036 (365 days)
install-on-request: 19,772 (30 days), 83,625 (90 days), 249,804 (365 days)
build-error: 57 (30 days)

@jbreiding
Copy link

Okay, upgrading my os the 12.4 seems to have made the error go away.

Apologies

@bguyza
Copy link

bguyza commented Jun 6, 2022

How do I go about downgrading qemu?

@Amar1729
Copy link

Amar1729 commented Jun 6, 2022

@bguyza there is no easy way to downgrade via homebrew anymore - you could (1) create your own tap or (2) brew install the specific qemu.rb file you want from homebrew's git history

  1. something like (you'll have to find correct version):
brew tap-new bguyza/local-qemu
brew extract --version=6.x qemu bguyza/local-qemu
brew install qemu@6.x
brew unlink qemu
brew link --overwrite qemu@6.x

@pwillis-eiq
Copy link

pwillis-eiq commented Jul 14, 2022

Thanks @Amar1729 that Podman issue fix worked for me! However I had to do the following:

$ curl -L -H "Authorization: Bearer QQ==" -o qemu-6.2.0_1.monterey.bottle.tar.gz https://ghcr.io/v2/homebrew/core/qemu/blobs/sha256:fcc3b1a8139f70dae57f5449f3856f9b3b67448ee0623e64da1e47dc255b46f6
$ while brew list qemu ; do brew uninstall qemu ; done
$ HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --ignore-dependencies -f qemu-6.2.0_1.monterey.bottle.tar.gz lima

Otherwise 1) new versions of qemu would not allow linking the 6.2 version, 2) qemu would auto-upgrade to v7 (the environment variable fixes it), and 3) lima dependencies would auto-upgrade qemu to v7 (--ignore-dependencies fixes it).

What a huge pain, just because Homebrew became a nanny state.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants