Remote server installations or Custom distro:
This is handy if you need to have preconfigured netinstall isos for remote installations of servers. Or maybe you just want to create a custom Debian based distro. At work I create these isos tailor made to suit our customers needs (more or less) then perform an automated remote installation.
The basic steps:
The basics are that you download a Debian Netinstall iso : http://www.debian.org/CD/netinst/
We mount the iso to a temporary directory, where we insert a “Preseed” file which has our custom settings configured. Then we recreate the iso.
Custom preseed file:
Before doing anything you need to get the example Preseed and edit it to your liking:
http://www.debian.org/releases/lenny/example-preseed.txt
**All of these commands are performed as Root in the /root home directory.**
You know the risks of running as root, and I will take for granted that you are an experienced Linux user who respects the responsibility of being root.
Lets create a custom iso:
Create a temporary direcory to mount the iso:
mkdir -p loopdir
mount -o loop debian_netinstall_iso.iso loopdir
Remove the cd dircetory
Recreate a new cd directory:
Now we Rsync everything over from the loopdir to our new cd directory:
Unmount the netinstall iso from loopdir:
Make a new directory to extract the initrd.gz, change to that directory and extract:
**Note**
The initrd.gz for the 64bit Netinstall iso is in /install.amd/. If this command fails it’s becuase it is somewhere else. Just have a look for it and change the command accordingly.
*One command at a time, don’t copy and paste both lines* (arguments are two dashes not one ” – -“)
Now we copy over our custom Preseed file to initrd:
*One command at a time, don’t copy and paste both lines*
Now we go back to the /root directory and remove the irmod directory:
Change to the cd directory and create an Md5sum:
Back to /root again to create your new iso:
*One command at a time, don’t copy and paste both lines*
Now you have your own custom iso which you can burn to CD or run in VirtualBox or a chosen Emulator. Have a good read of the Preseed documentation as you can configure practically everything on the Netinstall iso, including adding your own custom Debian applications, themes, etc. basically you can go from automated basic netinstall to full blown distro. It’s up to you.
Wouf, huge article!
It was a project for work, as we do remote Debian LAMP installs. A custom Netinstall saves a lot of time, especially as we use our own Debian mirror.