首先要说明的是,红旗产品手册《RedFlag Desktop 5.0 安装手册》上已经提供有PXE安装方式的说明。而我下面只是作为补充的方式进行,详细的请参考上述手册。
我以一台需要安装红旗桌面5.0的空机器为例,后台服务器使用DC Server 4.1,使用ISO方式安装。ISO放在后台服务器上。
(测试中发现,后台服务器如果采用红旗DC Server 5.0,并使用它/usr/lib/syslinux/pxelinux.0文件,版本PXE 2.11。那么,不能用Vmware GSX Server 3.2进行测试。会出现启动到boot:界面,但输入不了字符的错误。但可以用实际机器进行安装,只是虚拟机才会出现问题。而且,如果用DC Server 4.1带的PXE 2.06也正常。)
一、原理
严格来说,PXE并不是一种安装方式,而是一种引导的方式。要进行PXE安装的必要条件是:要安装的计算机包含有一个支持PXE启动的网卡,也就是说网卡中要有PXE Client。通常板载网卡、品牌机和笔记本电脑都可以满足该要求。
PXE(Pre-boot Execution Environment)协议分为client和server两端,PXE client在网卡的ROM中,当计算机引导时,BIOS把PXE client调入内存执行,并显示出命令菜单,经用户选择后,PXE client将放置在远端的操作系统通过网络下载到本地运行。
工作流程如下:
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option PXE.discovery-control code 6 = unsigned integer 8;
option PXE.discovery-mcast-addr code 7 = ip-address;
class “pxeclients” {
match if substring (option vendor-class-identifier, 0, 9) = “PXEClient”;
option vendor-class-identifier “PXEClient”;
vendor-option-space PXE;
# At least one of the vendor-specific PXE options must be set in
# order for the client boot ROMs to realize that we are a PXE-compliant
# server. We set the MCAST IP address to 0.0.0.0 to tell the boot ROM
# that we can’t provide multicast TFTP (address 0.0.0.0 means no
# address).
option PXE.mtftp-ip 0.0.0.0;
# This is the name of the file the boot ROMs should download.
# 指定PXE启动后下载的文件名
filename “pxelinux.0”;
# This is the name of the server they should get it from.
# 这里指定TFTP服务器IP地址
next-server 192.168.228.16;
}
ddns-update-style interim;
ignore client-updates;
default-lease-time 1200;
max-lease-time 9200;
#下面开始定义DHCP的IP范围
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.228.255;
#网关、域名等可以根据实际情况,不要也可以
option routers 192.168.228.1;
option domain-name-servers 192.168.228.1;
option domain-name “mydomain.org”;
subnet 192.168.228.0 netmask 255.255.255.0 {
range 192.168.228.220 192.168.228.225;
}
#根据需要安装机器的网卡地址定义IP,并记录下来
host test {
hardware ethernet 00:0C:29:B7:A8:A3;
fixed-address 192.168.228.221;
}