summaryrefslogtreecommitdiff
path: root/gnu/system/vm.scm
Commit message (Collapse)AuthorAge
* system: vm: Add a memory-size argument to system-docker-image.Mathieu Othacehe2021-04-12
| | | | | * gnu/system/vm.scm (system-docker-image): Add a memory-size argument and pass it to expression->derivation-in-linux-vm.
* system: vm: Set a larger value for the msize option of the 9p file system.Maxim Cournoyer2021-04-08
| | | | | | | | | | 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>
* system: vm: Use Guile 3.0 in Docker images.Ludovic Courtès2021-02-25
| | | | * gnu/system/vm.scm (system-docker-image): Use GUILE-3.0.
* scripts: system: Remove 'vm-image' command.Mathieu Othacehe2021-02-17
| | | | | | | | | | | | | | | 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.
* system: vm: Remove unused system-disk-image-in-vm.Maxim Cournoyer2020-11-17
| | | | | | * gnu/system/vm.scm (system-disk-image-in-vm): Remove. Reported-by: Ludovic Courtès <ludo@gnu.org>
* vm: expression->derivation-in-linux-vm: Run in a UTF-8 locale.Ludovic Courtès2020-11-10
| | | | | * gnu/system/vm.scm (expression->derivation-in-linux-vm): Add calls to 'setenv' and 'setlocale'.
* vm: 'system-qemu-image' forces the use of i386/BIOS GRUB.Ludovic Courtès2020-11-10
| | | | | | | 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.
* vm: system-qemu-image: Fix type error, remove more actual file systems.Ludovic Courtès2020-11-05
| | | | | | * 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.
* vm: Disable caching for writable file system mappings.Ludovic Courtès2020-08-31
| | | | | | | | 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.
* Revert "vm: Use virtio network driver."Marius Bakke2020-07-11
| | | | | | | | 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 5379392731b52eef22b4936637eb592b93e04318.
* system: vm: Add missing imported module.Royce Strange2020-06-09
| | | | | | * gnu/system/vm.scm (qemu-image): Import missing (gnu build hurd-boot) module. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
* hurd-boot: Further cleanup of "rc".Jan (janneke) Nieuwenhuizen2020-06-08
| | | | | | | * 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.
* vm: Shared-store script runs the native QEMU and Bash.Ludovic Courtès2020-06-06
| | | | | * gnu/system/vm.scm (system-qemu-image/shared-store-script): Use #+ for QEMU and BASH.
* vm: <virtual-machine> compiler honors system and target.Ludovic Courtès2020-06-06
| | | | | | | * 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.
* vm: 'qemu-image' preserves the cross-compilation target of the OS.Ludovic Courtès2020-06-06
| | | | | | * 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.
* vm: 'qemu-image' uses the native partitioning tools and bootloader.Ludovic Courtès2020-06-06
| | | | * gnu/system/vm.scm (qemu-image): Use #+ for Parted, the bootloader, etc.
* vm: 'expression->derivation-in-linux-vm' always returns a native build.Ludovic Courtès2020-06-06
| | | | | | | | | | * 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.
* vm: Use 'let-system'.Ludovic Courtès2020-05-16
| | | | | | * 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'.
* Merge branch 'core-updates'Marius Bakke2020-05-08
|\
| * Merge branch 'master' into core-updatesMarius Bakke2020-05-05
| |\
| * \ Merge branch 'master' into core-updatesMarius Bakke2020-04-26
| |\ \
| * | | vm: Make the device node procedure a parameter.Ludovic Courtès2020-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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'.
| * | | vm: 'qemu-image' can pass options to the 'mkfs' command.Ludovic Courtès2020-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
| * | | vm: 'qemu-image' accepts a list of extra populate directives.Ludovic Courtès2020-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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'.
* | | | guix system: 'docker-image' honors '--network'.Ludovic Courtès2020-05-07
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | * 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.
* | | vm: Remove obsolete procedures.Mathieu Othacehe2020-05-05
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | | image: Add a new API.Mathieu Othacehe2020-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | system: vm: Move operating-system-uuid.Mathieu Othacehe2020-05-05
| |/ |/| | | | | | | * gnu/system/vm.scm (operating-system-uuid): Move to ... * gnu/system.scm: ... here.
* | vm: Remove unused import.Marius Bakke2020-04-26
|/ | | | * gnu/system/vm.scm: Do not import (gnu packages make-bootstrap).
* vm: Use virtio network driver.Marius Bakke2020-04-10
| | | | | | | This fixes a regression introduced in 8e53fe2b91d2776bc1529e7b34967c8f1d9edc32 where 'guix system vm' would no longer be using virtio. * gnu/system/vm.scm (common-qemu-options): Add "-nic user,model=virtio-net-pci".
* vm: 'system-disk-image' honors #:substitutable? for ISO9660 images.Ludovic Courtès2020-04-10
| | | | | | | | This is a followup to a328f66a9e16d7bae765d8bc088e4a97037e6e2b. * gnu/system/vm.scm (iso9660-image): Add #:substitutable? and pass it to 'expression->derivation-in-linux-vm'. (system-disk-image): Pass #:substitutable? to 'iso9660-image'.
* vm: Allow images to be marked as non-substitutable.Ludovic Courtès2020-04-08
| | | | | | | | * gnu/system/vm.scm (expression->derivation-in-linux-vm): Add #:substitutable? parameter. Pass it to 'gexp->derivation'. (qemu-image): Add #:substitutable? and pass it to 'expression->derivation-in-linux-vm'. (system-disk-image): Add #:substitutable? and pass it to 'qemu-image'.
* vm: Distinguish between success and failure of the guest code.Ludovic Courtès2020-03-26
| | | | | | | | | | Fixes <https://bugs.gnu.org/34276>. Reported by Tobias Geerinckx-Rice <me@tobias.gr>. * gnu/system/vm.scm (expression->derivation-in-linux-vm)[loader]: Produce '/xchg/.exit-status' file upon success. * gnu/build/vm.scm (load-in-linux-vm): Check for 'xchg/.exit-status' once QEMU has completed and respond accordingly.
* vm: Compute UUIDs truly deterministically.Ludovic Courtès2020-03-10
| | | | | | | | | This is a followup to 1540075c790dfaeff52c93392f2fc63b9e23b77e. The mistake had no effect on prior Guile versions but it's visible since Guile 3.0.1 and the fix for <https://bugs.gnu.org/39634>. * gnu/system/vm.scm (operating-system-uuid): Hash a list of 'file-system-digest' values, not the 'file-system-type' procedure.
* file-systems: Add a 'file-system-device->string' procedure.Maxim Cournoyer2020-03-02
| | | | | | | * gnu/system/file-systems.scm (file-system-device->string): New procedure. * gnu/system.scm (bootable-kernel-arguments): Use it. * gnu/system/vm.scm (operating-system-uuid): Likewise. * guix/scripts/system.scm (display-system-generation): Likewise.
* gnu: Remove uses of deprecated Qemu network configuration.Marius Bakke2019-12-18
| | | | | | | | | | * gnu/build/vm.scm (load-in-linux-vm): Move Qemu network configuration from ARCH-SPECIFIC-FLAGS to the Qemu command line. Use the "-nic" option of Qemu instead of "-device" and "-net". * gnu/system/vm.scm (common-qemu-options): Do not add a '-net' command. (virtual-machine-compiler): Use "-nic user,..." instead of "-net". * doc/guix.texi (Installing Guix in a VM, Invoking guix system, Running Guix in a VM): Do the same for examples.
* system: vm: Support cross-compilation.Mathieu Othacehe2019-12-01
| | | | | | | | | | | | | | * gnu/system.scm (system-linux-image-file-name): Add support for cross-built systems. Remove system argument that was ignored, (operating-system-kernel-file): adapt by removing ignored os argument. * gnu/system/vm.scm (expression->derivation-in-linux-vm): Add target argument and turn inputs into native-inputs. Pass target to qemu-command and gexp->derivation calls. (iso9660-image): Add target argument and pass it to expression->derivation-in-linux-vm. Remove qemu from inputs as it is not necessary. (qemu-image): Add target argument, also remove qemu from inputs. Pass target argument to expression->derivation-in-linux-vm call.
* system: vm: Add arm64 support.Mathieu Othacehe2019-11-22
| | | | | | | | * gnu/build/vm.scm (load-in-linux-vm): Add target-arm64? argument and use it to pass correct arguments to qemu. * gnu/system/vm.scm (expression->derivation-in-linux-vm): Pass the new target-arm64? argument added above. Do not add ESP partition on all ARM targets. Do not pass grub-efi package to initialize-hard-disk on ARM targets.
* vm: Honor the VOLATILE? parameter when producing a system disk image.Maxim Cournoyer2019-11-18
| | | | | | | * gnu/system/vm.scm (system-disk-image): Honor the VOLATILE? parameter instead of hard coding its value to #t. Reported-by: Jelle Licht <jlicht@fsfe.org>
* maint: Switch to Guile-JSON 3.x.Ludovic Courtès2019-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Guile-JSON 3.x is incompatible with Guile-JSON 1.x, which we relied on until now: it maps JSON dictionaries to alists (instead of hash tables), and JSON arrays to vectors (instead of lists). This commit is about adjusting all the existing code to this new mapping. * m4/guix.m4 (GUIX_CHECK_GUILE_JSON): New macro. * configure.ac: Use it. * doc/guix.texi (Requirements): Mention the Guile-JSON version. * guix/git-download.scm (git-fetch)[guile-json]: Use GUILE-JSON-3. * guix/import/cpan.scm (string->license): Expect vectors instead of lists. (module->dist-name): Use 'json-fetch' instead of 'json-fetch-alist'. (cpan-fetch): Likewise. * guix/import/crate.scm (crate-fetch): Likewise, and call 'vector->list' for DEPS. * guix/import/gem.scm (rubygems-fetch): Likewise. * guix/import/json.scm (json-fetch-alist): Remove. * guix/import/pypi.scm (pypi-fetch): Use 'json-fetch' instead of 'json-fetch-alist'. (latest-source-release, latest-wheel-release): Call 'vector->list' on RELEASES. * guix/import/stackage.scm (stackage-lts-info-fetch): Use 'json-fetch' instead of 'json-fetch-alist'. (lts-package-version): Use 'vector->list'. * guix/import/utils.scm (hash-table->alist): Remove. (alist->package): Pass 'vector->list' on the inputs fields, and default to the empty vector. * guix/scripts/import/json.scm (guix-import-json): Remove call to 'hash-table->alist'. * guix/swh.scm (define-json-reader): Expect pair? or null? instead of hash-table?. [extract-field]: Use 'assoc-ref' instead of 'hash-ref'. (json->branches): Use 'map' instead of 'hash-map->list'. (json->checksums): Likewise. (json->directory-entries, origin-visits): Call 'vector->list' on the result of 'json->scm'. * tests/import-utils.scm ("alist->package with dependencies"): New test. * gnu/installer.scm (build-compiled-file)[builder]: Use GUILE-JSON-3. * gnu/installer.scm (installer-program)[installer-builder]: Likewise. * gnu/installer/locale.scm (iso639->iso639-languages): Use 'assoc-ref' instead of 'hash-ref', and pass vectors through 'vector->list'. (iso3166->iso3166-territories): Likewise. * gnu/system/vm.scm (system-docker-image)[build]: Use GUILE-JSON-3. * guix/docker.scm (manifest, config): Adjust for Guile-JSON 3. * guix/scripts/pack.scm (docker-image)[build]: Use GUILE-JSON-3. * guix/import/github.scm (fetch-releases-or-tags): Update docstring. (latest-released-version): Use 'assoc-ref' instead of 'hash-ref'. Pass the result of 'fetch-releases-or-tags' to 'vector->list'. * guix/import/launchpad.scm (latest-released-version): Likewise.
* vm: 'system-docker-image' builds in a UTF-8 locale.Ludovic Courtès2019-06-17
| | | | | | | | | | Fixes <https://bugs.gnu.org/36215>. Reported by Björn Höfling <bjoern.hoefling@bjoernhoefling.de>. This is a followup to 9c941364bfc0120e3ab5c5c4cc71a9a302d59a2b. * gnu/system/vm.scm (system-docker-image)[build]: Set GUIX_LOCPATH and call 'setlocale'.
* vm: Create installation media with MBR and HFS only, no GPT.Danny Milosavljevic2019-05-18
| | | | | | | | | | | | | | | * gnu/build/vm.scm (make-iso9660-image): Accept XORRISO, GRUB-MKRESCUE-ENVIRONMENT. * gnu/system/vm.scm (iso9660-image): Pass XORRISO; accept GRUB-MKRESCUE-ENVIRONMENT. (system-disk-image): Pass GRUB-MKRESCUE-ENVIRONMENT. * gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch: New file. * gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch: New file. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/cdrom.scm (xorriso)[source]: Add patches. [arguments]<#:phases>[install-frontends]: Add phase.
* vm: 'system-docker-image' provides an entry point.Ludovic Courtès2019-05-15
| | | | | | | | | | | | | This simplifies use of images created with 'guix system docker-image'. * gnu/system/vm.scm (system-docker-image)[boot-program]: New variable. [os]: Add it to the GC roots. [build]: Pass #:entry-point to 'build-docker-image'. * gnu/tests/docker.scm (run-docker-system-test): New procedure. (%test-docker-system): New variable. * doc/guix.texi (Invoking guix system): Remove GUIX_NEW_SYSTEM hack and '--entrypoint' from the example. Mention 'docker create', 'docker start', and 'docker exec'.
* vm: Auto-detect if inputs should be registered.Maxim Cournoyer2019-05-13
| | | | | | | | | | | | | | | | | | | | | The default value of the argument REGISTER-CLOSURE? of the ISO9660-IMAGE, QEMU-IMAGE and SYSTEM-DOCKER-IMAGE procedures can be computed automatically, since the operating-system definition is available in its context. When the operating-system definition does not contain the GUIX-SERVICE-TYPE, do not register the closure in the database of Guix, as it takes time and doesn't serve a purpose. * gnu/system/vm.scm (has-guix-service-type): Add predicate. (iso9660-image)[register-closures?]: Use it to compute the argument's default value. (qemu-image)[register-closures?]: Likewise, and update docstring. (system-docker-image)[register-closures?]: Likewise. (system-disk-image): Do not explicit a value for the REGISTER-CLOSURES? argument of the ISO9660-IMAGE and QEMU-IMAGE procedure calls, so that its default value is used instead. * guix/scripts/system.scm (system-derivation-for-action): Do not explicit a value for the REGISTER-CLOSURES? argument of the SYSTEM-DOCKER-IMAGE procedure call, so that its default value is used instead.
* vm: Build ISOs and VM images in a UTF-8 environment.Ludovic Courtès2019-05-01
| | | | | | | | Fixes a bug whereby building an image containing non-ASCII file names would fail due to improper decoding of file names. * gnu/system/vm.scm (iso9660-image, qemu-image): Set GUIX_LOCPATH and call 'setlocale' in the build environment.
* vm: 'system-disk-image' no longer requires the OS to define the "/" file system.Ludovic Courtès2019-04-25
| | | | | | | | | | Previously 'guix system disk-image' would fail if the OS didn't define a "/" file system, even though it actually overrides that file system. * gnu/system/vm.scm (system-disk-image)[root-uuid]: Turn into a procedure. Call 'root-uuid' on a variant of OS with a "/" file system and inherit from that.
* vm: Do not mount /xchg with "cache=loose".Ludovic Courtès2019-04-14
| | | | | | | | Fixes <https://bugs.gnu.org/33639>. * gnu/system/vm.scm (%linux-vm-file-systems): Remove "cache=loose" for /xchg. (system-docker-image): Remove 'sync' call, now unneeded, and which was probably insufficient.
* vm: Ask QEMU for more RAM in the VM that makes ISO9660 images.Ludovic Courtès2019-03-27
| | | | | * gnu/system/vm.scm (iso9660-image): Pass #:memory-size to 'expression->derivation-in-linux-vm'.
* system: Add 'essential-services' field to <operating-system>.Ludovic Courtès2019-03-25
| | | | | | | | | | | | | | | | | | * gnu/system.scm (<operating-system>)[essential-services]: New field. (operating-system-directory-base-entries): Remove #:container? keyword and keep only the not-container branch. (essential-services): Likewise. (operating-system-services): Likewise, and call 'operating-system-essential-services' instead of 'essential-services'. (operating-system-activation-script): Remove #:container?. (operating-system-boot-script): Likewise. (operating-system-derivation): Likewise. * gnu/system/linux-container.scm (container-essential-services): New procedure. (containerized-operating-system): Use it and set the 'essential-services' field. (container-script): Remove call to 'operating-system-derivation'. * gnu/system/vm.scm (system-docker-image): Likewise. * doc/guix.texi (operating-system Reference): Document 'essential-services'.
* vm: 'virtualized-operating-system' inherits from the user's bootloader config.Ludovic Courtès2019-03-24
| | | | | * gnu/system/vm.scm (virtualized-operating-system): Inherit from the bootloader of OS.