Ubuntu Preseed not using local mirror

mirrornetbootpreseedUbuntu

I have a full ubuntu mirror located on the server

http://leelah.home.ianwilson.org/ubuntu/

In my preseed.cfg file, I have the following d-i config for selecting my country mirror:

d-i mirror/country string manual 
d-i mirror/http/hostname string leelah.home.ianwilson.org
d-i mirror/http/directory string /ubuntu
d-i mirror/http/mirror select leelah.home.ianwilson.org

I can tail my access_log file to see that my preseed file is being retrieved from the installer, but nothing else. When I look at my network traffic, I am seeing that traffic is going to archive.ubuntu.com, and not my local mirror.

If I select "Manual mirror" and specify my mirror server during the guided install, it does use the local mirror, however, any attempt at trying to do this via preseed completely fails.

What should I be placing in my preseed file in order to get the installer to default to my local mirror?

Best Answer

It seems that distro codename is not set. This is example from working preseed template:

d-i mirror/country string manual
d-i mirror/http/hostname string aptproxy.hostname.tld:3142
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string
d-i mirror/codename string natty
d-i mirror/suite string natty

Also, you could pass DEBCONF_DEBUG=5 in kernel init parameters to enable debugging loglevel during preseeded installation. Messages in /var/log/syslog will be more verbose and you could find cause why it is happening.