Cobbler 无人值守安装

Workstation下用ISO安装一台最小化centos5.5虚拟机

安装vmtools

wget
http://rpm.pbone.net/index.php3?stat=26&dist=52&size=12680&name=rpmforge-release-0.5.2-2.el5.rf.i386.rpm

rpm -ivhrpmforge-release-0.5.2-2.el5.rf.i386.rpm

yum install cobblertftp-server dhcp httpd xinetd

cobblercheck

vi/var/lib/cobbler/settings //把两处127.0.0.1ip改为虚拟机提供dhcptftpip17行的manage_dhcp 0改为1

vi/etc/xinetd.d/tftp
//
把第14行的= yes改为= no

yum installsystem-config-kickstart
//
图形化界面执行,生成kickstart的配置文件。我是google找了个ks.cfg文件按照我的配置稍微改了一下。

保存在/etc/cobbler目录文件内容如下

============================================================

#platform=x86, AMD64, orIntel EM64T

# System authorizationinformation

auth
--useshadow
--enablemd5

# System bootloaderconfiguration

bootloader--location=mbr

# Clear the Master BootRecord

zerombr

# Partition clearinginformation

clearpart --all--initlabel

# Use graphicalinstall

graphical

# Firewallconfiguration

firewall--disabled

# Run the Setup Agent onfirst boot

firstboot--disable

# Systemkeyboard

keyboardus

# Systemlanguage

langen_US

# Installation logginglevel

logging--level=info

# Use NFS installationmedia

nfs--server=192.168.161.161 --dir=/

# Networkinformation

network --bootproto=dhcp--device=eth0 --onboot=on

#Rootpassword

rootpw --iscrypted$1$zlwzVSO6$.mAx831sa.sEeK2Mjzkyh/

# SELinuxconfiguration

selinux--disabled

# Systemtimezone

timezone
Asia/Shanghai

# Install OS instead ofupgrade

install

# X Window Systemconfiguration information

xconfig
--defaultdesktop=GNOME --depth=16--resolution=1024x768

# Disk partitioninginformation

part swap--bytes-per-inode=4096 --fstype="swap" --size=1024

============================================================

cat /etc/cobbler/ks.cfg> /etc/cobbler/default.ks
//
默认的ks文件是空的,把刚才生成的ks.cfg文件写到默认文件里去

cp/usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf

vi/etc/dhcpd.conf

vi/etc/cobbler/dhcp.template

改成如下内容:根据实际情况可能有所不同

============================================================

ddns-update-styleinterim;

ignoreclient-updates;

subnet 192.168.161.0netmask 255.255.255.0 {

# --- defaultgateway


optionrouters
192.168.161.161;


optionsubnet-mask
255.255.255.0;


optionnis-domain
"domain.org";


optiondomain-name
"domain.org";


optiondomain-name-servers
192.168.161.161;


optiontime-offset
-18000; # Eastern Standard Time

#
optionntp-servers
192.168.1.1;

#
optionnetbios-name-servers
192.168.1.1;

# --- Selectspoint-to-point node (default is hybrid). Don't change thisunless

# -- you understandNetbios very well

#
optionnetbios-node-type 2;


range dynamic-bootp192.168.161.170 192.168.161.180;


default-lease-time21600;


max-lease-time43200;


# we want thenameserver to appear at a fixed address


host ns{


next-servermarvin.redhat.com;


hardware ethernet12:34:56:78:AB:CD;


fixed-address192.168.161.161;


}

}

============================================================

#******************************************************************

# Cobbler manageddhcpd.conf file

#

# generated from cobblerdhcp.conf template ($date)

#

#******************************************************************

ddns-update-styleinterim;

allowbooting;

allowbootp;

ignoreclient-updates;

set vendorclass = optionvendor-class-identifier;

subnet 192.168.161.0netmask 255.255.255.0 {


optionrouters
192.168.161.161;


optionsubnet-mask
255.255.255.0;


rangedynamic-bootp
192.168.161.162 192.168.161.180;


filename
"/pxelinux.0";


default-lease-time
21600;


max-lease-time
43200;


next-server
$next_server;

}

$insert_cobbler_system_definitions

============================================================

cobbler import--mirror=/media/CentOS --name=CentOS5.5
//
这步要很久。。。。。。喝茶去吧

cobbler list//检查一下

正常返回

distroCentOS5.5-xen-i386


profileCentOS5.5-xen-i386

distroCentOS5.5-i386


profileCentOS5.5-i386


cobblersync

service httpdstart

service xinetdstart

service dhcpdstart

service cobblerdstart

服务端到此配置完毕

客户端

Workstation新建一台虚拟机

选择网络启动

启动后会停留在boot

此时手工输入menu回车

然后选择第二项即可正常安装。


注意安装好的系统默认口令是:cobbler

 

转:http://bbs.linuxtone.org/forum-viewthread-tid-8793-page-1-extra.html#pid49007

11-19 08:06
查看更多