下面按常见场景说明如何把 Debian 系统导入 Cobbler(用于自动化安装)。
mkdir -p /mnt/debian-iso
mount -o loop debian-12.0.0-amd64-DVD-1.iso /mnt/debian-iso
mkdir -p /var/www/cobbler/debian
debootstrap bookworm /var/www/cobbler/debian http://deb.debian.org/debian
cobbler import \
--path=/mnt/debian-iso \
--name=debian12 \
--arch=x86_64
Cobbler 会自动:
linux / initrd.gzcobbler distro list
cobbler profile list
示例输出:
debian12-x86_64
debian12-x86_64
cobbler setting edit --name=manage_dhcp --value=1
cobbler sync
systemctl enable --now tftp
systemctl enable --now httpd # 或 nginx
Debian 使用 preseed,不是 Kickstart。
/var/lib/cobbler/kickstarts/debian.preseed
示例:
d-i debian-installer/locale string en_US
d-i keyboard-configuration/xkb-keymap select us
d-i netcfg/get_hostname string debian-client
d-i mirror/country string manual
d-i mirror/http/hostname string deb.debian.org
d-i mirror/http/directory string /debian
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic
d-i passwd/root-password password cobbler
d-i passwd/root-password-again password cobbler
d-i passwd/user-fullname string cobbler
d-i passwd/username string cobbler
d-i passwd/user-password password cobbler
d-i passwd/user-password-again password cobbler
d-i pkgsel/include string openssh-server vim
d-i finish-install/reboot_in_progress note
cobbler profile edit \
--name=debian12-x86_64 \
--kickstart=/var/lib/cobbler/kickstarts/debian.preseed
Debian 需要告知安装器使用 preseed:
cobbler profile edit \
--name=debian12-x86_64 \
--kopts="auto=true priority=critical url=http://<cobbler_ip>/cobbler/ks_mirror/debian12/preseed/debian.preseed"
或通过 Web UI 配置。
cobbler sync
从客户端:
install.amd 或 install.386auto=true priority=critical 必须加ISO / Mirror
↓
cobbler import
↓
profile
↓
preseed
↓
PXE 自动安装
如果你愿意,我可以: