utmapp / UTM

Virtual machines for iOS and macOS
https://getutm.app
Apache License 2.0
26.39k stars 1.32k forks source link

Guest OS does not fully boot, black screen occurs after selecting kernel, subsequent reboots fail to get past EFI/BIOS #2359

Closed milosivanovic closed 3 years ago

milosivanovic commented 3 years ago

Describe the issue There are two stages to this issue.

Stage 1 "install and boot the OS":

  1. Successfully install an OS like Kali Linux (no errors occur during installation process)
  2. Reboot when prompted to complete installation
  3. Spam ESC key to bypass boot select problem with UTM 2.0.22
  4. Select "kali" as it's shown: Screen Shot 2021-03-03 at 9 35 50 PM
  5. GRUB screen is shown, choose kernel and press Enter
  6. Be presented with the following screen for about 10 seconds: Screen Shot 2021-03-03 at 9 18 10 PM
  7. Get a completely blank screen afterwards, no noticable CPU usage

Result: Unable to boot the OS and/or have anything shown on the display.

Stage 2 "reboot installed OS": Naturally after the Stage 1 issue, the first instinct is to reboot and try the boot again:

  1. Initiate a reboot using the UTM UI
  2. Spam ESC key once again to bypass boot select problem with UTM 2.0.22
  3. "kali" option is gone despite nothing changing, only "UEFI Misc Device" entries are shown
  4. Choose any selection (other than PXE, EFI Internal Shell or the USB installation disc) results in an instant "refresh" of the current screen (i.e. does nothing)

Result: Cannot get back to Stage 1 until selecting the USB installation disc in the boot selector and redoing the entire installation to be able to boot the OS up to the length of Stage 1 without getting past the black screen issue, and subsequent reboots results in another Stage 2 issue

Configuration

Crash log No crash

Debug log

Running:  -L /Applications/UTM.app/Contents/Resources/qemu -S -qmp tcp:127.0.0.1:4000,server,nowait -vga none -spice port=4001,addr=127.0.0.1,disable-ticketing,image-compression=off,playback-compression=off,streaming-video=off -device virtio-ramfb -cpu cortex-a72 -smp cpus=8,sockets=1,cores=8,threads=1 -machine virt,highmem=off -accel hvf -accel tcg,tb-size=256 -bios /Applications/UTM.app/Contents/Resources/qemu/edk2-aarch64-code.fd -boot order=d -m 1024 -device intel-hda -device hda-duplex -name "Kali Linux arm64" -device qemu-xhci -device usb-tablet -device usb-mouse -device usb-kbd -device usb-storage,drive=drive0,removable=true -drive if=none,media=cdrom,id=drive0 -drive "if=virtio,media=disk,id=drive1,file=/Users/milos/Library/Containers/com.utmapp.UTM/Data/Documents/Kali Linux arm64.utm/Images/disk-0.qcow2,cache=writethrough" -device virtio-net-pci,netdev=net0 -netdev user,id=net0 -uuid 5E585FD9-5904-4451-92C0-FB08F6FFFEF8 -rtc base=localtime
Assertion failed: (isv), function hvf_vcpu_exec, file ../target/arm/hvf/hvf.c, line 727.

Upload VM config.plist.txt

osy commented 3 years ago

From the log, it seems like there's a problem in QEMU. Do you know if it's possible to run your configuration in QEMU without issue?

milosivanovic commented 3 years ago

It's just a basic arm64 virtual machine with 1GB RAM. There were no special changes to the config; I just followed the instructions from https://mac.getutm.app/gallery/ubuntu-20-04 on how to create a virtual machine. The ISO used was: https://cdimage.kali.org/kali-2021.1/kali-linux-2021.1-installer-arm64.iso

Is there something else leading you to believe that this is an abnormal setup?

osy commented 3 years ago

No but it may be broken in QEMU as well. If it doesn’t work in QEMU command line, then there isn’t anything I can do.

milosivanovic commented 3 years ago

Yeah, that makes sense. I did find the assertion failure odd considering I would have expected it to crash when that happened. Perhaps QEMU did crash but UTM ignored that, hence the black screen? It still may not explain the boot item disappearing on subsequent reboots.

On a more general note, is there any chance you have an Apple Silicon device that you could test on? Or do you have a suggestion for me to try any other kind of virtual machine configuration? I am guessing It must be working for most people otherwise there would be more reports of this, which makes me wonder if it's somehow due to my environment but I can't pinpoint what that could possibly be. I am running UTM on an M1 MacBook Air with 8GB RAM.

conath commented 3 years ago

The kali option disappearing from the boot menu is because QEMU doesn't store EFI Variables between sessions, unless you specify an EFI VARS image. See https://github.com/utmapp/UTM/issues/2607#issuecomment-863023800 for a workaround. Closing as duplicate of #2503