Ubuntu 16.04 PXE+kickstart部署系统

#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 21600;
max-lease-time 43200;
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 $1$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 1024 --asprimary --ondisk sda
part swap --size 800 --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=788 initrd=ubuntu-installer/amd64/initrd.gz --- quiet

原文地址:https://www.cnblogs.com/ddif/p/8955021.html

时间: 2024-08-02 05:48:02

Ubuntu 16.04 PXE+kickstart部署系统的相关文章

ubuntu 16.04 &windows 7双系统系统时间不一致,差8小时

Windows/Ubuntu 双系统用户会发现在 Ubuntu 里面的时间正常的情况下Windows的系统时间被改到8小时前. 原来 Linux 操作系统是以 CMOS 时间做为格林威治标准时间,再根据系统设置的时区来确定目前系统时间.但是Windows 会直接修改CMOS 时间.而中国的时区是+8区,所以才会造成时间被调整了-8个小时. 所以您可以让 Windows 去使用时区或者让 Ubuntu 使用本地时间. 修改 Windows 使用时区的方法是在注册表: HKEY_LOCAL_MACH

Ubuntu 16.04 LTS 64位系统 安装Docker

本文开发环境为Ubuntu 16.04 LTS 64位系统,通过apt的docker官方源安装最新的Docker CE(Community Edition),即Docker社区版,是开发人员和小型团队的理想选择. 开始安装 由于apt官方库里的docker版本可能比较旧,所以先卸载可能存在的旧版本: $ sudo apt-get remove docker docker-engine docker-ce docker.io 1 更新apt包索引: $ sudo apt-get update 1

在Ubuntu 16.04上安装Joomla系统

Joomla !是一个流行的内容管理系统(CMS),它是仅次于Wordpress的第二大流行的CMS.到2017年,约有3.3%的网站使用Joomla !作为他们的CMS.本文介绍了如何在Ubuntu 16.04上一键安装Joomla ! 步骤1:安装Apache更新存储库列表.apt-get update安装Apache web服务器.apt-get install apache2使用 LAMP stack 一键安装包安装Joomla!,我们需要安装MySQL并将其链接到PHP.apt-get

Ubuntu 16.04和win10双系统时间不一致解决办法

windows10和ubuntu16.04双系统,装完后,在windows下时间不对,之前的老办法是: 1 sudo gedit /etc/default/rcS 2 utc=yes 改成utc=no 然而我的16.04并没有这个.继续寻找, sudo  timedatectl set-local-rtc true  刚测试了,可行,记录一下.

Ubuntu 16.04.6 + Win10 双系统时间错误且不一致

1.在Win系统下,按Win键 + R,输入regedit 运行, 2.打开注册表,按照路径查找     计算机\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation 可以直接粘贴路径 3.右击新建一个QWORD值,64位系统就选64位(也可以32位),名称为   RealTimeIsUniversal    ,区分大小写, 双击编辑它,数值数据改为1,基数是16进制,确定. 4.重启电脑,按F2进入BIO

Ubuntu 16.04 新装服务器部署流程

1.设定时区 rm -f /etc/localtime cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 2.配置apt-get源 rm -f /etc/apt/sources.list wget -P /etc/apt/ http://mirrors.163.com/.help/sources.list.wily  mv /etc/apt/sources.list.wily /etc/apt/sources.list 3.修改主机名 vim

Ubuntu 16.04安装BleachBit清理系统垃圾文件

在LInux下不同于Windows会产生系统垃圾,但是Linux会产生安装软件时的依赖包,比如卸载一个软件,其依赖包是不会删除的.但是可以通过以下命令解决: #清理旧版本的软件缓存 sudo apt-get autoclean #清理所有软件缓存 sudo apt-get clean #删除系统不再使用的孤立软件 sudo apt-get autoremove 如果是GUI的工具,推荐BleachBit: 安装: sudo apt-get install bleachbit 启动: sudo b

Ubuntu 16.04 LTS

Ubuntu 16.04 LTS  64位系统 针对Android 6.0 sudo apt install git-core bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squas

Ubuntu 16.04 下安装 PyCharm

在ubuntu 16.04版本中,系统默认安装 了python 2.7和3.5版本,为了方便开发我们需要安装一个Python IDE,这里推荐使用PyCharm.PyCharm一个是Python集成开发环境,它既提供收费的专业版,也提供免费的社区版本.PyCharm带有一整套可以帮助用户在使用Python语言开发时提高其效率的工具,比如调试.语法高亮.Project管理.代码跳转.自动完成.单元测试等等. 为了方便升级,本文通过第三方源安装PyCharm. 1. 添加源: sudo add-ap