Questions tagged [systemd-nspawn]
For questions pertaining to systemd-nspawn, a utility to spawn a command or OS in a light-weight container. Use this tag for questions about systemd-nspawn itself, using systemd-nspawn, or questions about issues arising inside a container spawned by systemd-nspawn where that is significant.
65 questions
6 votes
1 answer
398 views
How do systemd-nspawn and systemd-networkd implement NAT?
I'm trying to understand how systemd-nspawn manages internet access and port-forwarding for containers. I set up an nspawn container with --network-veth and a port forwarding with --port=80. Both host ...
1 vote
0 answers
171 views
systemd-nspawn and PipeWire
I am running Debian container on systemd-nspawn (host machine is Ubuntu 24.04) and inside container I installed Electron app. I can run this app with GUI (i. e. when I run it, on my host machine is ...
1 vote
0 answers
143 views
Possible to setup veth with -n but not -b in systemd-nspawn?
making first experiments with systemd-nspawn. I would like to set up a container to run a single application with isolation. So far my command line is sudo systemd-nspawn -M mycontainer -x -U --user=...
0 votes
1 answer
284 views
How to increase kernel parameter (`msgmnb`) for a systemd-nspawn container
I have a systemd-nspawn container in which I am trying to change the kernel parameter for msgmnb. When I try to change the kernel parameter by directly writing to the /proc filesystem or using sysctl ...
0 votes
1 answer
327 views
How to declare systemd dependency for a nspawn service that depends on WireGuard interfaces?
I have a nspawn service that needs to take a WireGuard interface from the host. fw0.nspawn [Network] Interface=wg0 According to nspawn man page, I will also need this systemd drop-in. [Unit] Wants=...
1 vote
1 answer
64 views
Automate passing JBOSS installer arguments using Expect Command
I have a JBOSS Installer which when run manually it will prompt for input and below is the sample of the execution is as below [sp@sp baseInstaller]$ ./advStart.sh config Buildfile: /home/sp/jboss/sp/...
2 votes
0 answers
458 views
Cannot write to /dev/fb0 in systemd-nspawn container
I've created a systemd-nspawn container in which /dev/fb1 from the host is bound as /dev/fb0. I've set PrivateUsers=off in the .nspawn config file, and the file ownership and permissions of /dev/fb0 ...
0 votes
1 answer
1k views
How to make a restrictive syscall *whitelist* with systemd-nspawn?
I'm trying to lock down a container using systemd-nspawn, so that only the specific syscalls I whitelist are allowed. Per the documentation, there's a pretty lax filter in place by default, ...
1 vote
1 answer
1k views
Failed to get login PTY: Failed to activate service 'org.freedesktop.systemd1'
Been trying to understand and play around with systemd-nspawn because I'd like to run a Debian Testing install for myself without enabling the testing repos on my main Debian stable system. I wrote ...
3 votes
2 answers
744 views
How do I give my container a static ip address (systemd-nspawn)
My container changes its ip address extremely often, almost every boot. I tried giving it a static ip address so my script knows how to ssh into it but nothing I did seemed to work. So I tried looking ...
0 votes
1 answer
316 views
How can i map multiple ports in systemd-nspawn container?
I'm writing a container manager script which depends on nspawn, and the container is using a Virtual Ethernet Connection(-n opt). but it looks like that nspawn only support port mapping for single ...
3 votes
0 answers
322 views
How are ulimits determined for processes running in unpriviledged containers?
Recently, while I was building something in an unprivileged nspawn container (for CI), with the host system running arch linux, I repeatedly ran into an EMFILE error, from yarn, indicating that I'm ...
0 votes
0 answers
686 views
Why do systemd-nspawn's network namespaces not work correctly without systemd running inside the container?
I am trying to run a systemd-nspawn container without an init system and inside of a systemd-nspawn-managed network namespace. My container is a stock Fedora 35 image, and I am invoking it like so: ...
5 votes
1 answer
2k views
How do I wait for a systemd-nspawn container to boot?
I have a script that contains the following: sudo machinectl start "$machinename" sudo systemd-run -PM root@"$machinename" "$command" Failed to connect to bus: No such ...
3 votes
1 answer
702 views
How to resolve a systemd-nspawn container?
I have a nspawn container: root@nomad-02:~# machinectl list MACHINE CLASS SERVICE OS VERSION ADDRESSES debian container systemd-nspawn debian 11 192.168.88.171… 1 machines listed....