ubuntu14.04部署kickstart
转自:http://www.mamicode.com/info-detail-1646465.html
kickstart用于在内网自动安装系统。
使用pxe安装系统需要安装dhcp,tftp,http等服务(当然也可以使用其他文件共享方式比如nfs,ftp)。
实验环境:
1. vmware 12
2.网段 10.0.0/8, PXE服务器IP:10.0.0.100
一、安装dhcp服务
可以选择安装isc-dhcp-Server 或者 dnsmasq(这个在openstack中使用较多,而且它也包含tftp服务,配置也非常方便,我因为已经安装dhcp和tftp就懒得换了)。
我选择安装了isc-dhcp-Server: apt-get install isc-dhcp-Server -y
vim /etc/default/isc-dhcp-server
INTERFACES="eth0" # 或者你要指定的网络接口名字。
vim /etc/dhcp/dhcpd.conf
在文件末尾添加:
subnet 10.0.0.0 netmask 255.0.0.0 {
range 10.0.0.101 10.0.0.200;
option subnet-mask 255.0.0.0;
option routers 10.0.0.100;
option broadcast-address 10.255.255.255;
filename "pxelinux.0";
next-server 10.0.0.100;
}
子网,掩码可以根据自己的需要设置
filename "pxelinux.0";
next-server 10.0.0.100; 指定pxe启动文件名和ip地址,next-server也是指tftp服务器IP。
配置完重启服务:
service isc-dhcp-server restart
二、安装tftp服务
apt-get install tftpd-hpa -y
安装完就OK了,使用默认的即可,记得tftp的目录是 /var/lib/tftpboot/ 哦,后面要用到!
三、安装apache2
apt-get install apache2 -y
也是安装完就可以了,http根目录是 /var/www/html/ 。
将下载好的ubuntu-14.04.5-server-amd64.iso放到某个目录。比如 ~ 目录,然后如下操作;
cd ~
mkdir /var/www/html/ubuntu
mount ubuntu-14.04.5-server-amd64.iso /var/www/html/ubuntu 或者 mount ubuntu-14.04.5-server-amd64.iso /media 然后 cp -r * /media/* /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
因为在ubuntu12.10版本以后,安装一些包会依赖于预配置的文件系统,这就是导致使用kickstart方式无法成功安装的原因。
四、安装kickstart
kickstart需要GUI界面,我因为是安装的server,所以需要安装桌面(如果是desktop版本就不需要),如下安装;
apt-get install ubuntu-desktop system-config-kickstart -y
安装完之后,重启一下进入桌面,直接startx在虚拟机里卡桌面。
kickstart界面操作很简单,实验过一遍就知道主要还是ks.cfg。如果vm的界面较小,需要远程的话,可以安装xrdp, vnc4server, 然后vim ~/.xsession 输入:xfc4-session
这里就不多说了,搜索一下就很多远程ubuntu的文章。
在界面操作完之后保存ks.cfg到/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 trait --fullname "trait" --iscrypted --password $1$Umx1cgrj$..pRArN7AP66XBosYbU4N1
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use Web installation
url --url http://10.0.0.100/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
%packages
openssh-server
%post
然后修改一下 vim /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://10.0.0.100/ks.cfg preseed/url=http://10.0.0.100/ubuntu-server.seed 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
ok,现在可以创建一个空的虚拟机来验证安装了。
测试结果基本成功,几个注意点:
ubuntu14.04部署kickstart的更多相关文章
- [原创]ubuntu14.04部署ELK+redis日志分析系统
ubuntu14.04部署ELK+redis日志分析系统 [环境] host1:172.17.0.4 搭建ELK+redis服务 host2:172.17.0.3 搭建logstash+nginx服务 ...
- ubuntu14.04 部署nfs服务
安装nfs服务 apt-get install nfs-kernel-server 修改配置文件,共享目录为/var/www,*号可替换为客户端IP地址,*默认为任何部署了nfs客户端的IP可以挂载该 ...
- Ubuntu14.04部署pyspider的过程
1.安装,安装官方文档,应该先执行 sudo apt-get install python python-dev python-distribute python-pip libcurl4-opens ...
- 阿里云 Ubuntu14.04 部署 LAMP
1.更新软件源 sudo apt-get update 2.安装Apache sudo apt-get install apache2 3.查看Apache是否安装成功 apache2 –v 如下所示 ...
- Ubuntu14.04 Django Mysql安装部署全过程
Ubuntu14.04 Django Mysql安装部署全过程 一.简要步骤.(阿里云Ubuntu14.04) Python安装 Django Mysql的安装与配置 记录一下我的部署过程,也方便 ...
- ubuntu14.04下nodejs + npm + bower的安装、调试和部署
1. 简介 本文介绍ubuntu14.04下nodejs+npm+bower的安装.调试和部署 参考文档 https://docs.npmjs.com/getting-started https: ...
- PXE+kickstart自动安装ubuntu14.04
本文参考了诸多文章,先感谢这些文章的作者. 使用pxe安装系统需要安装dhcp,tftp,http等服务(当然也可以使用其他文件共享方式比如nfs,ftp). 实验环境: 1. vmware 12 2 ...
- 使用openshit在ubuntu14.04下一键部署openstack(juno版本)
一.基本介绍 本实验是在vmware workstation上虚拟机ubuntu14.04(64bit,desktop)上部署openstack(Juno版本).采用的工具是openshit.open ...
- Ubuntu14.04下Mongodb(离线安装方式|非apt-get)安装部署步骤(图文详解)(博主推荐)
不多说,直接上干货! 说在前面的话 首先,查看下你的操作系统的版本. root@zhouls-virtual-machine:~# cat /etc/issue Ubuntu LTS \n \l r ...
随机推荐
- java动态规划导弹问题
这是一道动态规划题,和昨天的取硬币还有最长公共字串有点类似. 1.题目描述: 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一 ...
- 钉钉开发笔记(六)使用Google浏览器做真机页面调试
注: 参考文献:https://developers.google.com/web/ 部分字段为翻译文献,水平有限,如有错误敬请指正 步骤1: 从Windows,Mac或Linux计算机远程调试And ...
- Openssl ec命令
一.简介 椭圆曲线密钥处理工具 二.语法 openssl ec [-inform PEM|DER] [-outform PEM|DER] [-in filename] [-out filename] ...
- Openssl speed命令
一.简介 speed命令用于测试库的性能 二.语法 openssl speed [md2] [mdc2] [md5] [hmac] [sha1] [sha256] [sha512] [whirlpoo ...
- easyui页签更新
1.首先引入这个js文件 <script src="/Scripts/tabs.js" type="text/javascript"></sc ...
- QT学习之窗口部件
对话框--QDialog 模态对话框与非模态对话框 模态对话框:就是相当于没关闭它之前,不能再和该应用程序的其他窗口进行交互(比如新建项目时弹出的对话框) 非模态对话框:可以与它交互,也可以与该程序中 ...
- css 字体上下居中显示 解决安卓手机line-height的偏差
1.字体左右居中显示 text-align: center <div class="font"> 上下居中 </div> .font{ width: ...
- centOS下JDK1.8的安装
1.下载JDK1.8 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 有两种格式 ...
- 使用word写博客
目前大部分的博客作者在写博客这件事情上都会遇到以下3个痛点:1.所有博客平台关闭了文档发布接口,用户无法使用Word,Windows Live Writer等工具来发布博客.2.发布到博客或公众号平台 ...
- 编写高质量代码改善C#程序的157个建议——建议75:警惕线程不会立即启动
建议75:警惕线程不会立即启动 现代的大多数操作系统都不是一个实时的操作系统,Windows系统也是如此.所以,不能奢望我们的线程能够立即启动.Windows内部会实现特殊的算法以进行线程之间的调度, ...