Skip to content

Instantly share code, notes, and snippets.

@nicopace
Created February 22, 2018 03:02
Show Gist options
  • Select an option

  • Save nicopace/0e25bb84f5b9e1d6471231e291fc1c94 to your computer and use it in GitHub Desktop.

Select an option

Save nicopace/0e25bb84f5b9e1d6471231e291fc1c94 to your computer and use it in GitHub Desktop.
Install Debian from network

Based on https://sowhatisthesolution.wordpress.com/2016/03/13/headless-debian-install-via-ssh/

wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.3.0-amd64-netinst.iso
sudo mount -o loop -t iso9660 debian-9.3.0-amd64-netinst.iso isoorig/
mkdir isonew
rsync -a -H –exclude=TRANS.TBL isoorig/ isonew
cd isonew
# edit all files defined here
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
# this goes to isolinux/isolinux.cfg
# D-I config version 2.0
# search path for the c32 support libraries (libcom32, libutil etc.)
path
include menu.cfg
default vesamenu.c32
prompt 0
timeout 4
#### 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
d-i keyboard-configuration/xkb-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
# this goes to isolinux/prompt.cfg
prompt 1
display f1.txt
timeout 4
include menu.cfg
include exithelp.cfg
f1 f1.txt
f2 f2.txt
f3 f3.txt
f4 f4.txt
f5 f5.txt
f6 f6.txt
f7 f7.txt
f8 f8.txt
f9 f9.txt
f0 f10.txt
# this goes to isolinux/txt.cfg
label install
menu label ^Install
kernel /install.amd/vmlinuz
append vga=788 initrd=/install.amd/initrd.gz --- quiet
label netinstall
menu label ^Install Over SSH
menu default
kernel /install.amd/vmlinuz
append auto=true vga=normal file=/cdrom/preseed.cfg initrd=/install.amd/initrd.gz locale=en_US console-keymaps-at/keymap=us
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment