From 0276f697b3dbab417dcad7ff32dfb4b9fb330ec4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 21 Nov 2014 00:02:26 +0100 Subject: guix system: Add '--share' and '--expose' options for 'vm'. * guix/scripts/system.scm (system-derivation-for-action): Add #:mappings parameter. Pass it to 'system-qemu-image/shared-store-script'. (perform-action): Likewise. (show-help): Document --share and --expose. (specification->file-system-mapping): New procedure. (%options): Add --share and --expose. (guix-system): Pass #:mapping to 'perform-action'. * doc/guix.texi (Invoking guix system): Document it. --- doc/guix.texi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 730b6a3770..569790065f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4375,12 +4375,27 @@ This command also installs GRUB on the device specified in @item vm @cindex virtual machine +@cindex VM Build a virtual machine that contain the operating system declared in @var{file}, and return a script to run that virtual machine (VM). Arguments given to the script are passed as is to QEMU. The VM shares its store with the host system. +Additional file systems can be shared between the host and the VM using +the @code{--share} and @code{--expose} command-line options: the former +specifies a directory to be shared with write access, while the latter +provides read-only access to the shared directory. + +The example below creates a VM in which the user's home directory is +accessible read-only, and where the @file{/exchange} directory is a +read-write mapping of the host's @file{$HOME/tmp}: + +@example +guix system vm my-config.scm \ + --expose=$HOME --share=$HOME/tmp=/exchange +@end example + On GNU/Linux, the default is to boot directly to the kernel; this has the advantage of requiring only a very tiny root disk image since the host's store can then be mounted. -- cgit v1.2.3