lima-vm / lima

Linux virtual machines, with a focus on running containers
https://lima-vm.io/
Apache License 2.0
15.39k stars 604 forks source link

Ubuntu Jammy VMs freezing on an Apple M1 Pro specifically MacBookPro18,1 #2039

Open nemonik opened 11 months ago

nemonik commented 11 months ago

Description

Over the past 3 or so months I am seeing increasing freezes in my Ubuntu Jammu JellyFish VMs.

➜  cat lima.yaml
# ===================================================================== #
# BASIC CONFIGURATION
# ===================================================================== #

# Default values in this YAML file are specified by `null` instead of Lima's "builtin default" values,
# so they can be overridden by the $LIMA_HOME/_config/default.yaml mechanism documented at the end of this file.

# Arch: "default", "x86_64", "aarch64".
# 🟢 Builtin default: "default" (corresponds to the host architecture)
arch: null
# OpenStack-compatible disk image.
# 🟢 Builtin default: null (must be specified)
# 🔵 This file: Ubuntu 22.04 Jammy Jellyfish images
images:
  # Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months.
  - location: "https://cloud-images.ubuntu.com/releases/22.04/release-20220712/ubuntu-22.04-server-cloudimg-amd64.img"
    arch: "x86_64"
    digest: "sha256:86481acb9dbd62e3e93b49eb19a40c66c8aa07f07eff10af20ddf355a317e29f"
  - location: "https://cloud-images.ubuntu.com/releases/22.04/release-20220712/ubuntu-22.04-server-cloudimg-arm64.img"
    arch: "aarch64"
    digest: "sha256:e1ce033239f0038dca5ef09e582762ba0d0dfdedc1d329bc51bb0e9f5057af9d"
  # Fallback to the latest release image.
  # Hint: run `limactl prune` to invalidate the cache
  - location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img"
    arch: "x86_64"
  - location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-arm64.img"
    arch: "aarch64"
# CPUs: if you see performance issues, try limiting cpus to 1.
# 🟢 Builtin default: 4
cpus: null
# Memory size
# 🟢 Builtin default: "4GiB"
memory: null
# Disk size
# 🟢 Builtin default: "100GiB"
disk: "150GiB"

I'm install lima via brew and keeping it updated.

Opening a new shell in instance just stalls.

Is there anything I can do to reduce or collect logging or ascertain the root cause.

I typically have to kill the underlying qemu process to recover from and restart the VM.

nemonik commented 11 months ago

I'm going to try 1 CPU versus the default.

vasileknik76 commented 11 months ago

The logs are located in ~/.lima/<vmName>/. Please attach them

nemonik commented 11 months ago

Thank you, will do the next time a crash happens... It has been stable since I reconfigured to one cpu, but I am wondering if it was when I was using the VM to run a multi-architecture docker buildx builder that was causing the problem... OS X running qemu running ubuntu running docker running a builder container running qemu to build a container... Inception.

EdwardMoyse commented 11 months ago

I wonder if this is related to #1957?

Since I took a newer-than-0.18 version of Lima (with brew install lima --HEAD), and updated to the latest kernel, my AlmaLinux9 VM has been rock solid.