博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
kickstart+pxe+httpd+dhcp+tftp自动安装Ubuntu 12.04
阅读量:7041 次
发布时间:2019-06-28

本文共 2470 字,大约阅读时间需要 8 分钟。

   前言* kickstart很多运维人员都非常熟悉,我们大多数都用它来实现自动安装系统,常见的用自动安装redhat,最近由于业务需求,需要安装Ubuntu,redhat还是有一些区别,记录安装步骤,供大家相互交流和学习!

一、环境及软件

系统:Centos6.0Ubuntu12.04

软件:kickstartpxehttpdtftpdhcp

二、正式安装

本环境是基于在centos系统上搭建kickstart ubuntu自动安装服务端。

在服务器端执行:yum install dhcp* tftp* httpd* -y

安装完后然后配置

1、配置ftfp

 
  1. default: off  
  2.  
  3. # description: The tftp server serves files using the trivial file transfer \  
  4.  
  5. #       protocol.  The tftp protocol is often used to boot diskless \  
  6.  
  7. #       workstations, download configuration files to network-aware printers, \  
  8.  
  9. #       and to start the installation process for some operating systems.  
  10.  
  11. service tftp  
  12.  
  13. {  
  14.  
  15.         disable = no  
  16.  
  17.         socket_type             = dgram  
  18.  
  19.         protocol                = udp  
  20.  
  21.         wait                    = yes  
  22.  
  23.         user                    = root  
  24.  
  25.         server                  = /usr/sbin/in.tftpd  
  26.  
  27.         server_args             = -s /var/lib/tftpboot  
  28.  
  29.         per_source              = 11  
  30.  
  31.         cps                     = 100 2  
  32.  
  33.         flags                   = IPv4  
  34.  

disable=yes改成disable=no即可!

安装完tftp后,默认在/根目录会生成/tftpboot文件夹,如果没有请链接ln –s /var/lib/tftboot  /即可。

挂载ubuntu12.04.iso文件

Mount /dev/cdrom /mnt &&cp /mnt/install/netboot/*  /tftboot/

然后修改vi  /tftboot/ubuntu-installer/amd64/boot-screens/txt.cfg如下:

2、配置httpdkickstart:

正如第二步截图里面有一个

默认安装完后apache的发布目录为/var/www/html

/var/www/html下建立安装源:

mkdir  -p /var/www/html/ubuntu

然后将ubuntu光盘所有文件拷贝到/var/www/html/ubuntu

cp -a  /mnt/* /var/www/html/ubuntu

然后在/var/www/html/ubuntu目录下新建ks.cfg文件,权限设置为chmod 777 ks.cfg

ks.cfg内容如下:

 
  1. install  
  2. text  
  3. lang en_US  
  4. langsupport en_US  
  5. keyboard us  
  6. mouse  
  7. timezone --utc Asia/Chongqing  
  8. rootpw --disabled  
  9. user tdt --fullname="tdt" --password wuguangke  
  10. reboot  
  11. url --url http://192.9.117.143/ubuntu  
  12. bootloader --location=mbr 
  13. zerombr yes  
  14. clearpart --all --initlabel  
  15. part /boot --fstype ext4 --size 200  
  16. part swap --size 1024  
  17. part / --fstype ext4 --size 1 --grow  
  18. auth --useshadow --enablemd5  
  19. network --bootproto=dhcp --device=eth0 
  20. firewall --disabled  
  21. skipx  
  22. %packages  
  23. penssh-server  
  24. openssh-client  
  25. nfs-kernel-server  
  26. vim 

3、配置dhcp:

下面贴出我真实环境的DHCP配置内容:

 
  1. ddns-update-style interim;  
  2. ignore client-updates;  
  3. next-server 192.9.117.143;  
  4. filename "pxelinux.0";  
  5. allow booting;  
  6. allow bootp;  
  7. subnet 192.9.117.0 netmask 255.255.255.0 {  
  8. # — default gateway  
  9.  
  10. option routers 192.9.117.254;  
  11.  
  12. option subnet-mask 255.255.255.0;  
  13.  
  14. # option nis-domain “domain.org”;  
  15.  
  16. option domain-name "tdt.com";  
  17.  
  18. option domain-name-servers 202.106.0.20;  
  19.  
  20. option time-offset -18000; # Eastern Standard Time  
  21.  
  22. range 192.9.117.140 192.9.117.160;  
  23. }

三、启动服务

以上所有配置完毕,启动所有相关服务

/etc/init.d/dhcpd  start ;/etc/init.d/xinetd start ;/etc/init.d/httpd start 即可!

四、测试kickstart是否成功

找一台客户机,BIOS修改成网卡启动即可!

安装图集:

这一步需要手动回车,之后就不需要回车了:

格式化磁盘

安装软件包

 参考以下文章,非常感谢!

 

转载地址:http://bital.baihongyu.com/

你可能感兴趣的文章
JavaScript 作用域
查看>>
Linux Ubuntu 16.04 主机名设置
查看>>
CCNP 静态路由
查看>>
单链表二[不带头节点链表]
查看>>
Spring mvc 拦截器
查看>>
MySQL GROUP BY 和GROUP_CONCAT的一些用法
查看>>
## mysqldump 导出数据库各参数详细说明
查看>>
java中URL编码和中文相互转换
查看>>
影评:《云图》:生命并非微不足道
查看>>
hibernate4之一对一关系映射(二)
查看>>
我的友情链接
查看>>
Android第五课 编译错误分析
查看>>
VS_远程调试
查看>>
博为峰Java技术题 ——JavaSE Java实现在不同编码之间进行文件转换
查看>>
Throws与Throw
查看>>
php趣味编程 - php求黑色星期五
查看>>
zabbix安装
查看>>
ELK之权限管理
查看>>
×_7_12_2013 I: Light on or off
查看>>
JIT
查看>>