unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Guix under QEMU on Aarch64?
@ 2024-08-13  8:20 James Geddes
  2024-08-20 10:25 ` Marek Paśnikowski
  0 siblings, 1 reply; 5+ messages in thread
From: James Geddes @ 2024-08-13  8:20 UTC (permalink / raw)
  To: help-guix

I'd like to run Guix (the distribution) under QEMU on Aarch64 but I am really struggling to boot. I wonder if anyone has succeeded and could offer advice?

I *can* run Ubuntu (under QEMU on Aarch64); and in Ubuntu I have installed Guix as a package manager. That all works (very) nicely.

In Ubuntu-under-qemu I built a CD installer with `guix system image --image-type=iso9660 install.scm`, and created a "blank" drive using `qemu-img`. I run the installer (back on the native side) with:

```   
qemu-system-aarch64 \
    -nographic \
    -cpu host -machine virt,accel=hvf \
    -smp 4 -m 4G \
    -drive if=virtio,file=guix.iso,media=cdrom \
    -drive if=virtio,file=guix.qcow2 \
    -device virtio-rng-pci \
    -bios edk2-aarch64-code.fd
```

That gets as far as the menu asking to install Guix; and then gives this error:

```
error: plain image kernel not supported - rebuild with CONFIG_(U)EFI_STUB
enabled.
error: you need to load the kernel first.
```

So! I have three questions!

1. Should I, in fact, attempt to rebuild the kernel with CONFIG_EFI_STUB enabled? If so, is there anything I should be aware of (noting I am new to Guix and everything I knew about building kernels is 25 years out of date)? 

2. Or should I try to make QEMU use U-boot? (Which I understand is perhaps more common for aarch64 systems?)

3. Or is all this a red herring?  

Many thanks for any advice!

(NB: I have tried a few other things: `guix system init ... config.scm` to a new drive; and `guix system image --image-type=qcow2 config.scm` (which fails for other reasons I don't understand).) 


James

James Geddes
GitHub: triangle-man



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Guix under QEMU on Aarch64?
  2024-08-13  8:20 Guix under QEMU on Aarch64? James Geddes
@ 2024-08-20 10:25 ` Marek Paśnikowski
  2024-08-21 13:47   ` James Geddes
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Paśnikowski @ 2024-08-20 10:25 UTC (permalink / raw)
  To: help-guix

James Geddes <james@jamesgeddes.org> writes:

> (NB: I have tried a few other things: `guix system init ... config.scm` to a new drive; and `guix
> system image --image-type=qcow2 config.scm` (which fails for other reasons I don't understand).)

It would be nice to see those error messages.  You could have been
closer to success than you thought.

I have no experience with virtual machines, but I did plenty of guix
system inits — maybe your error is something I understand.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Guix under QEMU on Aarch64?
  2024-08-20 10:25 ` Marek Paśnikowski
@ 2024-08-21 13:47   ` James Geddes
  2024-08-21 14:18     ` Marek Paśnikowski
  0 siblings, 1 reply; 5+ messages in thread
From: James Geddes @ 2024-08-21 13:47 UTC (permalink / raw)
  To: help-guix


> On 20 Aug 2024, at 11:25, Marek Paśnikowski <marek@marekpasnikowski.pl> wrote:
> 
> James Geddes <james@jamesgeddes.org> writes:
> 
>> (NB: I have tried a few other things: `guix system init ... config.scm` to a new drive; and `guix
>> system image --image-type=qcow2 config.scm` (which fails for other reasons I don't understand).)
> 
> It would be nice to see those error messages.  You could have been
> closer to success than you thought.
> 
> I have no experience with virtual machines, but I did plenty of guix
> system inits — maybe your error is something I understand.
> 

I’d be very happy for any insight! The error message was:

```
# guix system image --image-type=qcow2 config.scm
guix system: error: EFI bootloader required with GPT partitioning
```

I’ll post the entire config.scm below in case that is useful. I don’t understand whether this error message is complaining about the absence of an EFI boot loader or of a GPT partition; but in either case I thought these were specified in the config.scm file.   

Thanks again for any thoughts,

James


config.scm follows (it is a modification of gnu/system/examples/bare-bones.tmpl):

;; -*- mode: scheme; -*-
;; This is an operating system configuration template
;; for a "bare bones" setup, with no X11 display server.

(use-modules (gnu)
	     (gnu packages linux)
	     (gnu system keyboard))
(use-service-modules networking ssh)
(use-package-modules screen ssh)

(operating-system
  (host-name “guix")
  (timezone "Europe/London")
  (locale "en_GB.utf8")
  (keyboard-layout
   (keyboard-layout "gb" "mac"))

  (bootloader (bootloader-configuration
               (bootloader grub-efi-bootloader)
               (targets '("/boot/efi/"))))


  (kernel
   (customize-linux
    #:configs '("CONFIG_EFI_STUB=y")))
  
  (kernel-arguments (list "console=ttyAMA0,115200" "nomodeset"))

  (file-systems (append
		 (list
		  (file-system
		   (device "/dev/vda2")
		   (mount-point "/")
		   (type "ext4"))
		  (file-system
		   (device "/dev/vda1")
		   (mount-point "/boot/efi")
		   (type "vfat")))
                 %base-file-systems))

  ;; This is where user accounts are specified.  The "root"
  ;; account is implicit, and is initially created with the
  ;; empty password.
  (users (cons (user-account
                (name "james")
                (comment "James")
                (group "users")

                ;; Adding the account to the "wheel" group
                ;; makes it a sudoer.  Adding it to "audio"
                ;; and "video" allows the user to play sound
                ;; and access the webcam.
                (supplementary-groups '("wheel")))
               %base-user-accounts))

  ;; Globally-installed packages.
  (packages (cons screen %base-packages))

  ;; Add services to the baseline: a DHCP client and an SSH
  ;; server.  You may wish to add an NTP service here.
  (services (append (list (service dhcp-client-service-type)
                          (service openssh-service-type
                                   (openssh-configuration
                                    (openssh openssh-sans-x)
                                    (port-number 2222))))
                    %base-services)))




James Geddes
e: james@jamesgeddes.org
t: +44 7973 223 571



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Guix under QEMU on Aarch64?
  2024-08-21 13:47   ` James Geddes
@ 2024-08-21 14:18     ` Marek Paśnikowski
  2024-08-21 15:47       ` Zack Weinberg
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Paśnikowski @ 2024-08-21 14:18 UTC (permalink / raw)
  To: help-guix

James Geddes <james@jamesgeddes.org> writes:

>> On 20 Aug 2024, at 11:25, Marek Paśnikowski <marek@marekpasnikowski.pl> wrote:
>> 
>> James Geddes <james@jamesgeddes.org> writes:
>> 
>>> (NB: I have tried a few other things: `guix system init ... config.scm` to a new drive; and `guix
>>> system image --image-type=qcow2 config.scm` (which fails for other reasons I don't understand).)
>> 
>> It would be nice to see those error messages.  You could have been
>> closer to success than you thought.
>> 
>> I have no experience with virtual machines, but I did plenty of guix
>> system inits — maybe your error is something I understand.
>> 
>
> I’d be very happy for any insight! The error message was:
>
> ```
> # guix system image --image-type=qcow2 config.scm
> guix system: error: EFI bootloader required with GPT partitioning
> ```
>

I had a look at your config and my first thought is that the error
message is a poorly worded version of one of the following:

1. You must use both EFI bootloader and GPT partitioning.
2. If you use EFI bootloader, you must use GPT partitioning.

Either way, after logical analysis of the information here, my
conclusion is that guix deploys an image with an MBR partitioning
scheme.

Reading [the manual][1], „The image type can be selected using the
--image-type option. It defaults to mbr-hybrid-raw.” Further down, „The
--list-image-types command lists all the available image types.”

$ guix system image --list-image-types
The available image types are:

   - visionfive2-raw 
   - unmatched-raw 
   - rock64-raw 
   - pinebook-pro-raw 
   - pine64-raw 
   - orangepi-r1-plus-lts-rk3328-raw 
   - novena-raw 
   - hurd-qcow2 
   - hurd-raw 
   - raw-with-offset 
   - mbr-raw 
   - iso9660 
   - tarball 
   - qcow2 
   - wsl2 
   - efi-raw 
   - mbr-hybrid-raw 
   - uncompressed-iso9660 
   - docker 
   - efi32-raw

[1]: https://guix.gnu.org/manual/devel/en/html_node/Invoking-guix-system.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Guix under QEMU on Aarch64?
  2024-08-21 14:18     ` Marek Paśnikowski
@ 2024-08-21 15:47       ` Zack Weinberg
  0 siblings, 0 replies; 5+ messages in thread
From: Zack Weinberg @ 2024-08-21 15:47 UTC (permalink / raw)
  To: help-guix

On Wed, Aug 21, 2024, at 10:18 AM, Marek Paśnikowski wrote:
> James Geddes <james@jamesgeddes.org> writes:
>> ```
>> # guix system image --image-type=qcow2 config.scm
>> guix system: error: EFI bootloader required with GPT partitioning
>> ```
>
> I had a look at your config and my first thought is that the error
> message is a poorly worded version of one of the following:
>
> 1. You must use both EFI bootloader and GPT partitioning.
> 2. If you use EFI bootloader, you must use GPT partitioning.

My first thought was that this *has to* mean the *converse* of (2),
"If you use GPT partitioning then you must use an EFI bootloader",
but James' config.scm clearly specifies an EFI bootloader, so it
really is badly worded.

James, your config.scm defines an operating-system record; you might
want to try defining an "image" record instead (with GPT partitioning),
see https://guix.gnu.org/en/manual/en/html_node/System-Images.html

zw


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-21 15:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-13  8:20 Guix under QEMU on Aarch64? James Geddes
2024-08-20 10:25 ` Marek Paśnikowski
2024-08-21 13:47   ` James Geddes
2024-08-21 14:18     ` Marek Paśnikowski
2024-08-21 15:47       ` Zack Weinberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).