Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [systemd-nspawn]

The tag has no usage guidance, but it has a tag wiki.

-5
votes
1answer
48 views

What is “a light-weight namespace container” created by systemd-spawn?

man systemd-nspawn says systemd-nspawn may be used to run a command or OS in a light-weight namespace container. In many ways it is similar to chroot(1), but more powerful since it fully ...
0
votes
0answers
35 views

Why does `systemd-nspawn -n` network namespace not show in `ip netns list`

tl;dr Linux has namespaces, in particular, network namespaces. It seems the namespace supposedly created via the -n flag when running systemd-nspwawn does not show up when employing ip netns list (...
1
vote
0answers
16 views

How to ensure a container is started after another?

I use systemd-nspawn to run containers. There are mostly independent, except for two which should be started one after the other. Is there a way to ensure this? Something similar to After= for ...
2
votes
0answers
106 views

systemd-nspawn: how to allow access to all devices?

I'm trying to create a rough equivalent of Docker's --privileged in a systemd container, but I've got no idea how to allow the container to access all of the devices available on the host (without ...
1
vote
1answer
205 views

How to make systemd-nspawn work with ufw firewall?

I'm running a systemd-nspawn container (Debian 9, host also Debian 9) with VirtualEthernet=yes and some ports forwarded, e.g. Port=tcp:443:443. I.e. a web server runs in the container and should be ...
1
vote
2answers
962 views

Running systemd utilities like systemctl under an nspawn?

If I have a directory that I bootstraped with debootstrap that I got inside of running systemd-nspawn what do I have to do make its internal systemd functional? $ sudo systemd-nspawn -D ./foo ...
0
votes
1answer
548 views

systemd-nspawn vs chroot and bind mount?

Does systemd-nspawn do special inside to a chroot or does it just provide a different method of running chroot + the appropriate ro --bind mounts for proc, sys. The docs say, similar to chroot(1), ...
1
vote
1answer
267 views

CPU usage limit to systemd-nspawn container is not working

I am using systemd-nspawn(systemd version 237) in Yocto's embedded Linux environment. This is the content of /etc/systemd/system/systemd-nspawn\@.service.d/override.conf file ExecStart=/usr/bin/...
0
votes
1answer
29 views

non-interactive password change of nspawn container

I want to change passwd of root of nspawn container, as I am creating container via ansible just after I created rootfs, as at very first it doesn't have any root password. is it a good idea to ...
1
vote
0answers
387 views

systemd: autossh service active but ssh exited with error

#/lib/systemd/system/autossh.service [Unit] Description=Auto Reverse SSH Requires=systemd-networkd-wait-online.service After=systemd-networkd-wait-online.service [Service] Type=forking ExecStart=/...
1
vote
0answers
839 views

systemd-nspawn: redirect ports and keep internet

I'd like to know how to be able to: redirect ports between host and container (like for example forwarding the host 23 port to the container 22 port) be able to connect to the internet, for example ...
0
votes
0answers
290 views

ntpd in systemd-nspawn

I'm playing with containerizing various parts of my server infrastructure and one of the services I would like to run in container is ntp daemon. I'm using systemd-nspawn (systemd 233) as a ...
1
vote
1answer
431 views

systemd-nspawn: DHCP Discover cannot pass through a bridge from a container

What I have: A Gentoo host and an Ubuntu container. What I want: To connect the container to the network and to the host. What I'm doing: I've created a bridge on the host and added my NIC to it. ...
1
vote
1answer
543 views

systemd-nspawn: file-system permissions for a bound folder

What I have: A Gentoo host and an Ubuntu container. What I want: Mount /home from the host to the container and use it there as normal. What I'm doing: Start the container with -U --bind=/home ...
1
vote
1answer
245 views

systemd-nspawn inside lxc container

I've a nice chroot environment built with centos 7. I start it using systemd-nspawn. Everything works correctly in my local machine and in all the servers I've seen until now. Today I was asked to put ...
0
votes
1answer
338 views

Generate ssh keys in systemd-nspawn

I wrote a couple of scripts to download, customize and prepare a Raspbian image for Raspberry Pi. Because the root file-system will be mounted in read-only I have to create the ssh keys BEFORE running ...
1
vote
0answers
150 views

What is the interface to which nspawn binds by default?

I have a container created via debootstrap and it has network connectivity when started as systemd-nspawn -D thecontainerdir -b I have several network interfaces and would like it to bind to one of ...
1
vote
0answers
587 views

Enabling networking in a systemd-nspawn container

I'm trying to setup container that has access to the internet but have been unsuccessful so far. # sudo systemd-nspawn -nb -M debian-tree # systemctl enable --now systemd-networkd systemd-resolved # ...
0
votes
1answer
156 views

Firefox+noscript v.s. systemd-nspawn - ABE denial

[ABE] < LOCAL> Deny on {GET http://jessie/icons/openlogo-75.png <<< http://jessie/ - 1} SYSTEM rule: Site LOCAL Accept from LOCAL Deny i.e. pages on http://jessie ...
1
vote
0answers
132 views

debian unstable crash

Debian unstable, running in an nspawn container on Debian Jessie, crashed. On the host: $ sudo systemctl status systemd-nspawn@unstable-srv ● systemd-nspawn@unstable-srv.service - Container unstable-...
0
votes
1answer
577 views

System setup using systemd-nspawn

Can I use systemd-nspawn to setup a "chroot" install(in that case debian using debootstrap) before booting it? I.e. unattended install and setup. I need to set the keymap, hostname, maybe timezone ...
1
vote
0answers
278 views

Can I get a DHCP address from within a container via the DHCP server the host is on?

I have a host (ubuntu xenial) running a container via systemd-nspawn (also xenial): systemd-nspawn --directory=gogs --network-macvlan=ens192 --boot ens192 is the host interface which gets its IP ...
2
votes
1answer
2k views

systemd-nspawn container with separate IP address (network namespace) not working

Looking at the documentation for systemd-nspawn, it must have been intended to have a very user-friendly way to launch containers in a different network namespace. You use the -n option, and simply ...
2
votes
0answers
557 views

How to restart a systemd-nspawn container after the guest issues a reboot command?

I have systemd-nspawn containers which are enabled and start upon the boot of the host server. The problem I have is that they do not understand the reboot command issued on the guest: the container ...
2
votes
1answer
801 views

Why does the nspawn of an ubuntu image fail?

I would like to systemd-nspawn an Ubuntu image (yakkety, the host is on yakkety as well). This used to work without problems, so I guess something changed in the last ~6 months. I created an image ...
1
vote
0answers
144 views

How to restore correct ownership in nspawn containers after upgrade?

I upgraded from Ubuntu 16.04 to 16.10. I am running a few containers with systemd-nspawn. After the upgrade, some of the permissions in containers are not mapped correctly: root@delug:/tmp# ls /root ...
1
vote
1answer
395 views

Minimal system-nspawn container for process tree isolation with embedded applications

Is it possible to use nspawn for a single executable? My goal is just to isolate the process tree of the application, not portability. Let's say you wrote an application in C, built for your target ...
4
votes
1answer
1k views

systemd-nspawn OS container is unusable because I can't set the root password

I combined the detailed instructions from the original blog post, and the more up to date instructions from the man page (using dnf instead of yum). # sudo dnf -y --releasever=24 --installroot=$HOME/...
2
votes
1answer
642 views

systemd-networkd .network ignored within systemd-nspawn container

I'm fiddling with systemd-nspawn containers on my RaspberryPi. So far booting works fine. I use the --network-veth and --network-bridge=br0 options and bridging did work well with a kvm virtual ...
2
votes
1answer
3k views

Access usb device from systemd-nspawn container

I want to access special USB device (not a simple flash drive) from inside container. I bind /dev/bus/usb inside container, lsusb lists USBs effortlessly: $ lsusb ... Bus 002 Device 002: ID 0a89:...
3
votes
1answer
1k views

How to start a program in a container as a service using systemd-nspawn, systemd-run?

How do I run a listening program (specifically unoconv as a listener) inside a container using systemd-nspawn, so that it can run in the background (without a console) and be reached by other ...
1
vote
1answer
976 views

How to expose a directory to a container?

I would like to expose to a container (Ubuntu 16.04 created with debootstrap) started with systemd-nspawn a directory of the host system (also an Ubuntu 16.04). Is this possible with systemd-nspawn? ...
1
vote
1answer
274 views

Setting locale in a systemd-nspawn container (debian jessie)

Trying to get powerline/airline symbols to show in vim running in a Debian container created with sudo systemd-nspawn -D ~/debian-tree/ on a Fedora host. Right now it just shows question marks in ...
0
votes
1answer
275 views

How to use systemd-nspawn with pptp?

I would like to set a container use the vpn for only network interface. I have used the pptpsetup and pon make a pptp connection works, and got a ppp0 interface. Now, I want all internet connection ...
3
votes
0answers
67 views

How do I cut internet but connect X server for systemd-nspawned program

I'm setting my Archlinux to run programs on Ubuntu Natty via systemd-nspawn. Currently I start the session with --setenv=DISPLAY=:0 --bind=/dev -a su -l (user) -c xfce4-panel. I'm trying to disable ...
4
votes
2answers
4k views

How do I background a systemd-nspawn container?

I use systemd-nspawn to run a few containers. I can have them started in the background using systemctl start systemd-nspawn@foo. On occasion, however, I start with systemd-nspawn -bD foo. I couldn't ...
2
votes
1answer
634 views

How can I detect if a system is running inside a systemd-nspawn container?

Quite recently I started using systemd-nspawn to set up other OS instances on my Arch box. One thing I'd like to do is detect if I'm inside a container, and if so, add the distro name (from ...