264 lines
6.4 KiB
Markdown
264 lines
6.4 KiB
Markdown
# Debian 13 Fully Unattended ISO – EXTREM DETAILLIERTE ANLEITUNG
|
||
|
||
Ziel: Eine **komplett automatisierte Debian 13 ISO** bauen, die:
|
||
|
||
- ohne Benutzerinteraktion installiert (unattended)
|
||
- automatisch startet (kein GRUB-Menü)
|
||
- Sprache, Tastatur, Zeitzone setzt
|
||
- statische Netzwerkkonfiguration verwendet (IP / Gateway / DNS)
|
||
- Root + User inkl. Passwort erstellt
|
||
- automatisch partitioniert (LVM)
|
||
- GRUB installiert
|
||
- automatisch rebootet
|
||
|
||
Diese Anleitung ist bewusst **sehr detailliert und deterministisch**, damit auch eine einfache KI sie korrekt ausführen kann.
|
||
|
||
---
|
||
|
||
# 0. WICHTIGE GRUNDLOGIK
|
||
|
||
Die Automatisierung basiert auf:
|
||
|
||
1. **preseed.cfg** → enthält alle Antworten für den Debian Installer
|
||
2. **Bootparameter** → sorgen dafür, dass preseed geladen wird
|
||
3. **GRUB + ISOLINUX Anpassung** → damit KEIN Menü erscheint
|
||
|
||
---
|
||
|
||
# 1. SYSTEM VORBEREITEN
|
||
|
||
## 1.1 Pakete installieren
|
||
|
||
```bash
|
||
apt update
|
||
apt install -y xorriso syslinux isolinux grub-pc-bin grub-efi-amd64-bin mtools dosfstools
|
||
|
||
mkdir -p ~/debian-auto-iso/{src,iso,build}
|
||
cd ~/debian-auto-iso
|
||
~/debian-auto-iso/
|
||
├── src/ (Original ISO)
|
||
├── iso/ (entpackte ISO – wird bearbeitet)
|
||
└── build/ (fertige ISO)
|
||
|
||
cd ~/debian-auto-iso/src
|
||
wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-13.0.0-amd64-netinst.iso
|
||
|
||
cd ~/debian-auto-iso
|
||
xorriso -osirrox on \
|
||
-indev src/debian-13.0.0-amd64-netinst.iso \
|
||
-extract / iso
|
||
|
||
chmod -R u+w iso
|
||
|
||
nano iso/preseed.cfg
|
||
|
||
### --------------------------------
|
||
### LOKALISIERUNG
|
||
### --------------------------------
|
||
d-i debian-installer/locale string de_DE.UTF-8
|
||
d-i keyboard-configuration/xkb-keymap select de
|
||
d-i console-setup/ask_detect boolean false
|
||
|
||
### --------------------------------
|
||
### NETZWERK (STATISCH!)
|
||
### --------------------------------
|
||
d-i netcfg/choose_interface select auto
|
||
d-i netcfg/disable_autoconfig boolean true
|
||
|
||
d-i netcfg/get_ipaddress string 192.168.100.10
|
||
d-i netcfg/get_netmask string 255.255.255.0
|
||
d-i netcfg/get_gateway string 192.168.100.1
|
||
d-i netcfg/get_nameservers string 192.168.100.1
|
||
|
||
d-i netcfg/confirm_static boolean true
|
||
d-i netcfg/get_hostname string debian-vm
|
||
d-i netcfg/get_domain string local
|
||
|
||
### --------------------------------
|
||
### ZEIT
|
||
### --------------------------------
|
||
d-i clock-setup/utc boolean true
|
||
d-i time/zone string Europe/Berlin
|
||
d-i clock-setup/ntp boolean true
|
||
|
||
### --------------------------------
|
||
### USER + PASSWÖRTER
|
||
### --------------------------------
|
||
d-i passwd/root-login boolean true
|
||
d-i passwd/root-password password rootpass
|
||
d-i passwd/root-password-again password rootpass
|
||
|
||
d-i passwd/user-fullname string Default User
|
||
d-i passwd/username string user
|
||
d-i passwd/user-password password userpass
|
||
d-i passwd/user-password-again password userpass
|
||
|
||
### --------------------------------
|
||
### PARTITIONIERUNG (AUTO LVM!)
|
||
### --------------------------------
|
||
d-i partman-auto/method string lvm
|
||
d-i partman-lvm/device_remove_lvm boolean true
|
||
d-i partman-auto/choose_recipe select atomic
|
||
|
||
d-i partman/confirm boolean true
|
||
d-i partman/confirm_nooverwrite boolean true
|
||
d-i partman/choose_partition select finish
|
||
|
||
### --------------------------------
|
||
### MIRROR
|
||
### --------------------------------
|
||
d-i mirror/country string manual
|
||
d-i mirror/http/hostname string deb.debian.org
|
||
d-i mirror/http/directory string /debian
|
||
d-i mirror/http/proxy string
|
||
|
||
### --------------------------------
|
||
### PAKETE
|
||
### --------------------------------
|
||
tasksel tasksel/first multiselect standard, ssh-server
|
||
|
||
d-i pkgsel/include string vim curl htop sudo
|
||
d-i pkgsel/upgrade select full-upgrade
|
||
|
||
popularity-contest popularity-contest/participate boolean false
|
||
|
||
### --------------------------------
|
||
### GRUB INSTALLATION
|
||
### --------------------------------
|
||
d-i grub-installer/only_debian boolean true
|
||
d-i grub-installer/bootdev string default
|
||
|
||
### --------------------------------
|
||
### INSTALLATION ABSCHLIESSEN
|
||
### --------------------------------
|
||
d-i finish-install/reboot_in_progress note
|
||
d-i cdrom-detect/eject boolean true
|
||
|
||
### --------------------------------
|
||
### LATE COMMAND (OPTIONAL)
|
||
### --------------------------------
|
||
d-i preseed/late_command string \
|
||
in-target systemctl enable ssh; \
|
||
in-target usermod -aG sudo user
|
||
|
||
|
||
nano iso/boot/grub/grub.cfg
|
||
|
||
set default=0
|
||
set timeout=0
|
||
|
||
menuentry "Debian Auto Install" {
|
||
linux /install.amd/vmlinuz auto=true priority=critical preseed/file=/cdrom/preseed.cfg ---
|
||
initrd /install.amd/initrd.gz
|
||
}
|
||
|
||
nano iso/isolinux/txt.cfg
|
||
|
||
default auto
|
||
timeout 0
|
||
|
||
label auto
|
||
menu label Auto Install Debian
|
||
kernel /install.amd/vmlinuz
|
||
append auto=true priority=critical preseed/file=/cdrom/preseed.cfg initrd=/install.amd/initrd.gz ---
|
||
|
||
|
||
cd ~/debian-auto-iso
|
||
|
||
xorriso -as mkisofs \
|
||
-r \
|
||
-V "DEBIAN_AUTO" \
|
||
-o build/debian-13-auto.iso \
|
||
-J -joliet-long -l \
|
||
-b isolinux/isolinux.bin \
|
||
-c isolinux/boot.cat \
|
||
-no-emul-boot \
|
||
-boot-load-size 4 \
|
||
-boot-info-table \
|
||
-eltorito-alt-boot \
|
||
-e boot/grub/efi.img \
|
||
-no-emul-boot \
|
||
-isohybrid-gpt-basdat \
|
||
iso
|
||
|
||
|
||
10. ERWARTETES VERHALTEN
|
||
|
||
Nach Boot:
|
||
|
||
KEIN Menü erscheint
|
||
Installer startet automatisch
|
||
Keine Eingaben notwendig
|
||
Installation läuft komplett durch
|
||
System rebootet automatisch
|
||
Login möglich mit:
|
||
user / userpass
|
||
root / rootpass
|
||
11. HÄUFIGE FEHLER + DEBUG
|
||
Installer fragt trotzdem Dinge ab
|
||
|
||
→ Ursache:
|
||
|
||
falscher Parameter: preseed/file= fehlt
|
||
falscher Pfad: /cdrom/preseed.cfg
|
||
Netzwerk funktioniert nicht
|
||
|
||
→ Ursache:
|
||
|
||
falsches Interface
|
||
falsche IP Range
|
||
Gateway nicht erreichbar
|
||
ISO bootet nicht (UEFI)
|
||
|
||
→ Ursache:
|
||
|
||
efi.img fehlt
|
||
xorriso Flags falsch
|
||
GRUB Menü erscheint trotzdem
|
||
|
||
→ Ursache:
|
||
|
||
timeout != 0
|
||
falsche cfg bearbeitet
|
||
|
||
|
||
|
||
METHODE 2 (BESTE LÖSUNG): ISO NACH INSTALLATION "EJECTEN"
|
||
Idee:
|
||
|
||
Installer wirft CD automatisch aus → VM bootet von HDD
|
||
|
||
PRESEED ERWEITERN
|
||
|
||
In preseed.cfg hinzufügen:
|
||
|
||
d-i cdrom-detect/eject boolean true
|
||
ZUSÄTZLICH (WICHTIG!):
|
||
d-i finish-install/keep-consoles boolean true
|
||
d-i finish-install/reboot_in_progress note
|
||
|
||
👉 Ergebnis:
|
||
|
||
ISO wird logisch "ausgeworfen"
|
||
viele Hypervisor erkennen das
|
||
Boot fällt automatisch auf HDD zurück
|
||
|
||
👉 Achtung:
|
||
Funktioniert zuverlässig bei:
|
||
|
||
Proxmox ✅
|
||
KVM/QEMU ✅
|
||
VMware ⚠️ (teilweise)
|
||
VirtualBox ⚠️ (oft nicht)
|
||
✅ METHODE 3 (PROFI / 100% LÖSUNG): VM-SEITIG BOOT FIXEN
|
||
BESTE UND SAUBERSTE LÖSUNG
|
||
|
||
Nicht ISO lösen – sondern VM korrekt konfigurieren.
|
||
|
||
🔧 PROXMOX
|
||
qm set <VMID> --boot order=scsi0
|
||
qm set <VMID> --cdrom none
|
||
|
||
Oder direkt beim Erstellen:
|
||
|
||
qm create 100 --boot order=scsi0
|