您的位置:首页 > 其它

实现快速全自动Ubuntu批量安装的步骤

2013-01-10 12:50 846 查看
随着使用ubuntu系统的用户越来越多,对于一台PC机安装ubuntu系统来说并不是难事,但是如果对于企业里新增的几十台几十台服务器,一台一台安装,实在是太累,通过以下方法,很容易在1小时内将60台ubuntu系统安装好。

环境:

192.168.5.112dhcpserver,Ubuntu10.04

192.168.5.150-200dhcpclient,pxeboot

所有配置在192.168.5.112上进行

1.安装dnsmasq

apt-getinstalldnsmasq

2.配置dnsmasq

vi/etc/dnsmasq.conf

bogus-priv

filterwin2k

interface=eth0

dhcp-range=192.168.5.150,192.168.5.250,12h

dhcp-boot=pxelinux.0

enable-tftp

tftp-root=/var/ftpd

dhcp-authoritative

3.安装apache2并建立相关目录

apt-getinstallapache2

mkdir/var/www/Ubuntu

mount-oloop~/Ubuntu10.04.iso/mnt

cp/mnt/preseed/Ubuntu-server.seed/var/www/ubuntu

cp-a/mnt/*/var/www/Ubuntu

cp-r/mnt/install/netboot/*/var/ftpd/

4.修改pxe配置

vi/var/ftpd/pxelinux.cfg/default

labellinux

kernelUbuntu-installer/amd64/linux

appendks=http://192.168.5.112/Ubuntu/ks.cfgpreseed/url=http://192.168.5.112/ubuntu/ubuntu-server.seedvga=normalinitrd=ubuntu-installer/amd64/initrd.gz–

5.修改ks.cfg

viks.cfg

#Systemlanguage

langen_US

#Languagemodulestoinstall

langsupporten_US

#Systemkeyboard

keyboardus

#Systemmouse

mouse

#Systemtimezone

timezoneAsia/Chongqing

#Rootpassword

rootpw–disabled

#Initialusergaojinbo/gaojinbo.com

usergaojinbo–fullname"gaojinbo.com"–iscrypted–password$1$YKmaOIb5$/13bs7gCjaoH./ohFT0A7/

#Rebootafterinstallation

reboot

#Usetextmodeinstall

text

#InstallOSinsteadofupgrade

install

#UseWebinstallation

url–urlhttp://192.168.5.112/ubuntu

#Systembootloaderconfiguration

bootloader–location=mbr

#CleartheMasterBootRecord

zerombryes

#Partitionclearinginformation

clearpart–all–initlabel

#Diskpartitioninginformation

part/–fstypeext4–size10000

partswap–size5000

auth–useshadow–enablemd5

#network–bootproto=dhcp–device=eth0

network–bootproto=static–ip=192.168.5.168–netmask=255.255.255.0–gateway=192.168.5.112–nameserver=221.5.88.88–device=eth0

firewall–disabled

skipx

%packages

@openssh-server

注:

生成密码

echogaojinbo.com|opensslpasswd-1-stdin

6.修改Ubuntu-server.seed配置

viUbuntu-server.seed

#SuggestLVMbydefault.

d-ipartman-auto/init_automatically_partitionstringsome_device_lvm

d-ipartman-auto/init_automatically_partitionseenfalse

#Alwaysinstalltheserverkernel.

d-ibase-installer/kernel/override-imagestringlinux-server

#InstalltheUbuntuServerseed.

taskseltasksel/force-tasksstringserver

#Onlyinstallbasiclanguagepacks.Lettaskselaskabouttasks.

d-ipkgsel/language-pack-patternsstring

#Nolanguagesupportpackages.

d-ipkgsel/install-language-supportbooleanfalse

#OnlyasktheUTCquestionifthereareotheroperatingsystemsinstalled.

d-iclock-setup/utcbooleanfalse

d-iclock-setup/ntpbooleanfalse

d-iapt-setup/use_mirrorbooleanfalse

d-inetcfg/get_ipaddressstring127.0.0.1

d-imirror/http://hostnamestring127.0.0.1

d-iapt-setup/restrictedbooleanfalse

#Nobootsplashscreen.

d-idebian-installer/splashbooleanfalse

#Installthedebconfoem-configfrontend(ifinOEMmode).

d-ioem-config-udeb/frontendstringdebconf

#Addthenetworkandtasksoem-configstepsbydefault.

oem-configoem-config/stepsmultiselectlanguage,timezone,keyboard,user,network,tasks

7.重启dnsmasq

/etc/init.d/dnsmasqrestart

很简单吧,7个步骤完成!

总结:

全自动Ubuntu批量安装,1小时安装60台,步骤简单,大家可以自己动手操作一下。希望本文能够对大家有所帮助,更多有关linux系统的知识还有待于读者去探索和学习。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: