diff mbox

Enhance USB install

Message ID 1468419848-15393-2-git-send-email-vincent.legoll@gmail.com
State Committed, archived
Headers show

Commit Message

Vincent Legoll July 13, 2016, 2:24 p.m. UTC
From: Vincent Legoll <vincent.legoll@idgrilles.fr>

* doc/guix.texi (USB install): add download & verify subsection,
add a section to explain how to boot a VM for guixsd installation

Signed-off-by: Vincent Legoll <vincent.legoll@gmail.com>
---
 doc/guix.texi | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 90 insertions(+), 1 deletion(-)

Comments

Ludovic Courtès July 26, 2016, 1:10 p.m. UTC | #1
Vincent Legoll <vincent.legoll@gmail.com> skribis:

> From: Vincent Legoll <vincent.legoll@idgrilles.fr>
>
> * doc/guix.texi (USB install): add download & verify subsection,

Sorry for the delay!  First some comments on the verification, which I
think should be treated in a separate commit:

>  This image contains a single partition with the tools necessary for an
>  installation.  It is meant to be copied @emph{as is} to a large-enough
> -USB stick.
> +USB stick.  It can also be used to install GuixSD in a QEmu virtual
> +machine (@pxref{USB storage Installation in a VM}).
> +
> +To download and verify this image, follow these steps:
> +
> +@enumerate
> +@item
> +Download the image & signature files using the @command{wget} command:
> +
> +@example
> +wget ftp://alpha.gnu.org/gnu/guix/guixsd-usb-install-@value{VERSION}.@var{system}.xz
> +wget ftp://alpha.gnu.org/gnu/guix/guixsd-usb-install-@value{VERSION}.@var{system}.xz.sign
> +@end example
> +
> +@item
> +Get the PGP key using the @command{gpg} command:
> +
> +@example
> +gpg --keyserver keys.gnupg.net --recv-keys 3D9AEBB5
> +@end example
> +
> +@item
> +Check download integrity using the @command{gpg} command:
> +
> +@example
> +gpg --verify guixsd-usb-install-@value{VERSION}.@var{system}.xz.sig
> +@end example

I took a slightly different approach in commit
debc6360e111e8efc8a938b2aef28e5b3616ada8, where I essentially copied the
text from “Binary Installation”.

I’ll comment on the rest later.

Thanks,
Ludo’.
Vincent Legoll July 26, 2016, 1:31 p.m. UTC | #2
> I took a slightly different approach in commit
> debc6360e111e8efc8a938b2aef28e5b3616ada8, where I essentially copied the
> text from “Binary Installation”.

OK, I saw that duplication, but only after I sent the patch for review...

> I’ll comment on the rest later.

Thanks
Ludovic Courtès Aug. 2, 2016, 12:32 p.m. UTC | #3
Hi Vincent,

Vincent Legoll <vincent.legoll@gmail.com> skribis:

> From: Vincent Legoll <vincent.legoll@idgrilles.fr>
>
> * doc/guix.texi (USB install): add download & verify subsection,
> add a section to explain how to boot a VM for guixsd installation

I pushed this as commit c8b543741f422ecf41e7635c6a1c40b3bd55947a, with
several modifications.

> +@node USB storage Installation in a VM
> +@subsection USB storage Installation in a VM

Changed the title to “Installing GuixSD in a Virtual Machine”.

> +To boot a QEmu virtual machine for installing GuixSD in a disk image, follow
> +these steps:

s/QEmu/QEMU/

> +@item
> +Ensure your running kernel has the required CONFIG_BRIDGE option for the
> +network to work properly in the virtual machine:
> +
> +@example
> +zgrep CONFIG_BRIDGE= /proc/config.gz
> +CONFIG_BRIDGE=y
> +@end example
> +
> +If it is compiled as a module & loaded, it will also work:
> +
> +@example
> +zgrep CONFIG_BRIDGE= /proc/config.gz
> +CONFIG_BRIDGE=m
> +lsmod | grep ^bridge
> +bridge 117542 0
> +@end example

I removed this bit because in my experience it’s not necessary.  Or am I
overlooking something?

> +@item
> +Boot a virtual machine with the USB installation image
> +
> +@example
> +qemu-system-x86_64 -m 1024 -smp 1 -net default -net nic,model=virtio -boot menu=on \
> +  -drive file=guixsd-x86_64-raw.img \
> +  -drive file=guixsd-usb-install-@value{VERSION}.@var{system}
> +@end example
> +
> +In the VM console, quickly press the <F12> key to enter the boot menu.  Then
> +press the <2> key and the <ENTER> key to validate your selection.

Added a couple of @kbd.

> +@end enumerate
> +
> +You're now root in the VM, proceed with the installation process.

Added cross-ref to “Running GuixSD in a VM”.

This is a valuable addition, but I guess many people want to try GuixSD
in a VM first.

Thank you!

Ludo’.
non such Aug. 3, 2016, 12:32 a.m. UTC | #4
Ludovic Courtès <ludo@gnu.org> writes:

> Hi Vincent,
>
> Vincent Legoll <vincent.legoll@gmail.com> skribis:
>
>> From: Vincent Legoll <vincent.legoll@idgrilles.fr>
>>
>> * doc/guix.texi (USB install): add download & verify subsection,
>> add a section to explain how to boot a VM for guixsd installation
>
> I pushed this as commit c8b543741f422ecf41e7635c6a1c40b3bd55947a, with
> several modifications.
>
...
>
>> +@item
>> +Ensure your running kernel has the required CONFIG_BRIDGE option for the
>> +network to work properly in the virtual machine:
>> +
>> +@example
>> +zgrep CONFIG_BRIDGE= /proc/config.gz
>> +CONFIG_BRIDGE=y
>> +@end example
>> +
>> +If it is compiled as a module & loaded, it will also work:
>> +
>> +@example
>> +zgrep CONFIG_BRIDGE= /proc/config.gz
>> +CONFIG_BRIDGE=m
>> +lsmod | grep ^bridge
>> +bridge 117542 0
>> +@end example
>
> I removed this bit because in my experience it’s not necessary.  Or am I
> overlooking something?

Do you mean the bit above or below your statement? The above might be
necessary to check for custom kernels on for example Gentoo based
systems as the host.
A check if what's about to be run is supported is good.
Or do I fail to see why you ommited this? Can you explain why it is not
necessary in your experience?

>
>> +@item
>> +Boot a virtual machine with the USB installation image
>> +
>> +@example
>> +qemu-system-x86_64 -m 1024 -smp 1 -net default -net nic,model=virtio -boot menu=on \
>> +  -drive file=guixsd-x86_64-raw.img \
>> +  -drive file=guixsd-usb-install-@value{VERSION}.@var{system}
>> +@end example
...
> Thank you!
>
> Ludo’.
>
Vincent Legoll Aug. 3, 2016, 6:50 a.m. UTC | #5
>> +@item
>> +Ensure your running kernel has the required CONFIG_BRIDGE option for the
>> +network to work properly in the virtual machine:
>> +
>> +@example
>> +zgrep CONFIG_BRIDGE= /proc/config.gz
>> +CONFIG_BRIDGE=y
>> +@end example
>> +
>> +If it is compiled as a module & loaded, it will also work:
>> +
>> +@example
>> +zgrep CONFIG_BRIDGE= /proc/config.gz
>> +CONFIG_BRIDGE=m
>> +lsmod | grep ^bridge
>> +bridge 117542 0
>> +@end example
>
> I removed this bit because in my experience it’s not necessary.  Or am I
> overlooking something?

My experience is exactly the inverse: I first didn't have it in my kernel, and
couldn't install guixsd just because of that. guixsd needs network to install,
and you need CONFIG_BRIDGE (in the host's kernel) for network to be available
in the VM.
diff mbox

Patch

diff --git a/doc/guix.texi b/doc/guix.texi
index 67ece1d..04de780 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20,6 +20,7 @@  Copyright @copyright{} 2015, 2016 Leo Famulari@*
 Copyright @copyright{} 2016 Ben Woodcroft@*
 Copyright @copyright{} 2016 Chris Marusich@*
 Copyright @copyright{} 2016 Efraim Flashner
+Copyright @copyright{} 2016 Vincent Legoll
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -179,6 +180,7 @@  System Installation
 * Limitations::                 What you can expect.
 * Hardware Considerations::     Supported hardware.
 * USB Stick Installation::      Preparing the installation medium.
+* USB storage Installation in a VM:: Booting a VM with USB install image.
 * Preparing for Installation::  Networking, partitioning, etc.
 * Proceeding with the Installation::  The real thing.
 * Building the Installation Image::  How this comes to be.
@@ -5931,6 +5933,7 @@  available.
 * Limitations::                 What you can expect.
 * Hardware Considerations::     Supported hardware.
 * USB Stick Installation::      Preparing the installation medium.
+* USB storage Installation in a VM:: Booting a VM with USB install image.
 * Preparing for Installation::  Networking, partitioning, etc.
 * Proceeding with the Installation::  The real thing.
 * Building the Installation Image::  How this comes to be.
@@ -6030,7 +6033,35 @@  for a 32-bit GNU/Linux system on Intel-compatible CPUs.
 
 This image contains a single partition with the tools necessary for an
 installation.  It is meant to be copied @emph{as is} to a large-enough
-USB stick.
+USB stick.  It can also be used to install GuixSD in a QEmu virtual
+machine (@pxref{USB storage Installation in a VM}).
+
+To download and verify this image, follow these steps:
+
+@enumerate
+@item
+Download the image & signature files using the @command{wget} command:
+
+@example
+wget ftp://alpha.gnu.org/gnu/guix/guixsd-usb-install-@value{VERSION}.@var{system}.xz
+wget ftp://alpha.gnu.org/gnu/guix/guixsd-usb-install-@value{VERSION}.@var{system}.xz.sign
+@end example
+
+@item
+Get the PGP key using the @command{gpg} command:
+
+@example
+gpg --keyserver keys.gnupg.net --recv-keys 3D9AEBB5
+@end example
+
+@item
+Check download integrity using the @command{gpg} command:
+
+@example
+gpg --verify guixsd-usb-install-@value{VERSION}.@var{system}.xz.sig
+@end example
+
+@end enumerate
 
 To copy the image to a USB stick, follow these steps:
 
@@ -6058,6 +6089,64 @@  Once this is done, you should be able to reboot the system and boot from
 the USB stick.  The latter usually requires you to get in the BIOS' boot
 menu, where you can choose to boot from the USB stick.
 
+@node USB storage Installation in a VM
+@subsection USB storage Installation in a VM
+
+To boot a QEmu virtual machine for installing GuixSD in a disk image, follow
+these steps:
+
+@enumerate
+@item
+Prepare a disk image file for the GuixSD system using the @command{dd} command:
+
+@example
+dd if=/dev/zero of=guixsd-x86_64-raw.img bs=1G count=5
+@end example
+
+@item
+Or use the QEmu tool to create a qcow2 formatted image file using
+the @command{qemu-img} command:
+
+@example
+qemu-img create -f qcow2 guixsd-x86_64-raw.img 5G
+@end example
+
+This will create a 5GB file.
+
+@item
+Ensure your running kernel has the required CONFIG_BRIDGE option for the
+network to work properly in the virtual machine:
+
+@example
+zgrep CONFIG_BRIDGE= /proc/config.gz
+CONFIG_BRIDGE=y
+@end example
+
+If it is compiled as a module & loaded, it will also work:
+
+@example
+zgrep CONFIG_BRIDGE= /proc/config.gz
+CONFIG_BRIDGE=m
+lsmod | grep ^bridge
+bridge 117542 0
+@end example
+
+@item
+Boot a virtual machine with the USB installation image
+
+@example
+qemu-system-x86_64 -m 1024 -smp 1 -net default -net nic,model=virtio -boot menu=on \
+  -drive file=guixsd-x86_64-raw.img \
+  -drive file=guixsd-usb-install-@value{VERSION}.@var{system}
+@end example
+
+In the VM console, quickly press the <F12> key to enter the boot menu.  Then
+press the <2> key and the <ENTER> key to validate your selection.
+
+@end enumerate
+
+You're now root in the VM, proceed with the installation process.
+
 @node Preparing for Installation
 @subsection Preparing for Installation