I'm currently working on PXE booting 10 or so machines to install Debian on them over the network from a centralized DHCP + TFTP server. I'm using the TFTP server to serve the Debian netboot image to the PXE clients. I'm also serving them a preseeding file via FTP.

So far (after hours of Google, trial and error) so good. The thing is, while reading the preseeding file, the hosts seem to be trying to fetch packages over the Internet; which is quite logical since the netboot image is only 8-9 MB in size.

The problem with that is that the Internet connection in that environment is currently unreliable so I was wondering if there's a way I can direct the hosts (via the preseed file or a kernel boot parameter) to clone my existent Debian system (i.e. the one on the DHCP/TFTP server). I would appreciate any help and I'm willing to share further information about my setup if you think they'd be helpful to you either to help you set up a similar environment or to help you suggest a solution to me :)

3 Answers 3


Instead of going to the Internet, you could go to a local debian repository.

This link explains how to setup a debian repository.

You would then have to find how to set your netboot image to get the packages from your local repository. I do not know how to do that, but a liar DNS server could be a solution.

  • Thanks for the link. Will try and get back to you. I'm thinking (hoping, really) that tricking the netboot image to grab packages from the local repo should be easy through the preseed file as you can define url addresses for your repos in there.
    – Joseph R.
    Mar 16, 2013 at 20:29
  • Even though I ended up doing things differently, your answer is the one that targets the original question.
    – Joseph R.
    Mar 18, 2013 at 22:13

If possible, you should create a local mirror inside that 'unreliable' network.

There are several tools that can help here, like debmirror, mrepo, aptmirror reprepo.

Also try Foreman for easy management of preseed files(and other things like PXE, DHCP, DNS). Foreman can take a little time to setup, but once you do, you'll have an easier time.

  • Will take a look at those and get back to you. That does sound like a good option since the LAN is pretty solid; it's on the WAN side that things get iffy.
    – Joseph R.
    Mar 16, 2013 at 20:21

Even though both of your answers pointed me in the right direction (and guided me to a lot of helpful reading), I'm answering my own question because I did it somewhat differently and in a way that involved almost no learning curve (I'm kind of on a time-frame for this task):

I have DVD 1 of the Debian DVD set which already contains a repo that is enough for a satisfactory install so I thought I'd use it instead of creating a new repo.

dd if=/dev/cdrom of=/path/to/ftp/dir/debian/debian.iso
mount -o loop /path/to/ftp/dir/debian/debian.iso /path/to/ftp/dir/debian

I then pointed the installer to that repo via

d-i mirror/protocol/string ftp
d-i mirror/ftp/hostname string <server-ip>
d-i mirror/ftp/directory string /debian

in the preseeding file. The repo on the DVD is, however, unsigned so for things to go smoothly, I also needed to add

d-i debian-installer/allow_unauthenticated boolean true

to the preseeding file.

  • You can avoid allow_unauthenticated by using reprepro to create a partial repo, fill it with udeb's too, and rebuild the debian-archive-keyring package to insert your gpg key. I have a script that does this, since the package needs to be built twice to verify the sigs: github.com/umeboshi2/paella/blob/master/vagrant/salt/roots/salt/… You may need some special reprepro config for the udebs: github.com/umeboshi2/paella/blob/master/vagrant/salt/roots/salt/… The two stanzas allow you to have all udebs and partial pkgs.
    – umeboshi
    Jan 25, 2015 at 22:42
  • You will also have to insert keyring into initrd, or use early command in preseed file, i.e. d-i preseed/early_command string wget -O /usr/share/keyrings/archive.gpg http://${paella_server_ip}/debrepos/paella.bin.gpg
    – umeboshi
    Jan 25, 2015 at 22:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .