Remote Install WinXP from a FreeBSD box

1. Install tftp-hpa (/usr/ports/ftp/tftp-hpa)
Install samba3, perl, python

2. Set pxeboot environment
Ref: http://jnlin.org/2006/10/29/141/

3. Change tftpd server to tftp-hpa
/usr/local/libexec/in.tftpd in.tftpd -v -m /tftpboot/rules -s /tftpboot

4. Write rules
(Warning! If you apply my rule, all filenames in tftproot must be lowercase)
# cat > /tftpboot/rules
ri ^[a-z]: # Remove “drive letters”
rg \\ / # Convert backslashes to slashes
rg \# @ # Convert hash marks to @ signs
rg /../ /..no../ # Convert /../ to /..no../
rg A a
rg B b
rg C c
rg D d
rg E e
rg F f
rg G g
rg H h
rg I i
rg J j
rg K k
rg L l
rg M m
rg N n
rg O o
rg P p
rg Q q
rg R r
rg S s
rg T t
rg U u
rg V v
rg W w
rg X x
rg Y y
rg Z z
r ^/(.*) \1

5. extract I386 files from Windows XP installation CD

(Ref: http://oss.netfarm.it/guides/ris-linux.php)

– Copy i386 directory from the installation media to a subdir called winxp
in the ris working directory

– Extract the pxe loader:
cabextract/i386/STARTROM.N1_

– Modify the name of the loader from NTLDR to XPLDR:
sed -i -e ‘s/NTLDR/XPLDR/gi’ startrom.n12

– Move the modified pxe loader to tftpd root, and call it winxp.0

– Extract the setuploader, using cabextract:
cabextract /i386/SETUPLDR.EX_

– Modify the name of the response file from winnt.sif to winxp.sif
sed -i -e ‘s/winnt\.sif/winxp\.sif/gi’ setupldr.exe

– Modify the name of ntdetect from ntdetect.com to ntdetect.wxp
sed -i -e ‘s/ntdetect\.com/ntdetect\.wxp/gi’ setupldr.exe

– Move the modified setuploader to tftpd root, and call it xpldr

– Copy /i386/NTDETECT.COM to tftpd root
and call it ntdetect.wxp

6. Create winxp.sif

(Ref: http://oss.netfarm.it/guides/ris-linux.php)

==
[data]
floppyless = “1”
msdosinitiated = “1”
; Needed for second stage
OriSrc = “\\YOUR_SERVER_NAME\YOUR_SHARE_NAME\winxp\i386”
OriTyp = “4”
LocalSourceOnCD = 1
DisableAdminAccountOnDomainJoin = 1

[SetupData]
OsLoadOptions = “/fastdetect”
; Needed for first stage
SetupSourceDevice = “\Device\LanmanRedirector\YOUR_SERVER_NAME\YOUR_SERVER_SHARE\winxp”

[UserData]
ComputerName = *
; if needed
;ProductID=
==

*** Remember to set the share folder in the samba server ***

Ref: http://oss.netfarm.it/guides/pxe.php

[REMINST]
path = /mnt/disk/ris
browsable = true
read only = No
guest ok = Yes

7. Install NIC drivers to i386/inf
cp nicdrivers/* i386/inf
ln i386/inf/* i386/*

8. Rename all files in winxp to lowercase

find ./ -depth \
| perl -ne 'chomp;m</[^/]*$>;$d=$`;$_=$f=$&;'\
's/([\x80-\xFF].)|(\w)/$1\l$2/g;system "echo",$d.$f,$d.$_ if $f ne $_'

9. Get Binl Server and extract it
fetch http://oss.netfarm.it/guides/ris-linux-0.2.tar.gz
tar zxf http://oss.netfarm.it/guides/ris-linux-0.2.tar.gz
cd ris-linux-0.2

10. Run infparser.py
./infparser.py /where/is/winxp/i386/inf

11. Run ./binlsrv.py

12. Go to install Windows XP 🙂

** Useful Ref **
http://oss.netfarm.it/guides/pxe.php
http://oss.netfarm.it/guides/ris-linux.php
http://syslinux.zytor.com/pxe.php

9 thoughts on “Remote Install WinXP from a FreeBSD box”

  1. Pingback: Lin's Blog
  2. 我的server是suse版本的,按照上面的大概设定配置后,打开客户端,键入wxp,出现tftp failed;如果我选择的是安装linux系统,则不会出现tftp failed(在此之间已实现远程安装linux suse系统)

    请问这是怎么回事?谢谢拉:)

  3. after getting the windows logo booting i am getting a error that 0xc0000006B process1_initialization_failed error how to debug it

  4. @raja

    If you can get the windows logo, the PXE boot is successful. You should check your installation source, or your hardware. Get some RAM away may helps, if you have >4G RAM.

  5. 您好,我依著上面的方法,可以正確的運行
    也可以看見Windows Xp的logo了,但是就一直停在那了
    想請問一下,這可能是那方面的問題,
    還有大約多久的時間可以安裝完畢
    謝謝….

  6. 您好:
    我按照上面的方法部署完成了可以启动WINDOWS安装但总报错file ntoskrnl.exe could not be loaded

Leave a Reply

Your email address will not be published. Required fields are marked *