JavaScript must be enabled in order for you to see "WP Copy Data Protect" effect. However, it seems JavaScript is either disabled or not supported by your browser. To see full result of "WP Copy Data Protector", enable JavaScript by changing your browser options, then try again.

在RHEL 7上搭配WinPE 5.1 Image做Win2k8R2SP1 Legacy PXE


最近剛好在techmint上看到關於在RHEL 7做Windows 7 PXE文章,想說來試看看是不是可行,後來按照上面的描述一遍之後,結果真的可以用,因此把架設的過程記錄一下,可以在下次用到的時候參考參考,所以老樣子話不多說,直接看下去就瞭囉,如下:
1) Check關於Samba Share Service的Packages均被安裝(因Samba-Winbind有相依性套件要裝)
#rpm -qa | grep -i samba
#rpm -qa | grep -i samba-common
#rpm -qa | grep -i samba-winbind
#mount -o loop rhel-server-7.0-x86_64-dvd.iso /mnt
#vi /etc/yum.repos.d/rhel70.repo
[rhel7.0]
name=Red Hat Enterprise Linux $releasever - $basearch
baseurl=file:///mnt/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel7.0supplementary]
name=Red Hat Enterprise Linux $releasever (Supplementary) - $basearch
baseurl=file:///mnt/
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
#yum clean
#yum install samba-winbind
#umount /mnt

2) Configuration smb.conf for Samba Service(編輯之前先做Backup)
#mv /etc/samba/smb{,_bk}.conf
#vi /etc/samba/smb.conf
[global]
workgroup = PXESERVER
server string = Samba Server Version %v
log file = /var/log/samba/log.%m
max log size = 50
idmap config * : backend = tdb
cups options = raw
netbios name = pxe
map to guest = bad user
dns proxy = no
public = yes
## For multiple installations the same time - not lock kernel
kernel oplocks = no
nt acl support = no
security = user
guest account = nobody
[install]
comment = Windows 7 Image
path = /windows
read only = no
browseable = yes
public = yes
printable = no
guest ok = yes
oplocks = no
level2 oplocks = no
locking = no
#testparm -> Check the syntax about conf

3) 準備Windows 2k8R2SP1的Image並解壓至Samba的Share folder內
#mkdir -p /windows/x64
#mount -o loop Win2k8R2SP1.iso /mnt
#cp -rf /mnt/* /windows/x64/
#umount /mnt
#chmod -R 755 /windows
#chown -R nobody:nobody /windows
#systemctl restart smb
#systemctl enable smb
#systemctl restart winbind
#systemctl enable winbind
#systemctl restart nmb
#systemctl enable nmb
#systemctl status smb -> Check you can query the content with \\192.168.1.10\install\

4) Setup the part of legacy PXE under the RHEL 7(Include the part of WinPE 5.1)
#mount -o loop rhel-server-7.0-x86_64-dvd.iso /mnt
#cd /mnt/Packages/
#rpm -qa | grep -i syslinux -> Query the following packages are be installed
#rpm -qa | grep -i nfs
#rpm -qa | grep -i http
#rpm -qa | grep -i vsftp
#rpm -ivh xinetd-2.3.15-12.el7.x86_64.rpm
#rpm -ivh tftp-5.2-11.el7.x86_64.rpm
#rpm -ivh tftp-server-5.2-11.el7.x86_64.rpm
#rpm -ivh dhcpd-4.2.5-27.el7.x86_64.rpm
#tzselect -> Asia/Taipei(Modify Timezone)
#date MMDDHHMMYYYY
#hwclock -w -> Sync with system and hardware time
#service firewalld stop
#chkconfig firewalld off
#service NetworkManager stop
#chkconfig NetworkManager off
#vi /etc/sysconfig/selinux -> Modify with the value of 'Disable'
#vi /etc/hostname -> Modify the Hostname you want(EX:uefi.pxe.com)
#ls -al /sys/class/net -> Query the NIC's Name(Because of CDNN)
#vi /etc/sysconfig/network-scripts/ifcfg-ens4f0 -> Modify with the Static IP(EX:192.168.1.10/24)
#vi /etc/hosts -> Add the domain name about the PXE Server
#service network restart
#rpm -qa | grep -i tftp-server
#rpm -qa | grep -i syslinux
#vi /etc/xinted.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
#service xinetd start
#chkconfig xinetd on
#cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
#cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/
#cp /usr/share/syslinux/memdisk /var/lib/tftpboot/
#cp /usr/share/syslinux/mboot.c32 /var/lib/tftpboot/
#cp /usr/share/syslinux/chain.c32 /var/lib/tftpboot/
#cp /usr/share/syslinux/vesamenu.c32 /var/lib/tftpboot/
#vi /var/lib/tftpboot/pxelinux.cfg/default
default 0
timeout 300
prompt 1
display msgs/boot.msg -> msgs的部分請自己在設計過吧!
#mkdir -p /var/lib/tftpboot/msgs/
#vi /var/lib/tftpboot/msgs/boot.msg
win:WinPE 5.1 x64
#rpm -qa | grep -i dhcp
#rpm -qa | grep -i httpd
#vi /etc/dhcp/dhcpd.conf
option domain-name "pxes.iori.tw";
option domain-name-servers 168.95.1.1;
default-lease-time 600;
max-lease-time 7200;
authoritative;
allow booting;
allow bootp;
option option-128 code 128 = string;
option option-129 code 129 = text;
next-server 192.168.1.10;
filename "/pxelinux.0";
subnet 192.168.1.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.1.11 192.168.1.253;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
}
#vi /etc/httpd/conf/httpd.conf
DocumentRoot "/var/ftp"
<Directory />
Options FollowSymLinks Indexes
AllowOverride None
</Directory>
#chkconfig dhcpd on
#chkconfig httpd on
#service dhcpd start
#service httpd start
#mkdir -p /var/lib/tftpboot/windows
#mkdir -p /var/lib/tftpboot/pxelinux.cfg
#vi /var/lib/tftpboot/pxelinux.cfg/default
label win
kernel memdisk
initrd windows/winpe_x64.iso
append iso raw
#init 6 -> 套用SELinux的Value

5) Client在PXE Menu時輸入win並開進WinPE 5.1 Image之後需要Exec的Command
X:\windows\system32> ipconfig -> Check the network driver is present.(Need add additional driver into the iso about WinPE.)
X:\windows\system32> net use Y: \\192.168.1.10\install\x64
X:\windows\system32> Y:
Y:> setup.exe

◎、以上就是在RHEL 7上搭配WinPE 5.1 Image做Win2k8R2SP1 Legacy PXE簡易介紹,且上述內容大部份都是Ref TechMint這篇文章,至於WinPE 5.1 Image製作的部分可以參考這裡依樣畫葫蘆(WAIK),不過我是直接請教B哥一份Official的給我,此外如果看倌們對於UEFI PXE興趣的話,可以研究如何將WinPE Image該Mode掛起的話,就可以成功繼續安裝下去囉,先到這,收工!

  1. [補充]
    微軟官網有說明

    要做Win2012之後的image 必須用WADK
    要做win 7 的image 則用WAIK即可

  2. Hi
    請問UEFI PXE boot WinPE Image的部分,您有在哪邊看過文獻嗎?
    我找了蠻久了~ 沒看到相關的文章
    我的PXE Server就這部分搞不起來
    Lagacy Boot的部分,用的方法跟您一樣,就只有UEFI的部分,還沒解決。
    我是用RHEL6.7架設的~

    • Hi Gary
      最近我有聽我同事提到iPXE,你可以試看看用這種方法去試看看,之後應該會寫文章記錄這部分,謝謝您的提問。

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
This site is protected by WP-CopyRightPro