summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2017-05-13 20:44:36 -0400
committerLudovic Courtès <ludo@gnu.org>2017-05-20 10:16:23 +0200
commita6c642ef63012508f755a1329aa66e4b09da72b5 (patch)
treedbdaa2f173a62bbbb889c878bf96cc93fe2939a3 /gnu
parent56a03975eb287796128e80feb6799bc07f4b8185 (diff)
downloadguix-a6c642ef63012508f755a1329aa66e4b09da72b5.tar.gz
maint: The 'release' target builds a VM image.
* gnu/system/examples/vm-image.tmpl: New file.
* Makefile.am (GUIXSD_VM_SYSTEMS, GUIXSD_VM_IMAGE_BASE,
GUIXSD_VM_IMAGE_SIZE): New variables.
(release): Add logic to build a VM image.
(EXAMPLES): Add 'gnu/system/examples/vm-image.tmpl'.
* doc/guix.texi (Running GuixSD in a VM, Installing GuixSD in a VM): Mention the
pre-built VM image.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/system/examples/vm-image.tmpl53
1 files changed, 53 insertions, 0 deletions
diff --git a/gnu/system/examples/vm-image.tmpl b/gnu/system/examples/vm-image.tmpl
new file mode 100644
index 0000000000..57ac71c535
--- /dev/null
+++ b/gnu/system/examples/vm-image.tmpl
@@ -0,0 +1,53 @@
+;;; This is an operating system configuration template for a "bare-bones" setup,
+;;; suitable for booting in a virtualized environment, including virtual private
+;;; servers (VPS).
+
+(use-modules (gnu))
+(use-package-modules bootloaders disk nvi)
+
+(define vm-image-motd (plain-file "motd" "
+This is the GNU system.  Welcome!
+
+This instance of GuixSD is a bare-bones template for virtualized environments.
+
+You will probably want to do these things first if you booted in a virtual
+private server (VPS):
+
+* Set a password for 'root'.
+* Set up networking.
+* Expand the root partition to fill the space available by 0) deleting and
+recreating the partition with fdisk, 1) reloading the partition table with
+partprobe, and then 2) resizing the filesystem with resize2fs.\n"))
+
+(operating-system
+  (host-name "gnu")
+  (timezone "Etc/UTC")
+  (locale "en_US.utf8")
+
+  ;; Assuming /dev/sdX is the target hard disk, and "my-root" is
+  ;; the label of the target root file system.
+  (bootloader (grub-configuration (device "/dev/sda")
+                                  (terminal-outputs '(console))))
+  (file-systems (cons (file-system
+                        (device "my-root")
+                        (title 'label)
+                        (mount-point "/")
+                        (type "ext4"))
+                      %base-file-systems))
+
+  ;; This is where user accounts are specified.  The "root"
+  ;; account is implicit, and is initially created with the
+  ;; empty password.
+  (users %base-user-accounts)
+
+  ;; Globally-installed packages.
+  (packages (cons* nvi fdisk
+                   grub   ; mostly so xrefs to its manual work
+                   parted ; partprobe
+                   %base-packages))
+
+  (services (modify-services %base-services
+              (login-service-type config =>
+                                  (login-configuration
+                                    (inherit config)
+                                    (motd vm-image-motd))))))