supermin/liguestfs fails to configure network
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libguestfs (Debian) |
New
|
Unknown
|
|||
libguestfs (Ubuntu) |
Fix Released
|
Medium
|
Ioanna Alifieraki | ||
Bionic |
Fix Released
|
Medium
|
Ioanna Alifieraki | ||
Cosmic |
Fix Released
|
Medium
|
Ioanna Alifieraki | ||
Disco |
Fix Released
|
Medium
|
Ioanna Alifieraki | ||
supermin (Ubuntu) |
Invalid
|
Medium
|
Ioanna Alifieraki | ||
Bionic |
Invalid
|
Undecided
|
Unassigned | ||
Cosmic |
Invalid
|
Undecided
|
Unassigned | ||
Disco |
Invalid
|
Undecided
|
Unassigned |
Bug Description
[Impact]
libguestfs cannot configure network on Bionic onward.
This bug is a combination of libguestfs/supermin package and
/etc/dhcp/
present on Bionic onward.
When supermin creates the appliance does chroot and executes its init script.
If networking is enabled init will call dhclient sript to configure the network.
On Bionic onward the make_resolv_conf function of dhclient_script is overwritten
in /etc/dhcp/
the systemd.resolved service.
However, this happening in chroot environment fails with
"System has not been booted with systemd as init system (PID 1). Can't operate."
and network is left unconfigured.
[Test Case]
$ sudo guestfish -a xenial-
run
mount /dev/sda1 /
command 'apt update'
EOF
libguestfs: launch: program=guestfish
libguestfs: launch: version=1.36.13
libguestfs: launch: backend registered: unix
libguestfs: launch: backend registered: uml
libguestfs: launch: backend registered: libvirt
...
supermin: deleting initramfs files
supermin: chroot
Starting /init script ...
...
+ dhclient --version
+ dhclient eth0
System has not been booted with systemd as init system (PID 1). Can't operate.
...
commandrvf: apt update
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Some index files failed to download. They have been ignored, or old ones used instead.
...
[Regression Potential]
Minimal. The fix removes the /etc/dhcp/
systemd is not used inside the appliance so it should not cause any regression.
https:/
https:/
[Other]
Affects B,C,D,E.
Upstream fix : https:/
Debian bug : https:/
-----
Workaround
1) Assume that libguestfs is installed, if not :
$ sudo apt-get install libguestfs-tools
2) Move the base.tar.gz to a temp dir, extract and remove tarball
$ sudo mv /usr/lib/
$ cd ~/tempdir
$ sudo tar -xzvf base.tar.gz
$ sudo rm base.tar.gz
3) Remove the etc/dhcp/
$ sudo rm etc/dhcp/
4) Create tarball again
$ sudo tar -czvf base.tar.gz etc
5) Move it back to installation dir
$ sudo mv base.tar.gz /usr/lib/
6) Clean cache
$ sudo rm -rf /var/tmp/.guestfs*
Changed in supermin (Ubuntu): | |
importance: | Undecided → Medium |
assignee: | nobody → Ioanna Alifieraki (joalif) |
Changed in supermin (Ubuntu): | |
status: | New → In Progress |
Changed in libguestfs (Ubuntu): | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Ioanna Alifieraki (joalif) |
Changed in libguestfs (Ubuntu Bionic): | |
status: | New → In Progress |
Changed in libguestfs (Ubuntu Cosmic): | |
status: | New → In Progress |
Changed in libguestfs (Ubuntu Disco): | |
status: | New → In Progress |
Changed in libguestfs (Ubuntu Bionic): | |
assignee: | nobody → Ioanna Alifieraki (joalif) |
Changed in libguestfs (Ubuntu Cosmic): | |
assignee: | nobody → Ioanna Alifieraki (joalif) |
Changed in libguestfs (Ubuntu Disco): | |
assignee: | nobody → Ioanna Alifieraki (joalif) |
Changed in libguestfs (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in libguestfs (Ubuntu Cosmic): | |
importance: | Undecided → Medium |
Changed in libguestfs (Ubuntu Disco): | |
importance: | Undecided → Medium |
description: | updated |
description: | updated |
tags: | added: sts-sponsor |
Changed in libguestfs (Debian): | |
status: | Unknown → New |
tags: | added: sts-sponsor-ddstreet |
tags: | removed: sts-sponsor sts-sponsor-ddstreet |
I posted a potential fix here: /www.redhat. com/archives/ libguestfs/ 2019-April/ msg00129. html
https:/