summaryrefslogtreecommitdiff
path: root/gnu/system/vm.scm
AgeCommit message (Collapse)AuthorFilesLines
2026-05-16system: virtualized-operating-system: Fix version comparison.Hilton Chain1-3/+3
(string< "6.6" "6.14") => #f * gnu/system/vm.scm (virtualized-operating-system): Use version>=? instead of string< to compare version. Merges: #7959
2026-03-20services, tests: Refer to inherited field values where applicable.Ludovic Courtès1-2/+2
* gnu/machine/hetzner.scm (operating-system-authorize): Refer to ‘services’ instead of calling ‘operating-system-user-services’. * gnu/services/virtualization.scm (secret-service-operating-system): Likewise. * gnu/tests.scm (operating-system-with-console-syslog): Likewise. * gnu/tests/avahi.scm (%avahi-os): Likewise. * gnu/tests/base.scm (%test-guix-daemon-unprivileged): Likewise. * gnu/tests/nfs.scm (%nfs-os): Likewise. (run-nfs-full-test): Likewise. * gnu/system/vm.scm (virtualized-operating-system): Refer to ‘initrd-modules’ instead of calling ‘operating-system-initrd-modules’. Change-Id: I00c5f5c1e171b174bf0ca709b2dbd13a2fe161b5
2026-02-11system: vm: Remove grub-efi workaround.Efraim Flashner1-11/+0
Bug https://bugs.gnu.org/28768 no longer needs working around. * gnu/system/vm.scm (virtualized-operating-system): Don't override the bootloader of the system configuration used. Change-Id: I495f59a6edd7929e2d47276db53fd86a89ac95e9 Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2025-10-01vm: Let ‘%immutable-store’ through.Ludovic Courtès1-2/+1
Fixes guix/guix#1926. ‘guix system vm’ would so far produce a system without the ‘file-system-/gnu/store’ Shepherd service, which is normally provided by ‘%immutable-store’. This would lead to an error for OS configs that explicitly require ‘file-system-/gnu/store’, such as those that use ‘qemu-binfmt-service-type’. * gnu/system/vm.scm (virtualized-operating-system)[user-file-systems]: Remove filtering of TARGET = (%store-prefix). Reported-by: Ashvith Shetty <ashvithshetty0010@zohomail.in> Change-Id: I656df6c3f067e47cd7acd03af437fe757db286d5
2025-04-27vm: Account for an upstream change in the name of the Cirrus kernel module.Leo Famulari1-3/+13
* gnu/system/vm.scm (virtualized-operating-system): Choose the module name based on the kernel version Change-Id: I77d70fa44a8d5d2412ae0aaa645fa67146b76432
2025-04-10gnu: Fix guix system vm --share argument error.Feng Shu1-3/+3
* gnu/system/vm.scm (common-qemu-options): Fix guix system vm --share argument error. Change-Id: I4182e2dbe1b54e6eec2fb6ca53f9345f6d396f14 Signed-off-by: Danny Milosavljevic <dannym@friendly-machines.com>
2025-03-05vm: Export ‘file-system->mount-tag’ and ‘common-qemu-options’.Ludovic Courtès1-1/+4
* gnu/system/vm.scm (file-system->mount-tag, common-qemu-options): Export. Change-Id: I7228e5c02f07f8c8633a64c86d9c81aa3cb2e8b7
2025-03-05vm: ‘common-qemu-options’ splits command-line tokens.Ludovic Courtès1-8/+11
The result returned so far by ‘common-qemu-options’ assumed that it would be passed to a shell. This is the case when using ‘system-qemu-image/shared-store-script’ but possibly not in other cases. * gnu/system/vm.scm (common-qemu-options): Add #:image-format. [virtfs-option]: Return a list of strings instead of a single "-virtfs xyz" string. Update caller to use ‘append-map’. Separate "-drive" string. Change-Id: Ib07c27e2c4b2d222d7db2c612bb045d330bc7f68
2025-02-13build: marionette: Make it possible to reboot VM during tests.Maxim Cournoyer1-1/+0
* gnu/build/marionette.scm (make-marionette): Add 'reconnect=1' socket parameter. * gnu/system/vm.scm (common-qemu-options): Remove '-no-reboot' option. Change-Id: I5e100543ddddba0aea3ebe4e2f5cb8b0261c0d73
2025-02-13system/vm: Fix virtual-machine bug.Maxim Cournoyer1-2/+6
The virtual-machine syntax would not accept a single operating-system field, which was puzzling. * gnu/system/vm.scm (virtual-machine): Add a pattern matching a single literal 'operating-system' field and value. Change-Id: If207fd71df3a3f763b2e63229eafa82f63e80773
2024-04-17vm: Always use a native emulator in ‘guix system vm’.Ludovic Courtès1-2/+5
Suggested by Zheng Junjie <zhengjunjie@iscas.ac.cn>. * gnu/system/vm.scm (system-qemu-image/shared-store-script)[qemu-exec]: Wrap first element in ‘with-parameters’. Change-Id: Iab9905aaa7e80bad0372c1ee7c3ea88a89564f8f
2024-03-31vm: If not the same local architecture, don't enable kvm.Zheng Junjie1-3/+6
* gnu/system/vm.scm (common-qemu-options): Add target keyword. Change-Id: Ic9bf18cf60ac5ce623289df31ea050a22c6e604e Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-03-31vm: add arguments to use virt machine type for qemu-riscv64.Zheng Junjie1-0/+4
* gnu/system/vm.scm (system-qemu-image/shared-store-script): When target riscv64, add arguments to set qemu virt machine type. Change-Id: I974c82fdd2d5bfc01caff9e6411db38e472b5cd4 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-03-31vm: When target riscv64-linux, use u-boot-qemu-riscv64-bootloader.Zheng Junjie1-7/+15
* gnu/system/vm.scm (virtualized-operating-system) When target riscv64-linux, use u-boot-qemu-riscv64-bootloader. Add system, target keyword. Change-Id: I22d64d00670a705e4b81427e44a83d504598b536 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-03-31vm: use #$ for kernel-arguments.Zheng Junjie1-2/+3
Use #$ allow cross-compile to with support current system kernel. e.g. linux-libre-riscv64-generic. * gnu/system/vm.scm(system-qemu-image/shared-store-script) (linux-image-startup-command): use #$ for kernel-arguments. Change-Id: I9d2e7df296ce590b95cd30996b33f8ca692ac1b1 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-02-10services: Add ‘virtual-build-machine’ service.Ludovic Courtès1-1/+61
* gnu/services/virtualization.scm (<virtual-build-machine>): New record type. (%build-vm-ssh-port, %build-vm-secrets-port, %x86-64-intel-cpu-models): New variables. (qemu-cpu-model-for-date, virtual-build-machine-ssh-port) (virtual-build-machine-secrets-port): New procedures. (%minimal-vm-syslog-config, %virtual-build-machine-operating-system): New variables. (virtual-build-machine-default-image): (virtual-build-machine-account-name) (virtual-build-machine-accounts) (build-vm-shepherd-services) (initialize-build-vm-substitutes) (build-vm-activation) (virtual-build-machine-offloading-ssh-key) (virtual-build-machine-activation) (virtual-build-machine-secret-root) (check-vm-availability) (build-vm-guix-extension): New procedures. (initialize-hurd-vm-substitutes): Remove. (hurd-vm-activation): Rewrite in terms of ‘build-vm-activation’. * gnu/system/vm.scm (linux-image-startup-command): New procedure. (operating-system-for-image): Export. * gnu/tests/virtualization.scm (run-command-over-ssh): New procedure, extracted from… (run-childhurd-test): … here. [test]: Adjust accordingly. (%build-vm-os): New variable. (run-build-vm-test): New procedure. (%test-build-vm): New variable. * doc/guix.texi (Virtualization Services)[Virtual Build Machines]: New section. (Build Environment Setup): Add cross-reference. Change-Id: I0a47652a583062314020325aedb654f11cb2499c
2024-02-10vm: Add ‘cpu-count’ field to <virtual-machine>.Ludovic Courtès1-1/+8
* gnu/system/vm.scm (<virtual-machine>)[cpu-count]: New field. (virtual-machine-compiler): Honor it. Change-Id: I907a89365f32ac7a9981c4ae5f59cf6eb199c3cc
2024-02-10vm: Export <virtual-machine> accessors.Ludovic Courtès1-1/+9
* gnu/system/vm.scm: Export. Change-Id: If65d96f4052d070af5baee26f3dd9b233b8480f4
2024-02-10vm: Add ‘date’ field to <virtual-machine>.Ludovic Courtès1-17/+17
* gnu/system/vm.scm (<virtual-machine>)[date]: New field. (virtual-machine-compiler): Honor it. Change-Id: Idab1c152466d57cbc6784c031a99fdfd37080bcb
2023-10-29system: vm: Include the cirrus driver in the initrd.Tobias Geerinckx-Rice1-0/+6
This is Ludo's suggestion at <https://issues.guix.gnu.org/36069#26>, with an added guard against duplicates and a tweaked comment. * gnu/system/vm.scm (virtualized-operating-system): Add "cirrus" to the list of INITRD-MODULES. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Change-Id: I1a86286586eee0b8c39706544778c7911a86da33
2023-10-01system: vm: Remove unused variable.Ludovic Courtès1-35/+6
This is a followup to 05a9d1f378e2e13e8f759be926ea368358afc27c, which removed its sole user. * gnu/system/vm.scm (%linux-vm-file-systems): Remove. (mapping->file-system): Add comment about “cache=loose”.
2022-12-06system: vm: Non-volatile 'run-vm.sh' creates a CoW image.Ludovic Courtès1-9/+18
Previously, copying the image would consume a lot of space and was I/O-intensive, to the point that the marionette connection timeout of 20s could be reached when running tests like "docker-system". * gnu/system/vm.scm (common-qemu-options): Pass 'format=' for each '-drive' option. (system-qemu-image/shared-store-script)[copy-image]: New variable. [builder]: Use it when VOLATILE? is false.
2022-01-14system: vm: Change the writable image name.Mathieu Othacehe1-1/+1
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Change it.
2022-01-06system: vm: Restore default RAM size to 512MB.Mathieu Othacehe1-1/+1
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Restore it.
2021-12-23Remove VM generation dead-code.Mathieu Othacehe1-485/+2
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-23system: vm: Use the image API to generate QEMU images.Mathieu Othacehe1-23/+54
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-05Merge remote-tracking branch 'origin/master' into core-updates-frozenRicardo Wurmus1-1/+2
2021-12-03system: vm: Remove the vga argument.Mathieu Othacehe1-1/+0
* 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-03guix system vm: Add --no-graphic CLI argument.Attila Lendvai1-0/+2
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-11-20vm: <virtual-machine> defaults to using 'qemu-minimal'.Ludovic Courtès1-1/+1
'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-09-07Merge branch 'master' into core-updates-frozenLudovic Courtès1-2/+2
2021-08-29Migrate to the new 'targets' field of bootloader-configuration.Maxim Cournoyer1-1/+1
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-15Update copyright/name notices for Christine Lemmer-Webber.Christopher Lemmer Webber1-1/+1
* 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-07-18Merge branch 'master' into core-updatesLudovic Courtès1-1/+1
2021-06-25vm: Update deprecated QEMU option syntax.Tobias Geerinckx-Rice1-1/+1
Fixes: warning: short-form boolean option 'readonly' deprecated Please use readonly=on instead * gnu/system/vm.scm (common-qemu-options): Use it instead.
2021-05-22Merge branch 'master' into core-updatesMarius Bakke1-5/+0
2021-05-18Revert "vm: Autoload (gnu build vm)."Tobias Geerinckx-Rice1-1/+2
This reverts commit a67c00f4f7ee0a70fce14a7e1907cce332c85813 in an attempt to fix <http://issues.guix.gnu.org/48496>.
2021-05-17vm: Remove unused imports.Ludovic Courtès1-5/+0
* gnu/system/vm.scm (gnu): Remove unused imports.
2021-05-17vm: Autoload (gnu build vm).Ludovic Courtès1-2/+1
* gnu/system/vm.scm: Autoload (gnu build vm), which was pulling in (sqlite3).
2021-04-16Merge remote-tracking branch 'origin/master' into core-updatesEfraim Flashner1-4/+16
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-12system: vm: Add a memory-size argument to system-docker-image.Mathieu Othacehe1-0/+2
* gnu/system/vm.scm (system-docker-image): Add a memory-size argument and pass it to expression->derivation-in-linux-vm.
2021-04-08system: vm: Set a larger value for the msize option of the 9p file system.Maxim Cournoyer1-4/+14
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-03-06Merge branch 'master' into core-updatesChristopher Baines1-65/+2
2021-02-25system: vm: Use Guile 3.0 in Docker images.Ludovic Courtès1-2/+2
* gnu/system/vm.scm (system-docker-image): Use GUILE-3.0.
2021-02-17scripts: system: Remove 'vm-image' command.Mathieu Othacehe1-63/+0
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.
2020-11-29Merge remote-tracking branch 'origin/master' into core-updatesChristopher Baines1-74/+18
2020-11-17system: vm: Remove unused system-disk-image-in-vm.Maxim Cournoyer1-72/+0
* gnu/system/vm.scm (system-disk-image-in-vm): Remove. Reported-by: Ludovic Courtès <ludo@gnu.org>
2020-11-10vm: expression->derivation-in-linux-vm: Run in a UTF-8 locale.Ludovic Courtès1-0/+6
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add calls to 'setenv' and 'setlocale'.
2020-11-10vm: 'system-qemu-image' forces the use of i386/BIOS GRUB.Ludovic Courtès1-1/+8
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-05vm: system-qemu-image: Fix type error, remove more actual file systems.Ludovic Courtès1-1/+4
* 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.