以 Windows 2000 Professional 为例,需要用到的软件如下
修改 /etc/dhcp3/dhcpd.conf 如下
- Debian 基本系统 (Debian Etch)
- DHCP Server (dhcp3-server)
- Trivial file transfer protocol server (atftpd)
- Samba
- python
- PXELinux
- Binl Server (ris-linux)
sudo aptitude install dhcp3-server samba cabextract下载安装 Binl Server
cd ~取回 atftpd 源代码,并且打关补丁 (Binl Server 附带的大小写不相关补丁)
wget http://oss.netfarm.it/guides/ris-linux-0.2.tar.gz
cd /opt
sudo tar xvfz ~/ris-linux-0.2.tar.gz
cd ~编译 deb 包,编译过程中需要的 fakeroot make debhelper 等包如果没有安装,使用 sudo aptitude install xxx 安装后重新编译
apt-get source atftpd
cd atftpd
patch -p1 < /opt/ris-linux/atftpd*.diff
fakeroot ./debian/rules binary安装 atftpd
sudo dpkg -i atftpd*.deb建立 tftp 服务根目录
sudo mkdir /tftpboot复制 Windows 2000 Professional CD 中的 i386 目录到 /tftpboot/win2k 目录中
修改 /etc/dhcp3/dhcpd.conf 如下
其中 subnet server-name next-server 修改为实际网段 IP,保存后重启 DHCP Serversubnet 192.168.129.0 netmask 255.255.255.0 { range dynamic-bootp 192.168.129.100 192.168.129.110; default-lease-time 600; max-lease-time 7200; filename "pxelinux.0"; server-name "192.168.129.1"; next-server 192.168.129.1; }
sudo /etc/init.d/dhcp3-server restart修改 /etc/samba/smb.conf,加入如下内容
保存后重启 sambanull passwords = true [REMINST] path = /tftpboot browsable = true read only = No guest ok = Yes
sudo /etc/init.d/samba restart在 /opt/ris-linux 下创建 inf 目录,复制网卡驱动的 inf 文件及 sys 文件到该目录中并修改 sys 文件的访问权限),建立 ris-linux 的网卡驱动 cache
sudo chmod 644 inf/*.sys连接网卡驱动到 /tftpdboot/win2k/i386 目录中
sudo ./infparser.py inf
cd /tftpdboot/win2k/i386解开 Windows 远程安装引导程序
sudo ln -s /opt/ris-linux/inf/*.sys
cd /tftpdboot下载 pxelinux 启动内核
sudo cabextract win2k/i386/STARTROM.N1_
sudo sed -i -e ‘s/NTLDR/W2KLD/gi’ startrom.n12
sudo mv startrom.n12 w2k.0
sudo cabextract win2k/i386/SETUPLDR.EX_
sudo mv setupldr.exe W2KLD
sudo cp win2k/i386/bootfont.bin pxelinux.0BOOTFONT.BIN
sudo cp win2k/i386/ntdetect.com pxelinux.0ntdetect.com
sudo wget -P /tftpdboot http://oss.netfarm.it/guides/pxelinux.0创建应答文件 pxelinux.0winnt.sif,内容如下
创建 pxelinux 应答文件 pxelinux.cfg/default,内容如下[data] floppyless = "1" msdosinitiated = "1" ; Needed for second stage OriSrc = "\\YOUR_SERVER_NAME\YOUR_SHARE_NAME\win2k\i386" OriTyp = "4" LocalSourceOnCD = 1 DisableAdminAccountOnDomainJoin = 1 [SetupData] OsLoadOptions = "/fastdetect" ; Needed for first stage SetupSourceDevice = "\Device\LanmanRedirector\YOUR_SERVER_NAME\YOUR_SERVER_SHARE\win2k" [UserData] ComputerName = * ; if needed ;ProductID=
启动 ris-linux 服务TIMEOUT 0 PROMPT 1 label win2k kernel w2k.0
cd /opt/ris-linux修改 PC 为从网卡启动,开始远程安装 Windows 2000 Professional.
sudo ./binlsrv.py