4

Question in short:
How to install an alternative OS (debian preferred) on a headless server and what OS to use for a home media/dataserver.

My questions now is:

How to do it? The server will, in rescue mode, accept an PXE boot image via tftp. But from that point on the whole process needs to run completely automatic until the point where the server accepts an ssh login as there is absolutely no possibility to hook up an display to that server without breaking it open and soldering VGA cables.

The solution: In the end I used a PXE preseeded booting... i packed the preseed.cfg into the initrd.gz file and pushed everything to the machine on netboot via DHCP/TFTP.

3
  • How does this relate to the windows-home-server OS and tag? Jan 18, 2012 at 13:07
  • At the moment it is a windows home server, maybe there's some software that i can use under the running windows server 2003 operating system that will reboot the server into a new os or something like that.
    – bardiir
    Jan 18, 2012 at 14:01
  • According to our friends over at serverfault, FAI seems the way to go. Mar 18, 2012 at 19:53

3 Answers 3

2
+150

What you are describing is a preseeded PXE install. Just make sure you fill out the seed-file correctly (use the example) or the setup will halt.

1
  • HOw can this be done to INstall Windows Server 2012? There are people who do this but I cannot find any details.
    – Piotr Kula
    Jan 13, 2014 at 17:22
1

Here is a reasonably detailed writeup (from a year back) of how to do this with Fedora (as source and target). He does the trick by telling the pxe image to connect to a listening vnc client on the source computer so he can interact with the (graphical) installer through the network.

Apparently, Debian does not support using vnc in this way, though the only sources I could find were badly spelled and from embedded systems vendors.

However, it is quite possible to install Debian from within a different Linux install. The process is even described in what seems to be an official manual.

If you choose to try it, I suggest you attempt it on a virtual machine first.

1

Based on the article Installing Debian using only SSH :

Your headless machine should be set to boot off CD for this procedure to work.

A. Download your netinst cd image variant, for example :

wget http://cdimage.debian.org/debian-cd/6.0.4/i386/iso-cd/debian-6.0.4-i386-netinst.iso

B. Mount the ISO to a folder, let’s call it isoorig

mkdir isoorig
mount -o loop -t iso9660 debian-6.0.4-i386-netinst.iso isoorig

C. Extract to new folder called isonew

mkdir isonew<br>
rsync -a -H –exclude=TRANS.TBL isoorig/ isonew

D. Change the menu to load SSH on boot by default

/isonew# nano isolinux/txt.cfg

DELETE: remove "menu default" from "label install"
ADD:

label netinstall
menu label ^Install Over SSH
menu default
kernel /install.386/vmlinuz
append auto=true vga=normal file=/cdrom/preseed.cfg initrd=/install.386/initrd.gz locale=en_US console-keymaps-at/keymap=us

CHANGE: "default install" to "default netinstall"

EDIT both files below and change “timeout 0″ to “timeout 4″ to make it auto select netinstall

nano isolinux/isolinux.cfg
nano isolinux/prompt.cfg

E. Create preseed.cfg file

nano isonew/preseed.cfg

F. PASTE this to the preseed file:

#### Contents of the preconfiguration file
### Localization
# Locale sets language and country.
d-i debian-installer/locale select en_US
# Keyboard selection.
d-i console-keymaps-at/keymap select us
### Network configuration
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto
# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string newdebian
d-i netcfg/get_domain string local
# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string
# The wacky dhcp hostname that some ISPs use as a password of sorts.
#d-i netcfg/dhcp_hostname string radish
d-i preseed/early_command string anna-install network-console
# Setup ssh password
d-i network-console/password password install
d-i network-console/password-again password install

G. Recreate md5sum.txt file

md5sum `find -follow -type f` > md5sum.txt

H. Create your new iso image

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

The image should be ready to burn. This loads everything automatically and goes to the SSH screen.

3
  • The machine hasn't got a cd-drive and it won't boot from usb. It won't even boot from a harddrive that has been formatted outside the machine. The only solution for this was via PXE boot for me.
    – bardiir
    Mar 19, 2012 at 18:51
  • Nontheless this is pretty useful for the preseed file. I packed the file into an initrd.gz filesystem image and then sent that to the machine via PXE boot.
    – bardiir
    Mar 19, 2012 at 18:55
  • I have no experience with PXE boot, but I figured you would find this useful.
    – harrymc
    Mar 19, 2012 at 18:59

You must log in to answer this question.

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