GNU bug report logs - #28768
guix system vm Failed to install GRUB (EFI)

Previous Next

Package: guix;

Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>

Date: Mon, 9 Oct 2017 19:51:01 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28768 in the body.
You can then email your comments to 28768 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#28768; Package guix. (Mon, 09 Oct 2017 19:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 09 Oct 2017 19:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: guix system vm Failed to install GRUB (EFI)
Date: Mon, 09 Oct 2017 22:50:32 +0300
Hello Guix,

EFI bootloader configuration causes problems to test with 'system vm'
before 'reconfigure'.

To reproduce it replace default bootloader expression with following
snippet in gnu/system/examples/vm-image.tmpl

  (bootloader (bootloader-configuration
               (bootloader grub-efi-bootloader)
               (target "/boot/efi")))

--8<---------------cut here---------------start------------->8---
[    0.909226] EXT4-fs (vda1): mounted filesystem with ordered data mode. Opts: (null)
installing bootloader...
/gnu/store/b1kdjsmwkphwh06gcm2ym0d0zh5wf4gc-grub-efi-2.02/sbin/grub-install: error: /gnu/store/b1kdjsmwkphwh06gcm2ym0d0zh5wf4gc-grub-efi-2.02/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory.
ERROR: In procedure scm-error:
ERROR: failed to install GRUB (EFI)

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
GNU Guile 2.2.2
Copyright (C) 1995-2017 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> [    1.344109] tsc: Refined TSC clocksource calibration: 3392.250 MHz
[    1.344677] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x30e5b54dbe0, max_idle_ns: 440795272496 ns
  C-c C-c
--8<---------------cut here---------------end--------------->8---




Information forwarded to bug-guix <at> gnu.org:
bug#28768; Package guix. (Tue, 10 Oct 2017 19:09:01 GMT) Full text and rfc822 format available.

Message #8 received at 28768 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Oleg Pykhalov <go.wigust <at> gmail.com>, 28768 <at> debbugs.gnu.org
Subject: Re: bug#28768: guix system vm Failed to install GRUB (EFI)
Date: Tue, 10 Oct 2017 21:08:55 +0200
[Message part 1 (text/plain, inline)]
Oleg Pykhalov <go.wigust <at> gmail.com> writes:

> EFI bootloader configuration causes problems to test with 'system vm'
> before 'reconfigure'.

This is because `guix system vm` is not currently UEFI enabled, so GRUB
tries to install for a normal PC BIOS.

The fix would be to make the various QEMU invocations in (gnu system vm)
take a #:firmware parameter that passes something along the lines of
'-bios #$(file-append ovmf "/share/ovmf/firmware/ovmf_x64.bin")' to the
QEMU command-line, and update other scripts to take advantage.

It's on my ever-growing TODO list and would be nice to have indeed.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#28768; Package guix. (Thu, 12 Oct 2017 08:47:02 GMT) Full text and rfc822 format available.

Message #11 received at 28768 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, 28768 <at> debbugs.gnu.org
Subject: Re: bug#28768: guix system vm Failed to install GRUB (EFI)
Date: Thu, 12 Oct 2017 10:46:23 +0200
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> skribis:

> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>
>> EFI bootloader configuration causes problems to test with 'system vm'
>> before 'reconfigure'.
>
> This is because `guix system vm` is not currently UEFI enabled, so GRUB
> tries to install for a normal PC BIOS.
>
> The fix would be to make the various QEMU invocations in (gnu system vm)
> take a #:firmware parameter that passes something along the lines of
> '-bios #$(file-append ovmf "/share/ovmf/firmware/ovmf_x64.bin")' to the
> QEMU command-line, and update other scripts to take advantage.

Perhaps by adding it to <virtual-machine> records we’d make it less
annoying to pass around?  Or are there other places that would still
need extra care?

Another option, in the meantime is this:

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 273a895be..f763b430b 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -565,6 +565,14 @@ environment with the store shared with the host.  MAPPINGS is a list of
                   user-file-systems)))
 
   (operating-system (inherit os)
+
+    ;; XXX: Until we run QEMU with UEFI support (with the OVMF firmware),
+    ;; force the traditional i386/BIOS method.
+    ;; See <https://bugs.gnu.org/28768>.
+    (bootloader (bootloader-configuration
+                  (bootloader grub-bootloader)
+                  (target "/dev/vda")))
+
     (initrd (lambda (file-systems . rest)
               (apply base-initrd file-systems
                      #:volatile-root? #t
[Message part 3 (text/plain, inline)]
That’s what I do manually anyway.

WDYT?  If that’s fine with you, I can commit it.

Thanks,
Ludo’.

Information forwarded to bug-guix <at> gnu.org:
bug#28768; Package guix. (Thu, 19 Oct 2017 18:22:02 GMT) Full text and rfc822 format available.

Message #14 received at 28768 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, 28768 <at> debbugs.gnu.org
Subject: Re: bug#28768: guix system vm Failed to install GRUB (EFI)
Date: Thu, 19 Oct 2017 20:21:46 +0200
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Marius Bakke <mbakke <at> fastmail.com> skribis:
>
>> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>>
>>> EFI bootloader configuration causes problems to test with 'system vm'
>>> before 'reconfigure'.
>>
>> This is because `guix system vm` is not currently UEFI enabled, so GRUB
>> tries to install for a normal PC BIOS.
>>
>> The fix would be to make the various QEMU invocations in (gnu system vm)
>> take a #:firmware parameter that passes something along the lines of
>> '-bios #$(file-append ovmf "/share/ovmf/firmware/ovmf_x64.bin")' to the
>> QEMU command-line, and update other scripts to take advantage.
>
> Perhaps by adding it to <virtual-machine> records we’d make it less
> annoying to pass around?  Or are there other places that would still
> need extra care?

Sorry for late response, still going through a backlog!  I think
<virtual-machine> should be sufficient, did not do a lot of research.

> Another option, in the meantime is this:
>
> diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
> index 273a895be..f763b430b 100644
> --- a/gnu/system/vm.scm
> +++ b/gnu/system/vm.scm
> @@ -565,6 +565,14 @@ environment with the store shared with the host.  MAPPINGS is a list of
>                    user-file-systems)))
>  
>    (operating-system (inherit os)
> +
> +    ;; XXX: Until we run QEMU with UEFI support (with the OVMF firmware),
> +    ;; force the traditional i386/BIOS method.
> +    ;; See <https://bugs.gnu.org/28768>.
> +    (bootloader (bootloader-configuration
> +                  (bootloader grub-bootloader)
> +                  (target "/dev/vda")))
> +
>      (initrd (lambda (file-systems . rest)
>                (apply base-initrd file-systems
>                       #:volatile-root? #t
>
> That’s what I do manually anyway.
>
> WDYT?  If that’s fine with you, I can commit it.

LGTM!
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#28768; Package guix. (Thu, 19 Oct 2017 20:34:02 GMT) Full text and rfc822 format available.

Message #17 received at 28768 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: Marius Bakke <mbakke <at> fastmail.com>, 28768 <at> debbugs.gnu.org
Subject: Re: bug#28768: guix system vm Failed to install GRUB (EFI)
Date: Thu, 19 Oct 2017 23:32:56 +0300
Hello Ludovic,

Apologies for the late reply.

ludo <at> gnu.org (Ludovic Courtès) writes:

> Marius Bakke <mbakke <at> fastmail.com> skribis:
>
>> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>>
>>> EFI bootloader configuration causes problems to test with 'system vm'
>>> before 'reconfigure'.
>>
>> This is because `guix system vm` is not currently UEFI enabled, so GRUB
>> tries to install for a normal PC BIOS.
>>
>> The fix would be to make the various QEMU invocations in (gnu system vm)
>> take a #:firmware parameter that passes something along the lines of
>> '-bios #$(file-append ovmf "/share/ovmf/firmware/ovmf_x64.bin")' to the
>> QEMU command-line, and update other scripts to take advantage.
>
> Perhaps by adding it to <virtual-machine> records we’d make it less
> annoying to pass around?  Or are there other places that would still
> need extra care?
>
> Another option, in the meantime is this:
>
> diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
> index 273a895be..f763b430b 100644
> --- a/gnu/system/vm.scm
> +++ b/gnu/system/vm.scm
> @@ -565,6 +565,14 @@ environment with the store shared with the host.  MAPPINGS is a list of
>                    user-file-systems)))
>  
>    (operating-system (inherit os)
> +
> +    ;; XXX: Until we run QEMU with UEFI support (with the OVMF firmware),
> +    ;; force the traditional i386/BIOS method.
> +    ;; See <https://bugs.gnu.org/28768>.
> +    (bootloader (bootloader-configuration
> +                  (bootloader grub-bootloader)
> +                  (target "/dev/vda")))
> +
>      (initrd (lambda (file-systems . rest)
>                (apply base-initrd file-systems
>                       #:volatile-root? #t
>
>
> That’s what I do manually anyway.
>
> WDYT?  If that’s fine with you, I can commit it.
>
> Thanks,
> Ludo’.

Tiny improvement:

--8<---------------cut here---------------start------------->8---
natsu <at> magnolia ~/src/guix$ pre-guix system vm ~/dotfiles/guix/system-magnolia.scm
Backtrace:
          10 (primitive-load "/home/natsu/src/guix/scripts/guix")
In guix/ui.scm:
  1384:12  9 (run-guix-command _ . _)
In ice-9/boot-9.scm:
    837:9  8 (catch _ _ #<procedure 7f3d47deeac0 at guix/ui.scm:460:2 (key c)> _)
    837:9  7 (catch _ _ #<procedure 7f3d47deead8 at guix/ui.scm:548:6 (key proc…> …)
In guix/scripts/system.scm:
   1099:8  6 (_)
    974:6  5 (process-action _ _ _)
In guix/store.scm:
  1444:24  4 (run-with-store _ _ #:guile-for-build _ #:system _ #:target _)
In guix/scripts/system.scm:
   987:13  3 (_ _)
   706:18  2 (perform-action vm #<<operating-system> kernel: #<package linux-li…> …)
In gnu/system/vm.scm:
   671:31  1 (system-qemu-image/shared-store-script #<<operating-system> kernel…> …)
    559:4  0 (virtualized-operating-system #<<operating-system> kernel: #<packa…> …)

gnu/system/vm.scm:559:4: In procedure virtualized-operating-system:
gnu/system/vm.scm:559:4: In procedure module-lookup: Unbound variable: grub-bootloader
--8<---------------cut here---------------end--------------->8---

diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index f763b430b..7feb242d5 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -49,7 +49,8 @@
   #:use-module (gnu packages admin)
 
   #:use-module (gnu bootloader)
-  #:use-module ((gnu bootloader grub) #:select (grub-mkrescue-bootloader))
+  #:use-module ((gnu bootloader grub) #:select (grub-mkrescue-bootloader
+                                                grub-bootloader))
   #:use-module (gnu system shadow)
   #:use-module (gnu system pam)
   #:use-module (gnu system linux-initrd)


But I got another issue, not related to Grub.

Loops in QEMU:

    …
    waiting for partition 'magnolia-data' to appear
    …
    failed to start service 'file-systems'
    …




Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Thu, 19 Oct 2017 21:26:02 GMT) Full text and rfc822 format available.

Notification sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
bug acknowledged by developer. (Thu, 19 Oct 2017 21:26:02 GMT) Full text and rfc822 format available.

Message #22 received at 28768-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, 28768-done <at> debbugs.gnu.org
Subject: Re: bug#28768: guix system vm Failed to install GRUB (EFI)
Date: Thu, 19 Oct 2017 23:25:01 +0200
Hello!

Marius Bakke <mbakke <at> fastmail.com> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:

[...]

>> Another option, in the meantime is this:
>>
>> diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
>> index 273a895be..f763b430b 100644
>> --- a/gnu/system/vm.scm
>> +++ b/gnu/system/vm.scm
>> @@ -565,6 +565,14 @@ environment with the store shared with the host.  MAPPINGS is a list of
>>                    user-file-systems)))
>>  
>>    (operating-system (inherit os)
>> +
>> +    ;; XXX: Until we run QEMU with UEFI support (with the OVMF firmware),
>> +    ;; force the traditional i386/BIOS method.
>> +    ;; See <https://bugs.gnu.org/28768>.
>> +    (bootloader (bootloader-configuration
>> +                  (bootloader grub-bootloader)
>> +                  (target "/dev/vda")))
>> +
>>      (initrd (lambda (file-systems . rest)
>>                (apply base-initrd file-systems
>>                       #:volatile-root? #t
>>
>> That’s what I do manually anyway.
>>
>> WDYT?  If that’s fine with you, I can commit it.
>
> LGTM!

Pushed as 9b396c0cabb086746cbe4ec20d4ae0d79962d758 (along with the
missing #:use-module clause that Oleg reported.)

I’m closing this bug.  We can create a new issue when we add support for
UEFI in VMs.

Oleg Pykhalov <go.wigust <at> gmail.com> skribis:

> But I got another issue, not related to Grub.
>
> Loops in QEMU:
>
>     …
>     waiting for partition 'magnolia-data' to appear
>     …
>     failed to start service 'file-systems'
>     …

This is expected: there’s no partition with that label in the VM.

You have to comment out the ‘file-system’ declaration because it doesn’t
make sense inside the VM.  Perhaps ‘virtualized-operating-system’ could
do it automatically as well, not sure.

HTH,
Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 17 Nov 2017 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 154 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.