Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to install a debian system remotely on a server fully automated.

In case I would having access to a debian OS image on this server (by having a DVD Drive or a USB Stick with a Debian OS Image) this would be very easy: I only would have to enter on the "boot/install" prompt the url to the PreSeed file. But I do not have access to a DVD Drive or USB Stick on the server.

In my case I only have access to the server via a rescue system (running a minimal debian). I know I can use debootstrap. But the problem is, using debootstrap is NOT automated, I have to first format the discs, mount them, execute debootstrap and so on.

What I want to do is, to log into the rescuesystem and call a "program" like debootstrap or the debian installer with preseed file and everything should be done automatically. But debootstrap does not support a preseed file. And I do not know how to call the installer in such a rescue system environment.

How can I achieve this? Is it possible to download in the rescuesystem a full Debian ISO image, extract it in memory and then somehow call the installer of this CD? But how? What command do I have to execute there?

OR is there some small tool that does exactly this that I need to call with a url to the image and preseed information and that then does the installation? As stated above, debootstrap is ok, but I want to use the preseed file from the debian installer without any manual intervention. debootstrap involves to much manual work.

Thanks very much for any help!! jens

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

If possible, I suggest you build a new CD yourself and either mail or upload it to someone who can put it in the tray for you. Use a VM to create and test the image until you can get it 100% non-interactive. Remember, you only need the most basic features. A running system with SSH and one user is enough. The rest you can do (carefully) remotely.

I haven't done this with Squeeze yet, but I assume the process is similar. Worst case, you can autoinstall Lenny and upgrade to Squeeze.

You'll need as a prerequisite a preseed file. Use debconf-get-selections to generate this. Start with the output of that command and edit as necessary. See Debian's official documentation for preseeding the installer for any information you need about the preseed contents.

1) Download an ISO from Debian.
2) Mount and copy the CD contents

mount -o loop debian-508-amd64-netinst.iso /mnt
mkdir ~/autoinstall
rsync -a -H --exclude=TRANS.TBL /mnt/ ~/autoinstall/

3) Edit isolinux/isolinux.cfg and replace the entire contents with the following:

default install

LABEL install
   kernel /install.amd/vmlinuz
   append vga=normal initrd=/install.amd/initrd.gz preseed/file=/cdrom/preseed.txt debian-installer/locale=en_US console-keymaps-at/keymap=us --
LABEL linux
   kernel /install.amd/vmlinuz
   append vga=normal initrd=/install.amd/initrd.gz preseed/file=/cdrom/preseed.txt debian-installer/locale=en_US console-keymaps-at/keymap=us --

prompt 0
timeout 0

4) Place your preseed data in the root of the CD image (in this case ~/autoinstall) named preseed.txt.
5) Build the image.

cd ~/autoinstall/
mkisofs -o ~/autoinstall.iso -r -J -no-emul-boot -boot-load-size 4  -boot-info-table -b isolinux/isolinux.bin -c isolinux/boot.cat ~/autoinstall/

You can now use the image to boot from for a VM. Anywhere the installer asks you a question, add that answer to the pressed.txt file and repeat steps 4 & 5.

Keep doing this until you have a viable installer. You'll likely build 20-30 images while tweaking your preseed file until you get it right. Make sure you include openssh-server in pkgsel/include and you should be able to remotely log in.

share|improve this answer
Hello Bahamat, thank you very much vor your help!! –  jens Feb 23 '11 at 14:53
add comment

Your Answer


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.