systemd-nspawn --network-interface= disappears when container exits
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
On Ubuntu xenial,
$ lsb_release -rd
Description: Ubuntu 16.04 LTS
Release: 16.04
$ apt-cache policy systemd
systemd:
Installed: 229-4ubuntu4
Candidate: 229-4ubuntu4
Version table:
*** 229-4ubuntu4 500
500 http://
100 /var/lib/
The systemd-nspawn manpage states that the existing --network-
Assign the specified network interface to the container. This will remove the specified interface from the calling namespace
and place it in the container. *When the container terminates, it is moved back to the host namespace*. Note that
the container.
However, this does not appear to be the case for a VLAN interface (created using systemd-networkd):
$ ip link
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <BROADCAST,
link/ether 00:26:b9:5a:45:03 brd ff:ff:ff:ff:ff:ff
3: eno2: <BROADCAST,
link/ether 00:26:b9:5a:45:04 brd ff:ff:ff:ff:ff:ff
6: vlan-terom-
link/ether 66:c9:35:09:49:74 brd ff:ff:ff:ff:ff:ff
$ sudo systemd-nspawn -M obelix-terom-dev --network-
Spawning container obelix-terom-dev on /var/lib/
Press ^] three times within 1s to kill container.
mount(
mount(
/etc/localtime is not a symlink, not updating container timezone.
root@obelix-
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
6: vlan-terom-dev@if2: <BROADCAST,
link/ether 66:c9:35:09:49:74 brd ff:ff:ff:ff:ff:ff link-netnsid 0
root@obelix-
Container obelix-terom-dev exited successfully.
$ ip link
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <BROADCAST,
link/ether 00:26:b9:5a:45:03 brd ff:ff:ff:ff:ff:ff
3: eno2: <BROADCAST,
link/ether 00:26:b9:5a:45:04 brd ff:ff:ff:ff:ff:ff
$ sudo systemd-nspawn -M obelix-terom-dev --network-
Spawning container obelix-terom-dev on /var/lib/
Press ^] three times within 1s to kill container.
Failed to resolve interface vlan-terom-dev: No such device
mount(
mount(
/etc/localtime is not a symlink, not updating container timezone.
$
Possibly related upstream mailing list thread, including workarounds:
https:/
Is this just a documentation bug in the man page?
Changed in systemd (Ubuntu): | |
status: | New → Won't Fix |