[Bug 1452202] Re: ubuntu preseed install fails to set a hostname

Mathieu Trudel-Lapierre mathieu.tl at gmail.com
Tue Sep 8 14:49:49 UTC 2015


Looks to me like you're "just" missing adding 'priority=critical'  on
the command-line to avoid being asked for the hostname. This happens
before while the hostname is preseeded, the network needs to be brought
up before it can be read, and netcfg does both bringing up the network
and setting the hostname. Setting the debconf priority to 'critical'
avoids the initial questions about the keymap and hostname/network
settings. In other words, this means for a fully-automated, unattended
preseeded install, you wouldn't need to specify hostname or
keymap/locale, as SANDHYA VENUGOPALA suggested.

There still appears to be a bug though, in the way that netcfg doesn't
honor the preseeded settings and set the hostname in /target (or in the
installer environment, for that matter).

I will leave to your choice whether you want to close this bug report
now, or keep it open for the netcfg bug I described, which still matches
the title and description.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to debian-installer in Ubuntu.
https://bugs.launchpad.net/bugs/1452202

Title:
  ubuntu preseed install fails to set a hostname

Status in debian-installer package in Ubuntu:
  Triaged

Bug description:
  == Comment: #0 - Edward R. Cheslek <echeslak at us.ibm.com> - 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 = echeslak at us.ibm.com 
   
  ---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-installer/ppc64el/vmlinux tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false auto=true preseed/url=http://10.33.11.31/data/autoinst/ted.preseed
          initrd  ubuntu-installer/ppc64el/initrd.gz
  }

  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 echeslak at us.ibm.com: 
  -Post a private note with access information to the machine that the bug is occuring on.

  == Comment: #1 - SANDHYA VENUGOPALA <vsandhya at in.ibm.com> - 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-keymaps-at/keymap=us hostname=myhost domain=example.com
  locale=en_US

  
  Perhaps David Heller can throw some light on this and let us know if its bug.

  == Comment: #2 - Edward R. Cheslek <echeslak at us.ibm.com> - 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 <hellerda at us.ibm.com> - 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/hostname=blah" to the kernel cmdline worked: it successfully overrode the hostname from DHCP (the way it is usually set in my environment) with no other changes required.

  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.114.211.201/install/autoinst/myhost

  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 <echeslak at us.ibm.com> - 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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1452202/+subscriptions



More information about the foundations-bugs mailing list