NM config after PXE/NFS live CD install
Daniel Manrique
daniel.manrique at canonical.com
Tue Apr 9 13:26:58 UTC 2013
On 13-04-09 07:56 AM, Sven Ulland wrote:
> Hi, all. How can I avoid ending up with an unconfigured NetworkManager
> after installing Ubuntu via a PXE/NFS-booted live CD image?
>
> I provide verbatim K/X/Ubuntu live CDs loopback mounted and directly
> bootable over PXE+NFS so that users can boot into the live environment
> and choose to install from there. The only modification is the
> pxelinux config to enable netboot. This works really well, except that
> the network ends up being unconfigured after the installation
> completes. Here's why:
>
> Casper's scripts/casper-bottom/23networking sees NETBOOT on the
> cmdline, and populates /etc/network/interfaces with "iface eth0 inet
> manual" to avoid breaking the NFS root mount.
>
> In the live env, NetworkManager avoids touching the network config
> since it sees the interface being configured in
> /etc/network/interfaces and /etc/NetworkManager/NetworkManager.conf
> has managed=false in the ifupdown section.
>
> So far so good.
>
> Now, during the installation, ubiquity/scripts/plugininstall.py
> configure_network() copies the live env's /etc/network/interfaces to
> the target, which will prevent NetworkManager from handling the
> interface on the next boot.
>
> What's an appropriate way to avoid this so that NetworkManager ends up
> in a working state after booting into the new installation?
>
> My first thought was to check for a cmdline parameter to avoid
> carrying over the live env's network config, but it is probably a bit
> too specialized.
>
> sven
>
On 13-04-09 07:56 AM, Sven Ulland wrote:> Hi, all. How can I avoid ending up
with an unconfigured NetworkManager
> after installing Ubuntu via a PXE/NFS-booted live CD image?
>
> I provide verbatim K/X/Ubuntu live CDs loopback mounted and directly
> bootable over PXE+NFS so that users can boot into the live environment
> and choose to install from there. The only modification is the
> pxelinux config to enable netboot. This works really well, except that
> the network ends up being unconfigured after the installation
> completes. Here's why:
>
> Casper's scripts/casper-bottom/23networking sees NETBOOT on the
> cmdline, and populates /etc/network/interfaces with "iface eth0 inet
> manual" to avoid breaking the NFS root mount.
>
> In the live env, NetworkManager avoids touching the network config
> since it sees the interface being configured in
> /etc/network/interfaces and /etc/NetworkManager/NetworkManager.conf
> has managed=false in the ifupdown section.
>
> So far so good.
>
> Now, during the installation, ubiquity/scripts/plugininstall.py
> configure_network() copies the live env's /etc/network/interfaces to
> the target, which will prevent NetworkManager from handling the
> interface on the next boot.
>
> What's an appropriate way to avoid this so that NetworkManager ends up
> in a working state after booting into the new installation?
>
> My first thought was to check for a cmdline parameter to avoid
> carrying over the live env's network config, but it is probably a bit
> too specialized.
>
> sven
>
Hello,
I've been handling this with a custom success_command entry in the preseed. If
you're remastering CDs to modify the pxelinux cfg, you could also add this to
the CD's ubuntu.seed file.
ubiquity ubiquity/success_command string \
in-target sed -i -e 's/inet manual/inet dhcp/' /etc/network/interfaces; \
true
This sets the interface to DHCP instead of manual, so at least it will try to
get the IP address from the DHCP server. A caveat is that it's still explicitly
declared, so NetworkManager will refuse to manage it. This is fine for my use
case but may not be for yours. You can probably use this as a basis for
something that entirely removes the eth0 stanza so that NetworkManager will take
over managing it.
- Daniel
More information about the Ubuntu-installer
mailing list