From: Timothy Washington <twashing@gmail.com>
To: Andreas Enge <andreas@enge.fr>
Cc: help-guix@gnu.org
Subject: Re: Building Qemu VM
Date: Tue, 10 Dec 2024 23:50:44 -0500 [thread overview]
Message-ID: <CAADtM-a4jVOMFAibZ35iJZUPYKE6fbY4hGYx65Hwmynnr=cvAw@mail.gmail.com> (raw)
In-Reply-To: <Z1a4DYAp5GvOQIma@jurong>
Hi Andreas,
Ah, so my `(use-modules)` needed A, not B.
Ie the `image` form is coming from `gnu.image`, not `gnu.system.image`.
But then what is the difference between these two modules?
When would I use `gnu.system.image` instead of `gnu.image`?
A. (gnu image)
B. (gnu system image)
Either way, I've gotten a step further.
But I've run across another problem building a Qemu VM image.
The vm definition in C gives me the error in D. Anything that I'm missing?
C
(use-modules (gnu)
(gnu image)
(gnu system vm)
(gnu system)
(gnu system file-systems))
(load "system.scm")
(define (boot-partition size)
(file-system
(mount-point "/boot")
(device "/dev/vda1")
(type "ext4")))
(define (root-partition size)
(file-system
(mount-point "/")
(device "/dev/vda1")
(type "ext4")))
(define vm-image
(image
(operating-system physical-operating-system)
(format 'compressed-qcow2)
(size (* 10 (expt 2 30)))
(partitions
(list (boot-partition (* 1 (expt 2 30)))
(root-partition (* 9 (expt 2 30)))))))
vm-image
D
$ guix system image -t qcow2 vm.scm
Backtrace:
In guix/status.scm:
859:3 19 (_)
839:4 18 (call-with-status-report _ _)
In guix/scripts/system.scm:
1318:4 17 (_)
In ice-9/boot-9.scm:
1752:10 16 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
689:37 15 (thunk)
1330:8 14 (call-with-build-handler #<procedure 7f8e82ced090 at g…> …)
2210:25 13 (run-with-store #<store-connection 256.100 7f8e7e2b0910> …)
In guix/scripts/system.scm:
858:2 12 (_ _)
In guix/store.scm:
2038:13 11 (_ #<store-connection 256.100 7f8e7e2b0910>)
In guix/gexp.scm:
300:51 10 (_)
In unknown file:
9 (with-fluids* (#<fluid 7f8e94df84a0>) (#f) #<procedure …>)
In guix/gexp.scm:
750:29 8 (_)
In gnu/system/image.scm:
1010:15 7 (_)
943:32 6 (operating-system-for-image #<<image> name: #f format: …>)
892:28 5 (image->root-file-system #<<image> name: #f format: com…>)
349:6 4 (find-root-partition _)
In srfi/srfi-1.scm:
730:15 3 (find #<procedure root-partition? (partition)> _)
In gnu/system/image.scm:
345:16 2 (root-partition? #<<file-system> device: "/dev/vda1" mo…>)
In ice-9/boot-9.scm:
1685:16 1 (raise-exception _ #:continuable? _)
1685:16 0 (raise-exception _ #:continuable? _)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure partition-flags: Wrong type argument: #<<file-system> device:
"/dev/vda1" mount-point: "/boot" type: "ext4" flags: () options: #f mount?:
#t mount-may-fail?: #f needed-for-boot?: #f check?: #t
skip-check-if-clean?: #t repair: preen create-mount-point?: #f
dependencies: () shepherd-requirements: () location: ((filename .
"/home/twashing/dotfiles/vm.scm") (line . 44) (column . 2))>
Tim
On Mon, 9 Dec 2024 at 04:27, Andreas Enge <andreas@enge.fr> wrote:
> Hello Tim,
>
> Am Sun, Dec 08, 2024 at 07:29:47PM -0500 schrieb Timothy Washington:
> > (define vm-image
> > (image
> > (operating-system physical-operating-system)
> > (format qcow2-image-type)
> > (size (* 10 (expt 2 30)))))
>
> looking at the code, I see this in gnu/image.scm:
> (define-record-type* <image>
> image make-image
> image?
> (name image-name ;symbol
> (default #false))
> (format image-format ;symbol
> (sanitize validate-image-format))
> ...
>
> and a bit above:
> ;; The supported image formats.
> (define-set-sanitizer validate-image-format format
> (disk-image compressed-qcow2 docker iso9660 tarball wsl2))
>
> So my guess is that 'compressed-qcow2 would be the value to put there.
>
> Andreas
>
>
next prev parent reply other threads:[~2024-12-11 4:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 0:29 Building Qemu VM Timothy Washington
2024-12-09 8:51 ` Jeremy Korwin-Zmijowski
2024-12-11 4:52 ` Timothy Washington
2024-12-09 9:27 ` Andreas Enge
2024-12-11 4:50 ` Timothy Washington [this message]
2024-12-11 12:42 ` Andreas Enge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAADtM-a4jVOMFAibZ35iJZUPYKE6fbY4hGYx65Hwmynnr=cvAw@mail.gmail.com' \
--to=twashing@gmail.com \
--cc=andreas@enge.fr \
--cc=help-guix@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).