utmapp / UTM

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

Linux fails to boot in QEMU VMs when UTM is installed by Nix #6725

Closed Enzime closed 2 weeks ago

Enzime commented 1 month ago

Describe the issue

When I install UTM through Nix and then create a QEMU Linux VM I get the following error:

QEMU error: QEMU exited from an error: qemu-aarch64-softmmu: -drive if=pflash,unit=1,file=/Users/enzime/Library/Containers/com.utmapp.UTM/Data/Documents/Linux 2.utm/Data/efi_vars.fd: Could not open '/Users/enzime/Library/Containers/com.utmapp.UTM/Data/Documents/Linux 2.utm/Data/efi_vars.fd': Permission denied

Screenshot 2024-10-06 at 9 17 00 pm
$ ls -l ~/Library/Containers/com.utmapp.UTM/Data/Documents/Linux\ 2.utm/Data/efi_vars.fd
-r--r--r--@ 1 enzime  staff  334848 Jan  1  1970 /Users/enzime/Library/Containers/com.utmapp.UTM/Data/Documents/Linux 2.utm/Data/efi_vars.fd

The permissions and creation date indicate the file is getting copied from the Nix Store which is readonly

If I run:

$ chmod u+w ~/Library/Containers/com.utmapp.UTM/Data/Documents/Linux\ 2.utm/Data/efi_vars.fd

Then the VM works perfectly fine

Related: https://github.com/NixOS/nixpkgs/issues/244663

Configuration

Debug log

debug.log

osy commented 1 month ago

Please update to 15.0.1 and try again

Enzime commented 1 month ago

I've just updated to 15.0.1 and I still get the same error

osy commented 2 weeks ago

Can you update to 15.1?

Enzime commented 2 weeks ago

Same issue

n8henrie commented 10 hours ago

Until this is released and the package updated in nixpkgs, it looks like the closing PR essentially does this:

$ chmod u+w ~/Library/Containers/com.utmapp.UTM/Data/Documents/nixos-qemu.utm/Data/efi_vars.fd

Running that manually resolved the error for me.