Skip to content

Conversation

@duament
Copy link
Contributor

@duament duament commented Jan 9, 2026

systemd escapes interface names in generated .device units. e.g. dummy-test -> dummy\x2dtest

When a non-alphanumeric interface (e.g. dummy-test) is set in containers.<name>.interfaces and autoStart is enabled, systemd will wait for a wrong device, resulting a 5 minutes delay to start the container. Logs:

subtest: Simple dummy interface is up, with autoStart enabled
autoStart: waiting for unit container@autoStart
autoStart: waiting for the VM to finish booting
autoStart: Guest shell says: b'Spawning backdoor root shell...\n'
autoStart: connected to guest root shell
autoStart: (connecting took 0.00 seconds)
autoStart: (finished: waiting for the VM to finish booting, in 0.00 seconds)
autoStart # [  312.936817] systemd[1]: sys-subsystem-net-devices-dummy-test.device: Job sys-subsystem-net-devices-dummy-test.device/start timed out.
autoStart # [  312.952269] systemd[1]: Timed out waiting for device /sys/subsystem/net/devices/dummy/test.
autoStart # [  312.958761] systemd[1]: sys-subsystem-net-devices-dummy-test.device: Job sys-subsystem-net-devices-dummy-test.device/start failed with result 'timeout'.
autoStart # [  312.975636] systemd[1]: Starting Container 'autoStart'...

This pr will fix this.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: nixos-container Imperative and declarative systemd-nspawn containers labels Jan 9, 2026
@jian-lin jian-lin requested review from Sohalt, fpletz and h7x4 January 15, 2026 12:23
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. and removed 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: nixos-container Imperative and declarative systemd-nspawn containers 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants