nixpkgs/nixos/doc/manual/development
Maximilian Bosch a9adfc631a
nixos/test-driver: allow assigning other vsock number ranges
I'm a little annoyed at myself that I only realized this _after_ #392030
got merged. But I realized that if something else is using AF_VSOCK or
you simply have another interactive test running (e.g. by another user
on a larger builder), starting up VMs in the driver fails with

    qemu-system-x86_64: -device vhost-vsock-pci,guest-cid=3: vhost-vsock: unable to set guest cid: Address already in use

Multi-user setups are broken anyways because you usually don't have
permissions to remove the VM state from another user and thus starting
the driver fails with

    PermissionError: [Errno 13] Permission denied: PosixPath('/tmp/vm-state-machine')

but this is something you can work around at least.

I was considering to generate random offsets, but that's not feasible
given we need to know the numbers at eval time to inject them into the
QEMU args. Also, while we could do this via the test-driver, we should
also probe if the vsock numbers are unused making the code even more
complex for a use-case I consider rather uncommon.

Hence the solution is to do

    sshBackdoor.vsockOffset = 23542;

when encountering conflicts.
2025-05-09 11:54:00 +02:00
..
activation-script.section.md
assertions.section.md
bootspec.chapter.md nixos/activation/bootspec: fix style 2024-06-05 11:14:36 +08:00
building-parts.chapter.md
developing-the-test-driver.chapter.md
development.md
etc-overlay.section.md
freeform-modules.section.md
importing-modules.section.md nixos/eval-config: Deprecate NIXOS_EXTRA_MODULE_PATH 2024-10-18 17:04:35 +02:00
linking-nixos-tests-to-packages.section.md
meta-attributes.section.md nixos/eval-config: Deprecate NIXOS_EXTRA_MODULE_PATH 2024-10-18 17:04:35 +02:00
nixos-tests.chapter.md doc: init Testing Hardware Features section with vwifi 2025-04-20 15:39:25 -07:00
non-switchable-systems.section.md Revert "NixOS apply script" 2024-11-01 20:18:09 -04:00
option-declarations.section.md nixos/doc: update python39Packages reference 2025-04-13 01:26:42 +02:00
option-def.section.md lib.modules: init test for lib.mkDefinition 2025-04-03 15:03:00 +02:00
option-types.section.md doc/option-types: fix attrTag example 2025-03-27 14:22:53 +01:00
replace-modules.section.md
running-nixos-tests-interactively.section.md nixos/test-driver: allow assigning other vsock number ranges 2025-05-09 11:54:00 +02:00
running-nixos-tests.section.md
settings-options.section.md nixos/doc: fix typos in settings-options section 2025-05-01 19:20:22 +03:00
sources.chapter.md
testing-hardware-features.section.md doc: init Testing Hardware Features section with vwifi 2025-04-20 15:39:25 -07:00
testing-installer.chapter.md treewide: use pkgs.nixos-enter instead of config.system.build.nixos-enter 2024-09-21 16:13:36 +03:00
unit-handling.section.md Document the logic around X-NotSocketActivated in the manual 2024-12-09 08:57:47 -05:00
what-happens-during-a-system-switch.chapter.md Revert "NixOS apply script" 2024-11-01 20:18:09 -04:00
writing-documentation.chapter.md nixos/doc: Fix outdated references in the NixOS manual 2025-03-25 19:51:54 +00:00
writing-modules.chapter.md nixos/doc: Split mkdir mode into chmod command for clarity (#236740) 2024-11-01 11:09:52 +08:00
writing-nixos-tests.section.md nixos/test-driver: integrate Python unittest assertions 2025-03-20 12:30:58 +00:00