良许Linux教程网 干货合集 Ubuntu中搭建无人值守安装系统具体步骤

Ubuntu中搭建无人值守安装系统具体步骤

无人值守安装(也称静默安装)是指软件或系统安装时无需任何用户的干预,直接按默认或通过应答文件设置安装,这对于无特殊需求的用户或企业大批量部署安装操作系统及软件时非常的方便,本篇文章为大家讲解一下ubuntu中搭建无人值守安装系统具体步骤。

Ubuntu中搭建无人值守安装系统具体步骤

环境

Ubuntu-desktop(ip:192.168.56.11)

安装软件

apt install dnsmasq apache2 system-config-kickstart

配置dnsmasq

vim /etc/dnsmasq.conf

bogus-priv
filterwin2k
interface=eth0
dhcp-range=192.168.5.150,192.168.5.250,12h  
dhcp-boot=pxelinux.0  
enable-tftp  
tftp-root=/var/ftpd  
dhcp-authoritative

创建必要的目录

mkdir /var/ftpd
mkdir /var/www/ubuntu

挂载安装介质

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

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

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

修改apache2配置文件

vim /etc/apache2/sites-enabled/000-default.conf

DocumentRoot /var/www
#这里只给出了关键配置

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

编辑响应文件ks.cfg

vim /var/www/ks.cfg

#Generated by Kickstart Configurator
#platform=AMD64 or Intel EM64T

install
text
#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard us
#System mouse
mouse
#System timezone
timezone --utc Asia/Shanghai
#Root password
rootpw --disabled
#Initial user
user wsfnk --fullname "wsfnk" --iscrypted --password $1$Q4SPUaqc$KCsPmeMevJS0zzrqLTeVw0
#Reboot after installation
reboot
#Use text mode install
#text
#Install OS instead of upgrade
#install
#Use Web installation
url --url http://192.168.56.11/ubuntu
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part swap --size 512
part /boot --fstype ext4 --size 200
part / --fstype ext4 --size 1 --grow
#System authorization infomation
auth  --useshadow  --enablemd5
#Firewall configuration
firewall --disabled
#Do not configure the X Window System
skipx
%packages
openssh-server
openssh-client
gcc
g++
vim
curl

编辑引导文件

vim /var/ftpd/pxelinux.cfg/default

path ubuntu-installer/amd64/boot-screens/
include ubuntu-installer/amd64/boot-screens/menu.cfg
default ubuntu-installer/amd64/boot-screens/vesamenu.c32
default install
label install
kernel ubuntu-installer/amd64/linux
append ks=http://192.168.56.11/ks.cfg initrd=ubuntu-installer/amd64/initrd.gz --
prompt 0
timeout 0

启动相关服务

systemctl start apache2
systemctl start dnsmasq

若安装出现如下错误,

部署ubuntu无人值守安装系统部署ubuntu无人值守安装系统
部署ubuntu无人值守安装系统部署ubuntu无人值守安装系统
部署ubuntu无人值守安装系统部署ubuntu无人值守安装系统
部署ubuntu无人值守安装系统部署ubuntu无人值守安装系统

请在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.cfg

default install
label install
menu label ^Install
kernel ubuntu-installer/amd64/linux
append 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

以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !

img
本文由 良许Linux教程网 发布,可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。
良许

作者: 良许

良许,世界500强企业Linux开发工程师,公众号【良许Linux】的作者,全网拥有超30W粉丝。个人标签:创业者,CSDN学院讲师,副业达人,流量玩家,摄影爱好者。
上一篇
下一篇

发表评论

联系我们

联系我们

公众号:良许Linux

在线咨询: QQ交谈

邮箱: yychuyu@163.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部