UTM icon indicating copy to clipboard operation
UTM copied to clipboard

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

Open Enzime opened this issue 1 year ago • 2 comments

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

  • UTM Version: 4.5.4 (100) from Nix
  • macOS Version: 15.0
  • Mac Chip (Intel, M1, ...): M1

Debug log

debug.log

Enzime avatar Oct 06 '24 10:10 Enzime

Please update to 15.0.1 and try again

osy avatar Oct 06 '24 14:10 osy

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

Enzime avatar Oct 06 '24 23:10 Enzime

Can you update to 15.1?

osy avatar Nov 11 '24 07:11 osy

Same issue

Enzime avatar Nov 11 '24 08:11 Enzime

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.

n8henrie avatar Nov 25 '24 18:11 n8henrie