KickStart+PXE+HTTPd+DHCP+TFTP自动安装Ubuntu 12.04

字体大小: 中小 标准 ->行高大小: 标准

前言*

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

一、环境及软件

系统:CentOS 6.0、Ubuntu 12.04

软件:KickStart、PXE、HTTPd、TFTPp、DHCP

二、正式安装

本环境是基于在CentOS系统上搭建KickStart Ubuntu自动安装服务端。

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

安装完后然后配置

1、配置ftfp:

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

把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如下:

KickStart+PXE+HTTPd+DHCP+TFTP自动安装Ubuntu 12.04

2、配置httpd、kickstart:

正如第二步截图里面有一个http://192.9.117.143/ubuntu/ks.cfg

默认安装完后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   text  
  2. lang en_US   langsupport en_US  
  3. keyboard us   mouse  
  4. timezone --utc Asia/Chongqing   rootpw --disabled  
  5. user tdt --fullname="tdt" --password wuguangke   reboot  
  6. url --url http://192.9.117.143/ubuntu   bootloader --location=mbr 
  7. zerombr yes   clearpart --all --initlabel  
  8. part /boot --fstype ext4 --size 200   part swap --size 1024  
  9. part / --fstype ext4 --size 1 --grow   auth --useshadow --enablemd5  
  10. network --bootproto=dhcp --device=eth0  firewall --disabled  
  11. skipx   %packages  
  12. penssh-server   openssh-client  
  13. nfs-kernel-server   vim 

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/66675.html