advanced installer 怎么在安装时修改文件内容_部署ubuntu无人值守安装系统

fc7caac39b3be4eadf95d0a65324fda3.gif

无人值守安装(Unattended Setup)指软件安装时无需任何用户干预,直接按默认或通过应答文件设置安装,这对于无特殊需求的用户或企业大批量部署安装操作系统及软件时非常方便。

环境

Ubuntu-desktop(ip:192.168.56.11)

安装软件

apt install dnsmasq apache2 system-config-kickstart

配置dnsmasq

vim /etc/dnsmasq.confbogus-privfilterwin2kinterface=eth0dhcp-range=192.168.5.150,192.168.5.250,12hdhcp-boot=pxelinux.0enable-tftptftp-root=/var/ftpddhcp-authoritative

创建必要的目录

mkdir /var/ftpdmkdir /var/www/ubuntu

挂载安装介质

mount /dev/cdroom /mntcp /mnt/* /var/www/ubuntu -arf

将网络启动文件复制到网络引导目录

cp /var/www/ubuntu/install/netboot/* /var/ftpd -arf/

修改apache2配置文件

vim /etc/apache2/sites-enabled/000-default.confDocumentRoot /var/www#这里只给出了关键配置

运行system-config-kickstart生成ks.cfg文件

编辑响应文件ks.cfg

vim /var/www/ks.cfg#Generated by Kickstart Configurator#platform=AMD64 or Intel EM64Tinstalltext#System languagelang en_US#Language modules to installlangsupport en_US#System keyboardkeyboard us#System mousemouse#System timezonetimezone --utc Asia/Shanghai#Root passwordrootpw --disabled#Initial useruser wsfnk --fullname "wsfnk" --iscrypted --password $1$Q4SPUaqc$KCsPmeMevJS0zzrqLTeVw0#Reboot after installationreboot#Use text mode install#text#Install OS instead of upgrade#install#Use Web installationurl --url http://192.168.56.11/ubuntu#System bootloader configurationbootloader --location=mbr#Clear the Master Boot Recordzerombr yes#Partition clearing informationclearpart --all --initlabel#Disk partitioning informationpart swap --size 512part /boot --fstype ext4 --size 200part / --fstype ext4 --size 1 --grow#System authorization infomationauth --useshadow --enablemd5#Firewall configurationfirewall --disabled#Do not configure the X Window Systemskipx%packagesopenssh-serveropenssh-clientgccg++vimcurl

编辑引导文件

vim /var/ftpd/pxelinux.cfg/defaultpath ubuntu-installer/amd64/boot-screens/include ubuntu-installer/amd64/boot-screens/menu.cfgdefault ubuntu-installer/amd64/boot-screens/vesamenu.c32default installlabel installkernel ubuntu-installer/amd64/linuxappend ks=http://192.168.56.11/ks.cfg initrd=ubuntu-installer/amd64/initrd.gz --prompt 0timeout 0

启动相关服务

systemctl start apache2systemctl start dnsmasq

若安装出现如下错误,

e0520990bed135a2eef930ae499bfcd9.png

491ad7173fbd7e245089d770bf1bb182.png

请在ubuntu-installer/amd64/boot-screens/txt.cfg里,append加入如下配置

live-installer/net-image=http://192.168.56.11/ubuntu/install/filesystem.squashfs clock-setup/ntp=false ip=dhcp ksdevice=bootif

解决图片所示的错误

vim /var/ftpd/ubuntu-installer/amd64/boot-screens/txt.cfgdefault installlabel installmenu label ^Installkernel ubuntu-installer/amd64/linuxappend ks=http://192.168.56.11/ks.cfg vga=788 initrd=ubuntu-installer/amd64/initrd.gz live-installer/net-image=http://192.168.56.11/ubuntu/install/filesystem.squashfs clock-setup/ntp=false ip=dhcp ksdevice=bootif --- quit

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值