Trang chủ Tin tức Tin IT Triển khai toàn bộ hệ thống nhanh chóng với PXE Server

Welcome to website

DICHVUMAYCHU.NET

Chào Mừng đến với Dichvumaychu.net.

Dichvumaychu.net trực thuộc Công Ty TNHH MTV TM-DV Cuộc Sống Mới.

Chúng tôi chuyên cung cấp các dịch vụ về máy chủ như : mua bán máy chủ, cho thuê máy chủ và chỗ đặt máy chủ,Web hosting, tên miền việt nam và quốc tế, dịch vụ Email, thiết kế website. Có Data Center riêng biệt với quy mô 120 tủ rack 48U đặt tại 385C Nguyễn Trãi, Quận 1, TP.HCM ,với hệ thống đạt chuẩn quốc tế và đội ngũ nhân viên kinh nghiệm, nhiệt tình và năng  động, với mong muốn mang lại chất lượng dịch vụ tốt và ổn định nhất.

Mr Chi.
HOTLINE: 0902302080
Triển khai toàn bộ hệ thống nhanh chóng với PXE Server
Sunday, 15 May 2011 09:36
Triển khai toàn bộ hệ thống nhanh chóng với PXE Server


1) Triển khai PXE server


Yêu cầu: PXE server ( CentOS ) + PXE client ( Card mạng có hỗ trợ boot code )

- Cài tftp-server, dhcp, httpd, syslinux.
- Sữa file cấu hình tftp


- Tạo file remap với nội dụng:

gr \\ /


- Copy các file sau vào /tftpboot:

cp /usr/lib/syslinux/pxelinux.0 /tftpboot
cp /usr/lib/syslinux/menu.c32 /tftpboot


- Tạo thư mục /pxelinux.cfg trong /tftpboot
- Tạo file default trong /pxelinux.cfg

prompt 1
default menu.c32
timeout 100

label Linux
kernel vmlinuz
append initrd=initrd.img ramdisk_size=9216 noapic acpi=off

label Window
kernel Boot/startrom.0
append –


- Copy vmlinuz và initrd.img ( trong thư mục isolinux trên bộ đĩa cài linux ) vào /tftpboot/images/centos.
- Copy bộ đĩa cài đặt linux vào /tftpboot/centos
- Thêm các dòng sau vào file cấu hình dhcpd

allow booting;
allow bootp;
option option-128 code 128 = string;
option option-129 code 129 = text;
next-server 192.168.0.20;
filename "/pxelinux.0";


- Thêm các dòng sau vào file cấu hình httpd

<Directory /tftpboot/centos>
Options Indexes
AllowOverride None
</Directory>


- Cài và cấu hình samba
- Tạo thư mục /share
- Chép bộ cài đặt Windows vào /share

- Download Window AIK
- Cài .NET Framework, MSXML, Window AIK vào thư mực c:\waik

cd \waik\tools\petools\
copype.cmd x86 c:\win7pe
imagex /mountrw winpe.wim 1 mount


- Tạo thư mục chứa file PXE
- Copy các file cần thiết vào thư mục c:\pxe

cd \win7pe\mount\windows\boot\pxe
copy * \pxe
cd \ win7pe\mount\windows\boot\fonts
copy wgl4_boot.ttf \pxe
cd \waik\tools\petools\x86\boot
copy boot.sdi \pxe
cd \ win7pe
copy winpe.wim \pxe


- Tạo BCD file

cd win7pe\mount\windows\system32
bcdedit /createstore \pxe\BCD
bcdedit /store \pxe\bcd /create {ramdiskoptions} /d "Ramdisk options"
bcdedit /store \pxe\bcd /set {ramdiskoptions} ramdisksdidevice boot
bcdedit /store \pxe\BCD /set {ramdiskoptions} ramdisksdipath \Boot\boot.sdi
bcdedit /store \pxe\BCD /create /d "MyWinPE Boot Image" /application osloader


- Bạn sẽ được một dãy: {xxxxxxxx-xxxx-xxxx-xxxxxxxxxx}

bcdedit /store \pxe\BCD /set {xxxxxxxx-xxxx-xxxx-xxxxxxxxxx}systemroot \Windows
bcdedit /store \pxe\BCD /set {xxxxxxxx-xxxx-xxxx-xxxxxxxxxx}detecthal Yes
bcdedit /store \pxe\BCD /set {xxxxxxxx-xxxx-xxxx-xxxxxxxxxx}winpe Yes

bcdedit /store \pxe\BCD /set {xxxxxxxx-xxxx-xxxx-xxxxxxxxxx}osdevice ramdisk=[boot]\Boot\WinPE.wim,{ramdiskoptions}


bcdedit /store \pxe\BCD /set {xxxxxxxx-xxxx-xxxx-xxxxxxxxxx}device ramdisk=[boot]\Boot\WinPE.wim,{ramdiskoptions}


bcdedit /store \pxe\BCD /create {bootmgr} /d "Windows VISTA BootManager"

bcdedit /store \pxe\BCD /set {bootmgr} timeout 30
bcdedit /store \pxe\BCD /displayorder {xxxxxxxx-xxxx-xxxx-xxxxxxxxxx}


- Bây giờ, copy tất cả các file trong thư mục c:\pxe vào /tftpserver/Boot trên PXE server
- Trở lại PXE server, nhập lệnh sau để đổi tên file

cd /tftpboot/Boot
mv pxeboot.n12 startrom.0
mv bootmgr.exe ..
mv winpe.wim WinPE.wim


2) Cài Đặt Windows Client từ PXE Server

 


- Nhập lệnh sau để client kết nối vào thư mục /share trên PXE server và lấy bộ cài đặt Windows

X:\Windows\system32>net use h: \\192.168.0.20\share

- Nhập username và password mà chúng ta đã tạo bước cài đặt và cấu hình Samba.

Username: kenhgiaiphapvn
Password: 123


- Quá trình cài đặt windows sẽ tự động được kích hoạt. 

3) Cài đặt Linux Client từ PXE Server

 

 

 

 


Sự ra đời của PXE đã giúp cho việc cài đặt các máy clients (Linux + Windows) (của người quản trị) trở nên dễ dàng, tiết kiệm chi phí và thời gian. Nếu như trước kia, khi bạn cần cài đặt hệ điều hành cho hàng loạt máy tính, bạn phải burn rất nhiều đĩa để cài cho từng máy. Điều này khiến bạn mất khá nhiều thời gian và lãng phí. Giờ đây, bạn chỉ cần cài đặt một PXE server để client kết nối vào và lấy thông tin cài đặt.
( Nguồn: wiki.centos.org, linux-sxs.org )