ubuntu preseed install fails to set a hostname
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
debian-installer (Ubuntu) |
Fix Released
|
Medium
|
Eric Desrochers | ||
Trusty |
Fix Released
|
Medium
|
Eric Desrochers | ||
Xenial |
Fix Released
|
Medium
|
Eric Desrochers | ||
Bionic |
Fix Released
|
Medium
|
Eric Desrochers | ||
netcfg (Debian) |
New
|
Unknown
|
|||
preseed (Ubuntu) |
Fix Released
|
Medium
|
Eric Desrochers | ||
Trusty |
Fix Released
|
Medium
|
Eric Desrochers | ||
Xenial |
Fix Released
|
Medium
|
Eric Desrochers | ||
Bionic |
Fix Released
|
Medium
|
Eric Desrochers |
Bug Description
[Impact]
* DHCP hostname take precedence over netcfg/hostname, if set.
The problem is that the system read the preseed file after having run netcfg, thus the preseed parameter cannot be loaded straight from the start.
[Test Case]
* HOWTO reproduce :
Install Ubuntu using a preseed[1] file[2] and add the following line in the preseed recipe :
d-i netcfg/hostname string <HOSTNAME>
If the machine get a HOSTNAME from DHCP server or from a reverse lookup, netcfg/hostname doesn't take precedence.
[1] - url=http://<WEB_SERVER>
[2] - https:/
[Regression Potential]
* none expected, the change is trivial and has been intensively jointly tested by myself and cyphermox.
[Other Info]
* Debian bug : https:/
Patch has been submitted to Debian
* There is an old patch introduced in 2012 [Use netcfg/hostname for the hostname if found. (Closes: #606636)] but that doesn't work as expected.
[Original Description]
== Comment: #0 - Edward R. Cheslek <email address hidden> - 2015-04-28 18:04:01 ==
---Problem Description---
An install using a preseed file fails to configure the hostname of the system being installed.
Contact Information = <email address hidden>
---uname output---
Ubuntu 15.04 ppc64le
Machine Type = Tuleta pKVM guest
---Debugger---
A debugger is not configured
---Steps to Reproduce---
set up an automated install using a preseed file. Grub menu entry:
menuentry "Test" {
linux ubuntu-
initrd ubuntu-
}
The install will begin, and reach the hostname configuration screen, then stop, waiting for input. The hostname is set in the preseed file, which is attached.
Install method: http from ports.ubuntu.com
Install disk info: n/a
Install ISO Information: n/a
*Additional Instructions for <email address hidden>:
-Post a private note with access information to the machine that the bug is occuring on.
== Comment: #1 - SANDHYA VENUGOPALA <email address hidden> - 2015-04-29 06:08:18 ==
Some literature that is floating around -
when booting from an installation CD and using a preseed file on a network, the installer will need answers to some questions (hostname, network configuration, ...) before it can load the preseed file. On the other hand, including a customized preseed file in a setup CD will allow for more automation, but requires re-mastering of the CD.
The configuration of domain and host name, and keymap are still being asked, even if you have them in your preseed file as shown above. So if you want to kickstart the preseeded installation without a single questions asked, append the following more options to kernel boot prompt:
console-
Perhaps David Heller can throw some light on this and let us know if its bug.
== Comment: #2 - Edward R. Cheslek <email address hidden> - 2015-04-29 07:57:29 ==
I'm booting and installing from the network. Even if I leave the hostname related options out of my preseed, it still picks up and displays the correct hostname from dhcp.
== Comment: #3 - David Heller <email address hidden> - 2015-05-05 14:12:52 ==
I'm not very familiar with this particular preseed option so I'm not sure how it's supposed to behave. However, in a quick test on Ubuntu 15.04, adding "netcfg/
In the preseed however, I could not make it work, even if I commented out the related lines:
#d-i netcfg/get_hostname string unassigned-hostname
#d-i netcfg/get_domain string unassigned-domain
d-i netcfg/hostname string blah
And looking in the installer log, it could be a order of operations thing, since we see it picking up the hostname from DHCP before retrieving the preseed...
# cat /var/log/syslog | egrep "hostname|seed"
May 5 16:10:16 netcfg[2270]: INFO: DHCP hostname: "myhost"
May 5 16:10:16 netcfg[2270]: DEBUG: Preseeding domain from global: ibm.com
May 5 16:10:16 main-menu[301]: INFO: Menu item 'network-preseed' selected
May 5 16:10:18 preseed: successfully loaded preseed file from ftp://9.
That said: this doesn't tell exactly when the hostname was *set*, or if it should be overridden even if it is set at that point.
IMHO it should work the same way in the preseed as it does command-line, regardless of order, since that is what the user is requesting. If the installer already "set" the hostname from DHCP info, well, it should set it again with what the user wants.
But I don't know if this is supported or expected to work in all cases. Frankly, I'm not even sure if this is the correct way to do it in preseed (although it seems like it is).
But I think it's fair to mirror this to Ubuntu to ask.
== Comment: #5 - Edward R. Cheslek <email address hidden> - 2015-05-05 16:21:35 ==
I can set the hostname on the linux kernel line in grub, and it will show up correctly in the installer, but my issue is that the install still asks me to confirm that the hostname is correct. I want to proceed through my install totally unattended.
tags: | added: vivid |
affects: | ubuntu → debian-installer (Ubuntu) |
Changed in debian-installer (Ubuntu): | |
assignee: | nobody → Mathieu Trudel-Lapierre (mathieu-tl) |
Changed in netcfg: | |
status: | Unknown → New |
Changed in netcfg (Ubuntu): | |
assignee: | Mathieu Trudel-Lapierre (cyphermox) → Eric Desrochers (slashd) |
description: | updated |
description: | updated |
description: | updated |
Changed in netcfg (Ubuntu Trusty): | |
assignee: | nobody → Eric Desrochers (slashd) |
importance: | Undecided → Medium |
status: | New → In Progress |
description: | updated |
Changed in netcfg (Ubuntu Xenial): | |
importance: | Undecided → Medium |
affects: | netcfg → ubuntu-translations |
Changed in ubuntu-translations: | |
importance: | Unknown → Undecided |
no longer affects: | ubuntu-translations |
Changed in netcfg (Debian): | |
status: | Unknown → New |
tags: |
added: sts-sponsor removed: targetmilestone-inin1510 vivid |
tags: | added: sts-sru |
description: | updated |
description: | updated |
tags: | added: targetmilestone-inin1510 |
Changed in debian-installer (Ubuntu): | |
status: | New → In Progress |
Changed in debian-installer (Ubuntu Trusty): | |
status: | New → In Progress |
Changed in debian-installer (Ubuntu): | |
importance: | Undecided → Medium |
Changed in debian-installer (Ubuntu Xenial): | |
status: | New → In Progress |
Changed in debian-installer (Ubuntu Trusty): | |
importance: | Undecided → Medium |
Changed in debian-installer (Ubuntu Xenial): | |
importance: | Undecided → Medium |
tags: | removed: sts-sponsor |
tags: |
added: sts-sru-done removed: sts-sru |
tags: |
added: sts-sru-needed removed: sts-sru-done verification-done |
tags: |
added: sts-sru-done removed: sts-sru-needed |
Default Comment by Bridge