Commit graph

297 commits

Author SHA1 Message Date
Mathieu Othacehe
0233583aa4
system: vm: Change the writable image name.
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Change it.
2022-01-14 12:26:07 +01:00
Mathieu Othacehe
5d2b8b0ee3
system: vm: Restore default RAM size to 512MB.
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Restore it.
2022-01-06 10:43:14 +01:00
Mathieu Othacehe
05a9d1f378
Remove VM generation dead-code.
This code duplicates the (gnu system image) and (gnu build image) code. Using
VM for image generation is not needed, not portable and really slow. Remove
all the VM image generation code to make sure that only the image API is used.

* gnu/build/vm.scm: Remove it. Move the qemu-command procedure to ...
* gnu/build/marionette.scm: ... here.
* gnu/local.mk (GNU_SYSTEM_MODULES): Adapt it.
* tests/modules.scm: Ditto.
* gnu/tests/install.scm: Ditto.
* gnu/system/vm.scm: Adapt it and remove expression->derivation-in-linux-vm,
qemu-img, system-qemu-image/shared-store and system-docker-image procedures.
* doc/guix.texi (G-Expressions): Adapt it.
2021-12-23 10:54:00 +01:00
Mathieu Othacehe
da92479674
system: vm: Use the image API to generate QEMU images.
Also add a volatile? argument to the virtual-machine record. When volatile? is
true generate a QEMU script that mounts an overlay on top of a read only
storage. When volatile? is false, use a persistent, read-write storage.

* gnu/system/vm.scm (common-qemu-options): Add a rw-image? argument to use a
persistent storage.
(system-qemu-image/shared-store-script): Add a volatile? argument and honor
it. Use the image API to build the QEMU image.
(<virtual-machine>)[volatile?]: New field.
(virtual-machine-compiler): Pass the volatile? argument to the
system-qemu-image/shared-store-script procedure.
2021-12-23 10:54:00 +01:00
Ricardo Wurmus
9bc0f45df5
Merge remote-tracking branch 'origin/master' into core-updates-frozen 2021-12-05 19:17:41 +01:00
Mathieu Othacehe
3354e41c1e
system: vm: Remove the vga argument.
* gnu/system/vm.scm (common-qemu-options): Remove the "-vga std" argument that
is the default since QEMU 2.2.

Suggested-by: Attila Lendvai <attila@lendvai.name>
2021-12-03 14:25:57 +01:00
Attila Lendvai
b42bfbdfe5
guix system vm: Add --no-graphic CLI argument.
It configures QEMU to use the tty it was started in for IO (as opposed to
opening a separate graphical window).  This enables copy-pasting and
scrollback.  Exit QEMU with C-a x.

* gnu/system/vm.scm (system-qemu-image/shared-store-script): Also add the
'-nographic' QEMU argument when called with #:graphic? #false.
* guix/scripts/system.scm (system-derivation-for-action): Propagate
the #:graphic? keyword arg.
(perform-action): Add and propagate the #:graphic? keyword arg.
(show-help): Add --no-graphic CLI arg.
(%options): Process the new --no-graphic CLI arg.
(process-action): Feed in the CLI arg through the #:graphic? keyword arg.
* doc/guix.texi (Invoking guix system): Add example to combine guix system and
invoking the vm start script into one command.  Split the description of the
various options into separate paragraphs.  Add a paragraph to describe
--no-graphic.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-12-03 14:18:32 +01:00
Ludovic Courtès
aaf210888c
vm: <virtual-machine> defaults to using 'qemu-minimal'.
'qemu-minimal' is enough for system tests, which is the main (only?) use
of <virtual-machine>.

* gnu/system/vm.scm (<virtual-machine>)[qemu]: Default to QEMU-MINIMAL.
2021-11-20 23:11:44 +01:00
Ludovic Courtès
d9dfbf886d
Merge branch 'master' into core-updates-frozen 2021-09-07 14:19:08 +02:00
Maxim Cournoyer
da4e409483
Migrate to the new 'targets' field of bootloader-configuration.
The old 'target' field is deprecated; adjust the sources to use the new
'targets' one instead.

* doc/guix-cookbook.texi<target>: Replace by 'targets'.
* gnu/bootloader/grub.scm: Likewise.
* gnu/installer/parted.scm: Likewise.
* gnu/machine/digital-ocean.scm: Likewise.
* gnu/system/examples/asus-c201.tmpl: Likewise
* gnu/system/examples/bare-bones.tmpl: Likewise
* gnu/system/examples/bare-hurd.tmpl: Likewise
* gnu/system/examples/beaglebone-black.tmpl: Likewise
* gnu/system/examples/desktop.tmpl: Likewise
* gnu/system/examples/docker-image.tmpl: Likewise
* gnu/system/examples/lightweight-desktop.tmpl: Likewise
* gnu/system/examples/vm-image.tmpl: Likewise
* gnu/system/examples/yggdrasil.tmpl: Likewise
* gnu/system/hurd.scm: Likewise
* gnu/system/images/hurd.scm: Likewise
* gnu/system/images/novena.scm: Likewise
* gnu/system/images/pine64.scm: Likewise
* gnu/system/images/pinebook-pro.scm: Likewise
* gnu/system/images/rock64.scm: Likewise
* gnu/system/install.scm: Likewise
* gnu/system/vm.scm: Likewise
* gnu/tests.scm: Likewise
* gnu/tests/ganeti.scm: Likewise
* gnu/tests/install.scm: Likewise
* gnu/tests/nfs.scm: Likewise
* gnu/tests/telephony.scm: Likewise
* tests/boot-parameters.scm: Likewise
* tests/system.scm: Likewise
2021-08-29 01:05:26 -04:00
Christopher Lemmer Webber
9455143907
Update copyright/name notices for Christine Lemmer-Webber.
* doc/guix-cookbook.texi: Update copyright/name for Christine Lemmer-Webber.
* gnu/build/image.scm: Likewise.
* gnu/build/vm.scm: Likewise.
* gnu/packages/admin.scm: Likewise.
* gnu/packages/assembly.scm: Likewise.
* gnu/packages/audio.scm: Likewise.
* gnu/packages/backup.scm: Likewise.
* gnu/packages/check.scm: Likewise.
* gnu/packages/databases.scm: Likewise.
* gnu/packages/emacs-xyz.scm: Likewise.
* gnu/packages/finance.scm: Likewise.
* gnu/packages/gnupg.scm: Likewise.
* gnu/packages/guile-xyz.scm: Likewise.
* gnu/packages/guile.scm: Likewise.
* gnu/packages/haskell-xyz.scm: Likewise.
* gnu/packages/linux.scm: Likewise.
* gnu/packages/mail.scm: Likewise.
* gnu/packages/password-utils.scm: Likewise.
* gnu/packages/perl.scm: Likewise.
* gnu/packages/python-web.scm: Likewise.
* gnu/packages/python-xyz.scm: Likewise.
* gnu/packages/python.scm: Likewise.
* gnu/packages/sphinx.scm: Likewise.
* gnu/packages/ssh.scm: Likewise.
* gnu/packages/xdisorg.scm: Likewise.
* gnu/services/networking.scm: Likewise.
* gnu/system/vm.scm: Likewise.
2021-08-15 14:15:37 -04:00
Ludovic Courtès
0e47fcced4
Merge branch 'master' into core-updates 2021-07-18 19:50:01 +02:00
Tobias Geerinckx-Rice
1baaf599a4
vm: Update deprecated QEMU option syntax.
Fixes:
  warning: short-form boolean option 'readonly' deprecated
  Please use readonly=on instead

* gnu/system/vm.scm (common-qemu-options): Use it instead.
2021-06-25 00:38:41 +02:00
Marius Bakke
4ea6852c5f
Merge branch 'master' into core-updates 2021-05-22 17:21:57 +02:00
Tobias Geerinckx-Rice
5fa46ca96d
Revert "vm: Autoload (gnu build vm)."
This reverts commit a67c00f4f7 in an
attempt to fix <http://issues.guix.gnu.org/48496>.
2021-05-18 16:37:18 +02:00
Ludovic Courtès
c2b183e13d
vm: Remove unused imports.
* gnu/system/vm.scm (gnu): Remove unused imports.
2021-05-17 23:59:58 +02:00
Ludovic Courtès
a67c00f4f7
vm: Autoload (gnu build vm).
* gnu/system/vm.scm: Autoload (gnu build vm), which was pulling in (sqlite3).
2021-05-17 23:59:58 +02:00
Efraim Flashner
fcc39864db
Merge remote-tracking branch 'origin/master' into core-updates
Conflicts:
	gnu/local.mk
	gnu/packages/boost.scm
	gnu/packages/chez.scm
	gnu/packages/compression.scm
	gnu/packages/crates-io.scm
	gnu/packages/docbook.scm
	gnu/packages/engineering.scm
	gnu/packages/gcc.scm
	gnu/packages/gl.scm
	gnu/packages/gtk.scm
	gnu/packages/nettle.scm
	gnu/packages/python-check.scm
	gnu/packages/python-xyz.scm
	gnu/packages/radio.scm
	gnu/packages/rust.scm
	gnu/packages/sqlite.scm
	guix/build-system/node.scm
2021-04-16 14:39:48 +03:00
Mathieu Othacehe
98bf60bf4f
system: vm: Add a memory-size argument to system-docker-image.
* gnu/system/vm.scm (system-docker-image): Add a memory-size argument and pass
it to expression->derivation-in-linux-vm.
2021-04-12 14:12:49 +02:00
Maxim Cournoyer
bdc96f6e0e
system: vm: Set a larger value for the msize option of the 9p file system.
Fixes <https://issues.guix.gnu.org/47225>.

* gnu/system/vm.scm (%default-msize-value): New variable.
(%linux-vm-file-systems): Use it as the value of the msize option.
(mapping->file-system): Likewise.

Reported-by: Leo Famulari <leo@famulari.name>
2021-04-08 15:12:01 -04:00
Christopher Baines
a8448da0f4
Merge branch 'master' into core-updates 2021-03-06 00:18:30 +00:00
Ludovic Courtès
60fd4118f7
system: vm: Use Guile 3.0 in Docker images.
* gnu/system/vm.scm (system-docker-image): Use GUILE-3.0.
2021-02-25 11:29:35 +01:00
Mathieu Othacehe
ee2a5da80a
scripts: system: Remove 'vm-image' command.
Remove the 'vm-image' command that has been superseded by the 'image'
command.

* gnu/system/vm.scm (system-qemu-image): Remove it.
* guix/scripts/system.scm (system-derivation-for-action): Mark 'vm-image'
command as deprecated and use the image API to produce the VM image.
(perform-action, show-help): Adapt accordingly.
* tests/guix-system.sh: Ditto.
* doc/guix.texi (Invoking guix system,
Running Guix in a VM): Ditto.
* etc/completion/fish/guix.fish: Ditto.
* etc/completion/zsh/_guix: Ditto.
2021-02-17 10:52:28 +01:00
Christopher Baines
ff01206345
Merge remote-tracking branch 'origin/master' into core-updates 2020-11-29 17:34:18 +00:00
Maxim Cournoyer
19d4693939
system: vm: Remove unused system-disk-image-in-vm.
* gnu/system/vm.scm (system-disk-image-in-vm): Remove.

Reported-by: Ludovic Courtès <ludo@gnu.org>
2020-11-17 15:20:03 -05:00
Ludovic Courtès
000e7a0abc
vm: expression->derivation-in-linux-vm: Run in a UTF-8 locale.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add calls to
'setenv' and 'setlocale'.
2020-11-10 21:49:15 +01:00
Ludovic Courtès
7a20c1676a
vm: 'system-qemu-image' forces the use of i386/BIOS GRUB.
Fixes <https://bugs.gnu.org/44511>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.

* gnu/system/vm.scm (system-qemu-image): Add 'bootloader' field to OS.
2020-11-10 12:20:09 +01:00
Ludovic Courtès
341f67991d
vm: system-qemu-image: Fix type error, remove more actual file systems.
* gnu/system/vm.scm (system-qemu-image)[file-systems-to-keep]: Check
whether SOURCE is a string before calling 'string-prefix?'.  Remove
UUIDs and file system labels as well.
2020-11-05 00:07:45 +01:00
Tobias Geerinckx-Rice
222c6b9408
Remove the last vestiges of GuixSD.
* gnu/build/vm.scm (load-in-linux-vm): Rename the RNG.
* gnu/system/vm.scm (common-qemu-options): Likewise.
(system-docker-image): Rename the ROOT-DIRECTORY.
* gnu/packages/crypto.scm (eschalot)[arguments]: Use a different
arbitrary string.
* gnu/packages/wicd.scm (wicd)[arguments]: Remove unused configure flag.
* gnu/packages/xorg.scm (xorg-server): Set a more accurate OS vendor.
2020-10-16 15:24:34 +02:00
Ludovic Courtès
7eeb78157d
vm: Disable caching for writable file system mappings.
Fixes <https://bugs.gnu.org/43062>.
Reported by elaexuotee@wilsonb.com.

* gnu/system/vm.scm (mapping->file-system)[options]: Disable loose
caching when WRITABLE? is true.
2020-08-31 15:50:35 +02:00
Marius Bakke
1abf205d11
Revert "vm: Use virtio network driver."
This allows users to specify network interface settings with 'guix system vm'
without having to create a new NIC.  Fixes <https://bugs.gnu.org/42252>.
Reported by Christopher Lemmer Webber <cwebber@dustycloud.org>.

This reverts commit 5379392731.
2020-07-11 23:36:31 +02:00
Royce Strange
23567138f8
system: vm: Add missing imported module.
* gnu/system/vm.scm (qemu-image): Import missing (gnu build hurd-boot) module.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2020-06-09 01:31:16 -04:00
Jan (janneke) Nieuwenhuizen
b37c544196
hurd-boot: Further cleanup of "rc".
* gnu/packages/hurd.scm (hurd-rc-script): Move implementation to ...
* gnu/build/hurd-boot.scm (boot-hurd-system): ...here, new file.
* gnu/build/linux-boot.scm (make-hurd-device-nodes): Move there likewise.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
2020-06-08 14:26:14 +02:00
Ludovic Courtès
e768e4e97f
vm: Shared-store script runs the native QEMU and Bash.
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Use #+ for
QEMU and BASH.
2020-06-06 23:28:49 +02:00
Ludovic Courtès
60f759f06d
vm: <virtual-machine> compiler honors system and target.
* gnu/system/vm.scm (system-qemu-image/shared-store): Add #:system
and #:target.  Pass it down.
(system-qemu-image/shared-store-script): Likewise.
(virtual-machine-compiler): Likewise.
2020-06-06 23:28:49 +02:00
Ludovic Courtès
52c1b90a5a
vm: 'qemu-image' preserves the cross-compilation target of the OS.
* gnu/system/vm.scm (qemu-image)[preserve-target, inputs*]: New variables.
In gexp, use INPUTS* instead of INPUTS.  Wrap OS and BOOTCFG-DRV in
'preserve-target'.  Pass INPUTS* instead of INPUTS as the #:references-graphs.
2020-06-06 23:28:49 +02:00
Ludovic Courtès
96cb3f8a29
vm: 'qemu-image' uses the native partitioning tools and bootloader.
* gnu/system/vm.scm (qemu-image): Use #+ for Parted, the bootloader, etc.
2020-06-06 23:28:49 +02:00
Ludovic Courtès
b347723445
vm: 'expression->derivation-in-linux-vm' always returns a native build.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Remove #:target.
[builder]: Use #+.  Don't pass #:target-arm32? and #:target-aarch64? to
'load-in-linux-vm'.
Pass #:target #f to 'gexp->derivation'.
(qemu-image): Adjust accordingly.
* gnu/build/vm.scm (load-in-linux-vm): Remove #:target-aarch64?
and #:target-arm32?.  Define them as local variables.
2020-06-06 23:28:49 +02:00
Ludovic Courtès
502f609d05
vm: Use 'let-system'.
* gnu/system/vm.scm (expression->derivation-in-linux-vm)[check]: New macro.
[builder]: Use 'let-system' and 'check' instead of referencing
'%current-system' and '%current-target-system'.
2020-05-16 00:34:41 +02:00
Marius Bakke
4bdf4182fe
Merge branch 'core-updates' 2020-05-08 21:40:51 +02:00
Ludovic Courtès
d6c43d7bc1
guix system: 'docker-image' honors '--network'.
* gnu/system/vm.scm (system-docker-image): Add #:shared-network? and
pass it to 'containerized-operating-system'.
(qemu-image):
* guix/scripts/system.scm (system-derivation-for-action): Pass
 #:shared-network? to 'system-docker-image'.
* doc/guix.texi (Invoking guix system): Document it.
2020-05-07 12:55:14 +02:00
Marius Bakke
87a40d7203
Merge branch 'master' into core-updates 2020-05-05 20:43:21 +02:00
Mathieu Othacehe
77f5296236
vm: Remove obsolete procedures.
* gnu/build/vm.scm (install-efi, make-iso9660-image): Remove those procedures
that are now implemented in (gnu build image) module,
(initialize-hard-disk): remove efi support.
* gnu/system/vm.scm (iso9660-image): Remove it,
(qemu-image): adapt it to remove ISO9660 support.
2020-05-05 16:13:55 +02:00
Mathieu Othacehe
f19cf27c2b
image: Add a new API.
Raw disk-images and ISO9660 images are created in a Qemu virtual machine. This
is quite fragile, very slow, and almost unusable without KVM.

For all these reasons, add support for host image generation. This implies the
use new image generation mechanisms.

- Raw disk images: images of partitions are created using tools such as mke2fs
  and mkdosfs depending on the partition file-system type. The partition
  images are then assembled into a final image using genimage.

- ISO9660 images: the ISO root directory is populated within the store. GNU
  xorriso is then called on that directory, in the exact same way as this is
  done in (gnu build vm) module.

Those mechanisms are built upon the new (gnu image) module.

* gnu/image.scm: New file.
* gnu/system/image.scm: New file.
* gnu/build/image: New file.
* gnu/local.mk: Add them.
* gnu/system/vm.scm (system-disk-image): Rename to system-disk-image-in-vm.
* gnu/ci.scm (qemu-jobs): Adapt to new API.
* gnu/tests/install.scm (run-install): Ditto.
* guix/scripts/system.scm (system-derivation-for-action): Ditto.
2020-05-05 16:13:53 +02:00
Mathieu Othacehe
78fbf2bd70
system: vm: Move operating-system-uuid.
* gnu/system/vm.scm (operating-system-uuid): Move to ...
* gnu/system.scm: ... here.
2020-05-05 16:08:32 +02:00
Marius Bakke
f589cbc4dc
Merge branch 'master' into core-updates 2020-04-26 13:48:06 +02:00
Marius Bakke
796b387bc2
vm: Remove unused import.
* gnu/system/vm.scm: Do not import (gnu packages make-bootstrap).
2020-04-26 11:27:06 +02:00
Ludovic Courtès
cd45d656f1
vm: Make the device node procedure a parameter.
* gnu/build/vm.scm (root-partition-initializer): Add #:make-device-nodes
parameter and use it.
* gnu/system/vm.scm (qemu-image): Add #:device-node parameter.  Pass
 #:make-device-nodes to 'root-partition-initializer'.
2020-04-11 20:59:40 +02:00
Ludovic Courtès
4d1ff68d73
vm: 'qemu-image' can pass options to the 'mkfs' command.
* gnu/build/vm.scm (<partition>)[file-system-options]: New field.
(create-ext-file-system, create-fat-file-system)
(format-partition): Add #:options and honor it.
(initialize-partition): Pass #:options to 'format-partition'.
* gnu/system/vm.scm (qemu-image): Add #:file-system-options and use it
for the root partition.
2020-04-11 19:22:25 +02:00
Ludovic Courtès
82782d8cec
vm: 'qemu-image' accepts a list of extra populate directives.
* gnu/build/vm.scm (root-partition-initializer): Add #:extra-directives
parameter and pass it to 'populate-root-file-system'.
* gnu/system/vm.scm (qemu-image): Add #:extra-directives parameter and
pass it to 'root-partition-initializer'.
2020-04-11 19:22:25 +02:00