From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: QEMU image boots into dmd Date: Sat, 21 Sep 2013 01:09:43 +0200 Message-ID: <87vc1vay4o.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN9ua-0000EP-Im for guix-devel@gnu.org; Fri, 20 Sep 2013 19:15:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VN9uU-0004Fd-O9 for guix-devel@gnu.org; Fri, 20 Sep 2013 19:14:56 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:45701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN9uU-0004FT-Hm for guix-devel@gnu.org; Fri, 20 Sep 2013 19:14:50 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 4D5E91328 for ; Sat, 21 Sep 2013 01:09:48 +0200 (CEST) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CTCaAip+YT4j for ; Sat, 21 Sep 2013 01:09:48 +0200 (CEST) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id F0CBD12E2 for ; Sat, 21 Sep 2013 01:09:47 +0200 (CEST) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org So (gnu system vm) and its friends are now able to build a bootable QEMU image. That=E2=80=99s still *very* rough on the edges, but it boots into d= md (version -0.4 is out BTW, 10 years later ;-)). To build it, do something like: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guile GNU Guile 2.0.9 Copyright (C) 1995-2013 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)> ,m (gnu system vm) scheme@(gnu system vm)> (define s (open-connection )) scheme@(gnu system vm)> (system-qemu-image s) $1 =3D # /nix/store/s9fagmjmqcm14xzzb0j6aviw7nb1j12m-qemu-image 21143c0> scheme@(gnu system vm)> (build-derivations s (list $1)) $2 =3D #t scheme@(gnu system vm)> (derivation->output-path $1) $3 =3D "/nix/store/s9fagmjmqcm14xzzb0j6aviw7nb1j12m-qemu-image" ^D $ cp "/nix/store/s9fagmjmqcm14xzzb0j6aviw7nb1j12m-qemu-image" t.img $ qemu-system-x86_64 -serial stdio -net nic,model=3De1000 -net user,smb=3D$= PWD -hda t.img --8<---------------cut here---------------end--------------->8--- There are several services that dmd starts [0]: mingetty on tty1-3, and syslogd. mingetty runs =E2=80=98login=E2=80=99, which uses PAM for authent= ication [1] It allows you to log in as =E2=80=98root=E2=80=99 with no password. On tty= 12 is some output from syslogd. Once logged in you can run incredible things such as =E2=80=98/nix/store/*dmd*/bin/deco detailed-status dmd=E2=80=99. And that=E2=80=99s it! :-) We need to at least make a proper profile, put it in $PATH via /etc/bashrc; we need to have Guix installed in the image, and the packages already there recognized. There are many details to fix (setting a host name, etc.) Ideally Xorg + slim would be great, not sure how much effort that would take. In short, if you feel like helping out, you=E2=80=99re more than welcome! Thanks, Ludo=E2=80=99. PS: The good news is that 90% of this work is directly reusable for a =E2=80=9Creal=E2=80=9D system, and not specific to virtual images. [0] http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/vm.scm#n355 [1] http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/linux.scm#n42