<?xml version="1.0" encoding="UTF-8" ?><oembed><version>1.0</version><provider_name>Jui-Nan Lin&#039;s Blog</provider_name><provider_url>https://jnlin.org</provider_url><author_name>jnlin</author_name><author_url>https://jnlin.org/author/jnlin/</author_url><title>Remote Install WinXP from a FreeBSD box</title><html>1. Install tftp-hpa (/usr/ports/ftp/tftp-hpa)
  Install samba3, perl, python

2. Set pxeboot environment
  Ref: &lt;a href=&quot; http://jnlin.org/2006/10/29/141/&quot;&gt; http://jnlin.org/2006/10/29/141/&lt;/a&gt;

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 &gt; /tftpboot/rules
ri      ^[a-z]:                         # Remove &quot;drive letters&quot;
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: &lt;a href=&quot;http://oss.netfarm.it/guides/ris-linux.php&quot;&gt;http://oss.netfarm.it/guides/ris-linux.php&lt;/a&gt;)

- Copy i386 directory from the installation media to a subdir called winxp
 in the ris working directory

- Extract the pxe loader:
 cabextract &lt;source dir&gt;/i386/STARTROM.N1_

- Modify the name of the loader from NTLDR to XPLDR:
 sed -i -e &#039;s/NTLDR/XPLDR/gi&#039; startrom.n12

- Move the modified pxe loader to tftpd root, and call it winxp.0

- Extract the setuploader, using cabextract:
 cabextract &lt;/source&gt;&lt;source dir&gt;/i386/SETUPLDR.EX_

- Modify the name of the response file from winnt.sif to winxp.sif
 sed -i -e &#039;s/winnt\.sif/winxp\.sif/gi&#039; setupldr.exe

- Modify the name of ntdetect from ntdetect.com to ntdetect.wxp
 sed -i -e &#039;s/ntdetect\.com/ntdetect\.wxp/gi&#039; setupldr.exe

- Move the modified setuploader to tftpd root, and call it xpldr

- Copy &lt;/source&gt;&lt;source dir&gt;/i386/NTDETECT.COM to tftpd root
 and call it ntdetect.wxp

6. Create winxp.sif

(Ref: &lt;a href=&quot;http://oss.netfarm.it/guides/ris-linux.php&quot;&gt;http://oss.netfarm.it/guides/ris-linux.php&lt;/a&gt;)

==
[data]
floppyless = &quot;1&quot;
msdosinitiated = &quot;1&quot;
; Needed for second stage
OriSrc = &quot;\\YOUR_SERVER_NAME\YOUR_SHARE_NAME\winxp\i386&quot;
OriTyp = &quot;4&quot;
LocalSourceOnCD = 1
DisableAdminAccountOnDomainJoin = 1

[SetupData]
OsLoadOptions = &quot;/fastdetect&quot;
; Needed for first stage
SetupSourceDevice = &quot;\Device\LanmanRedirector\YOUR_SERVER_NAME\YOUR_SERVER_SHARE\winxp&quot;

[UserData]
ComputerName = *
; if needed
;ProductID=
==

 *** Remember to set the share folder in the samba server ***

Ref: &lt;a href=&quot;http://oss.netfarm.it/guides/pxe.php&quot;&gt;http://oss.netfarm.it/guides/pxe.php&lt;/a&gt;

[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
&lt;pre&gt;
find ./ -depth \
| perl -ne &#039;chomp;m&lt;/[^/]*$&gt;;$d=$`;$_=$f=$&amp;;&#039;\
&#039;s/([\x80-\xFF].)|(\w)/$1\l$2/g;system &quot;echo&quot;,$d.$f,$d.$_ if $f ne $_&#039;
&lt;/pre&gt;
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 **
&lt;a href=&quot;http://oss.netfarm.it/guides/pxe.php&quot;&gt;http://oss.netfarm.it/guides/pxe.php&lt;/a&gt;
&lt;a href=&quot;http://oss.netfarm.it/guides/ris-linux.php&quot;&gt;http://oss.netfarm.it/guides/ris-linux.php&lt;/a&gt;
&lt;a href=&quot;http://syslinux.zytor.com/pxe.php&quot;&gt;http://syslinux.zytor.com/pxe.php&lt;/a&gt;&lt;/source&gt;</html><type>rich</type></oembed>