how do I configure preseed to populate the hostname from DHCP and not stop at the `configure the network` section during an unattended installation?

12,703

Solution 1

When netbooting, certain things get setup before the preseed gets retrieved and read, including networking. If its not setup on the command line, the installer will make a guess and ask you to confirm, which is what you're seeing. katu txakurra is correct that the hostname and domain you specify in the preseed and on the command line will be overridden by the values from DHCP, so add something like the following to your kernel arguments:

hostname=unassigned-hostname domain=unassigned-domain

Since you said "unattended" I assume you're already set priority=critical on the command line to ensure that only critical questions are asked, but if not, set that too to reduce the number of things you need to preseed

Solution 2

Replace the lines

d-i netcfg/get_hostname seen true
d-i netcfg/get_domain seen true

for this

d-i netcfg/get_hostname string ahostname
d-i netcfg/get_domain string adomain

Any hostname and domain names assigned from DHCP will take precedence over these values but setting them here will stop the question.

Share:
12,703

Related videos on Youtube

Alex Woolford
Author by

Alex Woolford

I was born in the United Kingdom and moved to the United States in 2004 following a go-for-broke journey across India, south-east Asia, and Australia. I now live in Lafayette, CO with my wife and two boys. I'm particularly interested in data science using Python, R and (most recently) Java.

Updated on September 18, 2022

Comments

  • Alex Woolford
    Alex Woolford over 1 year

    I'm trying to setup an unattended Ubuntu server install using preseed for my Hadoop cluster nodes.

    The hostnames are associated with MAC addresses by using a static map on my router. During installation, the hostname is pre-populated with the name from the static map, e.g.

    enter image description here

    Unfortunately, the installation pauses at this point and it's necessary to manually tab to 'continue'.

    The netcfg settings currently look like this:

    d-i netcfg/choose_interface select em1
    d-i netcfg/dhcp_timeout string 60
    d-i netcfg/disable_dhcp boolean false
    d-i netcfg/dhcp_failed note
    d-i netcfg/get_hostname string unassigned-hostname
    d-i netcfg/get_domain string unassigned-domain
    d-i netcfg/get_hostname seen true
    d-i netcfg/get_domain seen true
    

    Can you see what needs to be changed/added in order for the hostname to be set from the DHCP static map without stopping at 'configure the network'?

  • Alex Woolford
    Alex Woolford over 8 years
    Thanks @katu txakarra. I appreciate the response. I tried this and it's still pausing at the "please enter the hostname..." step.
  • Gergely Lukacsy
    Gergely Lukacsy almost 4 years
    Where do you set the priority parameter?
  • ZachP
    ZachP almost 4 years
    @GergelyLukacsy it's just another item in the preseed file: debian.org/releases/wheezy/mipsel/…
  • Gergely Lukacsy
    Gergely Lukacsy almost 4 years
    Thanks, @ZachP !