Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am installing Debian Wheezy (netinstall) in VirtualBox using preseed.cfg.

I tried both d-i netcfg/get_hostname string somehost and d-i netcfg/get_hostname string somehost, but in both cases the host gets set as "debian". I tried both at the same time but still the host is set as "debian".

Excerpt from Debian's guide about preconfiguration file:

If you want to force a hostname, regardless of what either the DHCP server returns or what the reverse DNS entry for the IP is, uncommentand adjust the following line

d-i netcfg/hostname string somehost

Is this a bug or am I just unlucky?

share|improve this question
add comment

2 Answers

Not a solution but a workaround

I too have faced a similar issue and I worked around it by setting the host name after installation via the following lines added at the end of my pressed.cfg:

d-i pressed/late_command string\
    in-target /bin/bash -c 'echo desired_name > /etc/hostname'

The in-target is necessary so that the / refers to the target filesystem (that will eventually become your root filesystem) that usually appears as /target during installation.

share|improve this answer
add comment

I found that this problem went away when I removed 'priority=critical' from the arguments I was passing-in to the kernel at the net install command line (via the pxelinux.cfg directory entries).

I assume this means that the question which asks the hostname has been given a priority which is lower than 'critical', and so gets populated with the default answer.

If you do make this change, you may find that you have to preseed some other lower-than-critical answers for other questions later on in the install process...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.