pxe安裝CentOS6.6系統

來源:互聯網
上載者:User

pxe安裝CentOS6.6系統

環境:

dhcp伺服器:172.168.0.1

tftp+pxe伺服器:172.168.0.2

配置DHCP伺服器

一、配置本地yum源

mount /dev/cdrom /mnt rm -rf /etc/yum .repos.d/* vi /etc/yum .repos.d /base .repo [base] name=base baseurl= file : ///mnt enabled=1 gpgcheck=0 yumrepolist

二、安裝配置dhcp

yum-y install dhcp cp /usr/share/doc/dhcp-4 .1.1 /dhcpd .conf.sample /etc/dhcp/dhcpd .conf cat /etc/dhcp/dhcpd .conf| grep - v "^$" | grep - v "^#" optiondomain-name "parpar.com" ; optiondomain-name-servers8.8.8.8; default-lease- time 3600; max-lease- time 7200; log-facilitylocal7; subnet172.168.0.0netmask255.255.0.0{ range172.168.0.20172.168.0.30; optionrouters172.168.0.1; next-server172.168.0.2; filename "pxelinux.0" ; } chkconfigdhcpdon servicedhcpdstart

配置tftp+http+pxe伺服器

一、安裝配置tftp

yum-y install tftptftp-server chkconfigtftpon servicexinetdstart

二、配置PXE工作環境

yum-y install syslinux cp /usr/share/syslinux/pxelinux .0 /var/lib/tftpboot/

三、提供引導核心檔案

cp /mnt/images/pxeboot/ {vmlinuz,initrd.img} /var/lib/tftpboot/ cp /mnt/isolinux/ {vesamenu.c32,boot.msg,splash.jpg} /var/lib/tftpboot mkdir /var/lib/tftpboot/pxelinux .cfg cp /mnt/isolinux/isolinux .cfg /var/lib/tftpboot/pxelinux .cfg /default

四、安裝配置httpd服務

yum-y install httpd mkdir /var/www/html/centos6 mount --bind /mnt /var/www/html/centos6 servicehttpdstart

五、產生ks檔案

yum-y install system-config-kickstart system-config-kickstart mv ks.cfg /var/www/html/ cat /var/www/html/ks .cfg #platform=x86,AMD64,orIntelEM64T #version=DEVEL #Firewallconfiguration firewall--disabled #InstallOSinsteadofupgrade install #Usenetworkinstallation url--url= "http://172.168.0.2/centos6" repo--name= "CentOS" --baseurl=http: //172 .168.0.2 /centos6 --cost=100 #Rootpassword rootpw--iscrypted$1$10KAJR0t$WqUKt8fRa24FDPnHZxRTZ1 #Systemauthorizationinformation auth--useshadow--passalgo=sha512 #Usegraphicalinstall graphical firstboot--disable #Systemkeyboard keyboardus #Systemlanguage langen_US #SELinuxconfiguration selinux--disabled #Installationlogginglevel logging--level=info #Rebootafterinstallation reboot #Systemtimezone timezoneAsia /Shanghai #Networkinformation network--bootproto=dhcp--device=eth0--onboot=on #Systembootloaderconfiguration bootloader--append= "crashkernel=autorhgbquiet" --location=mbr--driveorder= "sda" #CleartheMasterBootRecord zerombr #Partitionclearinginformation clearpart--all--initlabel #Diskpartitioninginformation part /boot --fstype= "ext4" --size=200 partswap--size=4000 part/--fstype= "ext4" --grow--size=200 %packages @core %end

六、修改

vim /var/lib/tftpboot/pxelinux .cfg /default labellinux menulabel^Installorupgradeanexistingsystem menudefault kernelvmlinuz appendks=http: //172 .168.0.2 /ks .cfginitrd=initrd.img

七、配置完成,新啟動虛擬機器即可自動安裝系統

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.