Ubuntu 16.04 PXE+kickstart部署系统
2024-08-23 10:31:21
#PXE+TFTP+Kickstart 自动部署服务器系统
系统Ubuntu16.04
apt-get install isc-dhcp-server
vim /etc/default/isc-dhcp-server
INTERFACES="ens160"
在 /etc/dhcp/dhcpd.conf追加
allow booting;
allow bootp;
ddns-update-style interim;
ignore client-updates;
subnet 172.16.80.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option domain-name-servers 172.16.80.0;
range dynamic-bootp 172.16.80.220 172.16.80.230;
default-lease-time ;
max-lease-time ;
next-server 172.16.80.26;
filename "pxelinux.0";
}
#重启dhcp服务
service isc-dhcp-server restart
#安装tftp服务
apt-get install tftpd-hpa
#安装nginx
apt-get install nginx
#上传系统镜像到主机放到/usr/local/src,然后挂载到nginx网站目录
mount /usr/local/src/ubuntu-16.04.3-server-amd64.iso /var/www/html/ubuntu
cp -r /var/www/html/ubuntu/install/netboot/* /var/lib/tftpboot/
cp /var/www/html/ubuntu/preseed/ubuntu-server.seed /var/www/html/
#vim /var/www/html/ubuntu-server.seed 末尾添加:
d-i live-installer/net-image string http://10.0.0.100/ubuntu/install/filesystem.squashfs
d-i pkgsel/include string openssh-server
安装kickstart
vim /var/www/html/ks.cfg
#Generated by Kickstart Configurator
#platform=AMD64 or Intel EM64T #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 ddif --fullname "ddif" --iscrypted --password $$Umx1cgrj$..pRArN7AP66XBosYbU4N1
user ddif --fullname "ddif" --password BosYbU4N1
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use Web installation
url --url http://172.16.80.25/ubuntu
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part / --fstype ext4 --size --asprimary --ondisk sda
part swap --size --ondisk sda
#System authorization infomation
auth --useshadow --enablemd5
#Firewall configuration
firewall --disabled
#Do not configure the X Window System
skipx
%post
echo "deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted" > /etc/apt/sources.list
echo "deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted" >> /etc/apt/sources.list
echo "deb http://cn.archive.ubuntu.com/ubuntu/ xenial universe" >> /etc/apt/sources.list
echo "deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe" >> /etc/apt/sources.list
echo "deb http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse" >> /etc/apt/sources.list
echo "deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse" >> /etc/apt/sources.list
echo "deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list
修改一下 /var/lib/tftpboot/ubuntu-installer/amd64/boot-screens/txt.cfg
default install
label install
menu label ^Install
menu default
kernel ubuntu-installer/amd64/linux
append ks=http://172.16.80.25/ks.cfg preseed/url=http://172.16.80.25/ubuntu-server.seed netcfg/get_nameservers=172.16.80.25 vga=788 initrd=ubuntu-installer/amd64/initrd.gz --- quiet
label cli
menu label ^Command-line install
kernel ubuntu-installer/amd64/linux
append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga= initrd=ubuntu-installer/amd64/initrd.gz --- quiet
最新文章
- Android编译过程中的碎碎念
- JSON Web Token实际应用
- 实现Discuz论坛客户端应用源码
- sar命令的使用
- [转]搬瓦工换机房换ip之后不能连外网
- redis-key2
- Python tab键自动补齐
- jsp状态管理
- android中的MVP模式
- Siri开源了,33%的开发者持疑虑态度,你呢?
- The executable was signed with invalid entitlements.
- poj1503---大数加法
- 微信公众号开发C#系列-8、自定义菜单及菜单响应事件的处理
- 【JVM】类加载机制
- 关于mdb数据库在插入过程中报错->;Syntax error in INSERT INTO statement.(sql语句没问题)
- Docker镜像仓库Harbor搭建及配置
- centos的防火墙相关
- css 实现背景图片不跟着滚动条滚动而滚动
- Python常用模块--base64
- (转)ASP.NET MVC 4 RC的JS/CSS打包压缩功能
热门文章
- HTTP协议解析小白文
- 关于UDP通信的参考目录
- apt源换国内源
- 通过javascri实现输入框只能输入数字
- Matlab高级教程_第三篇:Matlab转码C/C++方式(混编)_第一部分
- HDU-4614 Vases and Flowers(线段树区间更新+二分查找)
- Codeforces Round #579 (Div. 3) Complete the Projects(贪心、DP)
- 48)PHP,工厂模式
- 吴裕雄--天生自然python学习笔记:python 用 Open CV 进行人脸识别
- jquery JavaScript如何监听button事件