Difference between pages "Rootfs over encrypted lvm" and "PXE Network Windows Installation"

(Difference between pages)
(Final steps)
 
 
Line 1: Line 1:
This howto describes how to setup LVM and rootfs with cryptoLUKS-encrypted drive
+
''Howto use your Funtoo machine to serve a MS Windows installation over the network''
 +
In this guide we will assume that you have followed the [[PXE network boot server]] Wiki article and have a working network/pxe boot setup. As of now this guide will cover Windows XP. Soon it will be expanded to also cover Windows 7.
 +
==Prerequisites==
 +
#A working Funtoo installation
 +
#A working PXE Setup (DHCP, TFTP, PXELinux)
 +
#app-arch/cabextract
 +
#A legitimate copy of Microsoft Windows
 +
#Driver for your NIC - ''Suggested to use a complete driver pack with all major supported NIC hardware for the version of Windows to be installed.''
 +
#RIS Linux toolkit >=0.4
 +
#A working Samba server setup
  
= Prepare the hard drive and partitions =
+
== Creating the Windows XP Image ==
This is an example partition scheme, you may want to choose differently.
+
<code>/dev/sda1</code> used as <code>/boot</code>. <code>/dev/sda2</code> will be encrypted drive with LVM.
+
  
* <code>/dev/sda1</code> -- <code>/boot</code> partition.
+
*In the previous guide, [http://www.funtoo.org/wiki/PXE_network_boot_server PXE Network Boot Server], we used /tftproot as the working directory so we will also use it in this guide for convenience. If you chose to use a different working directory then please apply it where needed in place of the /tftproot we will be going by here.
* <code>/dev/sda2</code> -- BIOS boot partition (not needed for MBR - only needed if you are using GPT) This step required for GRUB2. For more info, see: [http://www.funtoo.org/Funtoo_Linux_Installation#Prepare_Hard_Disk] for more information on GPT and MBR.  
+
 
* <code>/dev/sda3</code> -- <code>/</code> partition, will be the drive with LUKS and LVM.
+
First you will need to create an ISO from your Windows XP installation disc. If you already have the ISO image you may skip this step.  
  
 
<console>
 
<console>
# ##i##dd if=/dev/zero of=/dev/sda3 bs=100M
+
###i## dd if=/dev/sr0 of=/tftproot/winxp.iso
# ##i##dd if=/dev/urandom of=/dev/sda3 bs=100M
+
 
</console>
 
</console>
The <code>dd</code> part is optional, and the command only needs to be run for security reasons (i.e only if you had top secret files on your drive). The command overwrites the lingering data on the device with random data. It takes around 6 hours to complete for a 200GB drive.
+
If your cdrom device isn't ''<code>/dev/sr0</code>'' please use the appropriate device in this command.
  
{{Note}} You will get a message about reaching the end of the device when the <code>dd</code> command has finished. This behavior is intended.
+
== Mount the ISO and Prepare Installation Sources ==
 
+
Mount the image to ''<code>/tftproot/cdrom</code>'':
= Encrypting the drive =
+
 
<console>
 
<console>
# ##i##cryptsetup --cipher aes-xts-plain64 luksFormat /dev/sda3
+
###i## mkdir /tftproot/cdrom; mount -o loop /tftproot/winxp.iso /tftproot/cdrom
# ##i##cryptsetup luksOpen /dev/sda3 dmcrypt_root
+
 
</console>
 
</console>
 
+
Create the new directory for the network installation files and copy the needed files to it:
There you'll be prompted to enter your password phrase for encrypted drive, type your paranoid password there.
+
 
+
= Create logical volumes =
+
 
<console>
 
<console>
# ##i##pvcreate /dev/mapper/dmcrypt_root
+
###i## mkdir /tftproot/winxp; cp -R /tftproot/cdrom/i386 /tftproot/winxp/i386
# ##i##vgcreate vg /dev/mapper/dmcrypt_root
+
# ##i##lvcreate -L10G --name root vg         
+
# ##i##lvcreate -L2G --name swap vg
+
# ##i##lvcreate -L5G --name portage vg
+
# ##i##lvcreate -l 100%FREE -nhome vg
+
 
</console>
 
</console>
Feel free to specify your desired size by altering the numbers after the -L flag. For example, to make your portage dataset 20GB's, use the flag -L20G instead of -L5G.
+
Depending on your CD/DVD copy of windows the directory name may be I386 as opposed to i386, if that is the case you will just need to change the first part of the command, keeping the new directory name i386 - this is going to be very important later on when creating the remap file!
 
+
Check the contents of your newly created i386 directory to see if the filenames are in all CAPS or if they are already in lowercase.  
= Create a filesystem on volumes =
+
 
<console>
 
<console>
# ##i##mkfs.ext2 /dev/sda1
+
###i## ls /tftproot/winxp/i386
# ##i##mkswap /dev/mapper/vg-swap
+
# ##i##mkfs.ext4 /dev/mapper/vg-root
+
# ##i##mkfs.ext4 /dev/mapper/vg-portage
+
# ##i##mkfs.ext4 /dev/mapper/vg-home
+
 
</console>
 
</console>
 
+
If you happen to have all UPPERCASE filenames, lets go ahead and run a script to convert it to all lowercase:
= Basic system setup =
+
 
<console>
 
<console>
# ##i##swapon /dev/mapper/vg-swap
+
###i## cd /tftproot/winxp/i386;ls | awk '$0!=tolower($0){printf "mv \"%s\" \"%s\"\n",$0,tolower($0)}' | sh
# ##i##mkdir /mnt/funtoo
+
# ##i##mount /dev/mapper/vg-root /mnt/funtoo
+
# ##i##mkdir -p /mnt/funtoo/{boot,usr/portage,home}
+
# ##i##mount /dev/sda1 /mnt/funtoo/boot
+
# ##i##mount /dev/mapper/vg-portage /mnt/funtoo/usr/portage
+
# ##i##mount /dev/mapper/vg-home /mnt/funtoo/home
+
 
</console>
 
</console>
Now perform all the steps required for basic system install, please follow [http://docs.funtoo.org/wiki/Funtoo_Linux_Installation]
 
don't forget to emerge the following before your install is finished:
 
 
* '''cryptsetup'''
 
* '''lvm2'''
 
* '''a bootloader (grub recommended)'''
 
* '''kernel sources (gentoo-sources recommended)'''
 
  
= Editing the fstab =
+
==Extracting and Modifying the Required Boot Files ==
Fire up your favorite text editor to edit <code>/etc/fstab</code>. You want to put the following in the file:
+
Install {{Package|app-arch/cabextract}}
 
<console>
 
<console>
# <fs>                  <mountpoint>  <type>    <opts>                          <dump/pass>
+
###i## emerge -av app-arch/cabextract
/dev/sda1              /boot        ext2      noauto,noatime                  1 2
+
/dev/mapper/vg-swap    none          swap      sw                              0 0
+
/dev/mapper/vg-root    /            ext4      noatime,nodiratime,defaults    0 1
+
/dev/sr0                /mnt/cdrom    auto      noauto,ro                      0 0
+
/dev/mapper/vg-portage  /usr/portage  ext4      noatime,nodiratime              0 0
+
/dev/mapper/vg-home    /home        ext4      noatime,nodiratime              0 0
+
 
</console>
 
</console>
 
+
Extract the prepackaged drivers:
= Kernel options =
+
{{Note}}This part is particularly important: pay close attention.
+
{{kernelop
+
|'''General setup --->'''
+
|'''[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support'''
+
}}
+
 
+
{{kernelop
+
|'''Device Drivers --->''' <br> '''Generic Driver Options --->'''
+
|'''[*] Maintain a devtmpfs filesystem to mount at /dev''' <br>
+
}}
+
 
+
{{kernelop
+
|'''Device Drivers --->''' <br> '''[*] Multiple devices driver support --->'''
+
|'''<*>Device Mapper Support''' <br> '''<*> Crypt target support'''
+
}}
+
 
+
{{kernelop
+
|'''Cryptographic API --->'''
+
|'''-*-AES cipher algorithms''' <br> '''<*> XTS support'''
+
}}
+
 
+
= Initramfs setup and configuration =
+
== Better-initramfs ==
+
'''Build your initramfs with [https://bitbucket.org/piotrkarbowski/better-initramfs better-initramfs] project.'''
+
 
+
{{note}}better-initramfs supports neither dynamic modules nor udev, so you should compile your kernel with built-in support for your block devices.
+
 
+
 
<console>
 
<console>
# ##i##cd /opt
+
###i## cd /tftproot/winxp/i386;cabextract driver.cab
# ##i##git clone git://github.com/slashbeast/better-initramfs.git
+
</console>
# ##i##cd better-initramfs
+
Install support for a large list of network cards:
# ##i##less README.rst
+
<console>
# ##i##bootstrap/bootstrap-all
+
###i## cd /tftproot/;wget http://downloads.sourceforge.net/project/bootfloppy/pxefiles.tar.gz
# ##i##make prepare
+
###i## tar zxvf pxefiles.tar.gz; cp pxefiles/drivers/* winxp/i386/
# ##i##make image
+
</console>
 +
Copy the BINLSRV /INFParser tools to /tftproot:
 +
<console>
 +
###i## cp pxefiles/script/* /tftproot/
 +
</console>
 +
Extract the netboot startrom:
 +
<console>
 +
###i## cd /tftproot; cabextract winxp/i386/startrom.n1_
 +
</console>
 +
Fix the startrom for netbooting xp:
 +
<console>
 +
###i## sed -i -e 's/NTLDR/XPLDR/gi' startrom.n12
 +
###i## mv startrom.n12 winxp.0
 +
</console>
 +
Fix XPLDR:
 +
<console>
 +
###i## cabextract winxp/i386/setupldr.ex_
 +
###i## sed -i -e 's/winnt\.sif/winxp\.sif/gi' setupldr.exe
 +
###i## sed -i -e 's/ntdetect\.com/ntdetect\.wxp/gi' setupldr.exe
 +
###i## mv setupldr.exe xpldr
 +
###i## cp winxp/i386/ntdetect.com ntdetect.wxp
 
</console>
 
</console>
  
Copy resulting <code>initramfs.cpio.gz</code> to <code>/boot</code>:
+
== Creating a remapping file ==
<console># ##i##cp output/initramfs.cpio.gz /boot</console>
+
Create the file ''<code>/tftproot/tftpd.remap</code>'' and add the following to it:
 
+
Alternatively, a pre-compiled binary initramfs is available at https://bitbucket.org/piotrkarbowski/better-initramfs/downloads
+
 
<console>
 
<console>
# ##i##wget https://bitbucket.org/piotrkarbowski/better-initramfs/downloads/release-x86_64-v0.7.2.tar.bz2
+
###i## nano /tftproot/tftpd.remap
# ##i##tar xf release-x86_64-v0.5.tar.bz2
+
ri ^[az]: # Remove “drive letters”
# ##i##cd release*
+
rg \\ / # Convert backslashes to slashes
# ##i##gzip initramfs.cpio
+
rg \# @ # Convert hash marks to @ signs
# ##i##cp initramfs.cpio.gz /boot
+
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
 +
r ^xpldr xpldr
 +
r ^ntdetect.wxp ntdetect.wxp
 +
r ^winxp.sif winxp.sif
 
</console>
 
</console>
  
Remember, better-initramfs project is a work in progress, so you need to update from time to time. It can be done easily with <code>git</code>. Go to the better-initramfs source dir and follow:
+
==Install/Configure Samba ==
 +
If you don't already have {{Package|net-fs/samba}} installed, then:
 
<console>
 
<console>
# ##i##cd /opt/better-initramfs
+
###i## emerge -av net-fs/samba
# ##i##git pull
+
# ##i##less ChangeLog
+
 
</console>
 
</console>
{{Note}}Please read the ChangeLog carefuly and perform necessary updates to <code>/etc/boot.conf</code>. Also, please backup the working <code>/boot/initramfs.cpio.gz</code> and <code>/etc/boot.conf</code> before updating better-initramfs.
+
Create a Samba share for your tftp server in ''<code>/etc/samba/smb.conf</code>''
  
== Genkernel ==
+
{{Note}} Be sure you have the other required samba settings configured in the file
Funtoo's genkernel capable to create initramfs for encrypted drive. Compile and install kernel and initramfs of your favorite kernel sources:
+
 
<console>
 
<console>
# ##i##genkernel --kernel-config=/path/to/your/custom-kernel-config --no-mrproper --makeopts=-j5 --install --lvm --luks all </console>
+
###i## nano /etc/samba/smb.conf
Configure the bootloader as described above, with correct kernel and initramfs images names. An example for genkernel and grub2:
+
[Global]
 +
interfaces = lo eth0 wlan0
 +
bind interfaces only = yes
 +
workgroup = WORKGROUP
 +
security = user
  
{{code|/etc/boot.conf|<pre>
+
[tftproot]
boot {
+
path = /tftproot
  generate grub
+
browsable = true
  default "Funtoo Linux"
+
read only = yes
  timeout 3
+
writable = no
}
+
guest ok = yes
"Funtoo Linux" {
+
</console>
  kernel kernel-genkernel-x86_64-2.6.39
+
Start Samba:
  initrd initramfs-genkernel-x86_64-2.6.39
+
<console>
  params += crypt_root=/dev/sda2 dolvm real_root=/dev/mapper/vg-root  rootfstype=ext4 resume=swap:/dev/mapper/vg-swap quiet
+
###i## /etc/init.d/samba start
}</pre>}}
+
</console>   
 
+
or if samba has already been started:
= Grub2 configuration =
+
An example of <code>/etc/boot.conf</code> for better-initramfs
+
{{code|/etc/boot.conf|<pre>
+
boot {
+
   generate grub
+
  default "Funtoo Linux"
+
  timeout 3
+
}
+
"Funtoo Linux" {
+
  kernel bzImage[-v]
+
  initrd /initramfs.cpio.gz
+
  params += enc_root=/dev/sda2 lvm luks root=/dev/mapper/vg-root  rootfstype=ext4 resume=swap:/dev/mapper/vg-swap quiet
+
}</pre>}}
+
 
+
= Lilo configuration =
+
For oldschool geeks, an example for lilo bootloader. Emerge lilo with device-mapper support
+
 
<console>
 
<console>
# ##i##echo 'sys-boot/lilo device-mapper' >> /etc/portage/package.use/lilo
+
###i## /etc/init.d/samba restart
# ##i##emerge lilo
+
 
</console>
 
</console>
  
{{code|/etc/lilo.conf|<pre>append="init=/linuxrc dolvm crypt_root=/dev/sda2 real_root=/dev/mapper/vg-root"
+
== Creating a Setup Instruction File ==
boot=/dev/sda
+
Create the file ''<code>/tftproot/winxp.sif</code>'' and add the following, replacing SAMBA_SERVER_IP with the local IP address of your samba server:
compact
+
<console>
default=funtoo
+
###i## nano /tftproot/winxp.sif
lba32
+
[data]
prompt
+
floppyless = "1"
read-only
+
msdosinitiated = "1"
timeout=50
+
; Needed for second stage
image=/boot/kernel-genkernel-x86_64-2.6.39
+
OriSrc = "\\SAMBA_SERVER_IP\tftproot\winxp\i386"
initrd=/boot/initramfs-genkernel-x86_64-2.6.39
+
OriTyp = "4"
label=funtoo
+
LocalSourceOnCD = 1
</pre>}}
+
DisableAdminAccountOnDomainJoin = 1
  
= Syslinux bootloader setup =
+
[SetupData]
Syslinux is another advanced bootloader which you can find on all live CD's.
+
OsLoadOptions = "/fastdetect"
<pre>
+
; Needed for first stage
# emerge syslinux
+
SetupSourceDevice = "\Device\LanmanRedirector\SAMBA_SERVER_IP\tftproot\winxp"
# mkdir /boot/extlinux
+
# extlinux --install /boot/extlinux
+
# dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/mbr.bin of=/dev/sda
+
- or -
+
# sgdisk /dev/sda --attributes=1:set:2
+
# dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/gptmbr.bin of=/dev/sda, for GPT partition</pre>
+
{{code|/boot/extlinux/extlinux.conf|<pre>LABEL kernel1_bzImage-3.2.1
+
MENU LABEL Funtoo Linux bzImage-3.2.1
+
LINUX /bzImage-3.2.1
+
INITRD /initramfs.cpio.gz
+
APPEND rootfstype=ext4 luks enc_root=/dev/sda2 lvm root=/dev/mapper/vg-root
+
</pre>}}
+
  
= Final steps =
+
[UserData]
Umount everything, close encrypted drive and reboot
+
ComputerName = *
<console>
+
# ##i##umount -l -v /mnt/funtoo/{dev, proc, home, usr/portage, boot}
+
# ##i##vgchange -a n
+
# ##i##cryptsetup luksClose /dev/sda2 dmcrypt_root
+
 
</console>
 
</console>
After reboot you will get the following:
 
<pre>>>> better-initramfs started. Kernel version 2.6.35-gentoo-r10
 
>>> Create all the symlinks to /bin/busybox.
 
>>> Initiating /dev/dir
 
>>> Getting LVM volumes up (if any)
 
Reding all physical volumes. This make take awhile...
 
No volume group found
 
No volume group found
 
>>> Opening encrypted partition and mapping to /dev/mapper/dmcrypt_root
 
Enter passphrase fore /dev/sda2:</pre>
 
Type your password
 
  
<pre>>>> Again, getting LVM volumes up (if any, after map dmcrypt).
+
== Editing the pxelinux.cfg/default boot menu ==
  Reading all physical volumes.  This may take a while...
+
Edit your boot menu so that it contains the following entry:
  Found volume group "vg" using metadata type lvm2
+
<pre>
  4 logical volume(s) in volume group "vg" now active
+
LABEL WinXP
>>> Mounting rootfs to /newroot
+
MENU LABEL Install MS Windows XP
>>> Umounting /sys and /proc.
+
KERNEL winxp.0
>>> Switching root to /newroot and executing /sbin/init.
+
</pre>
INIT: version 2.88 booting
+
== Re-Start all required daemons==
Loading /libexec/rc/console/keymap
+
If the daemon isn't already running use start instead or restart in the following commands
  OpenRC 0.6.1 is starting up Funtoo Linux (x86_64)
+
<pre>
...boot messages omitted for clarity
+
/etc/init.d/dnsmasq restart
 
+
/etc/init.d/in.tftpd restart
orion login: oleg
+
</pre>
Password:
+
== Modify Binlsrv, update driver cache, and start driver hosting service ==
Last login: Thu Oct 14 20:49:21 EEST 2010 on tty1
+
Change the BASEPATH= variable at or around line #62 of binlsrv.py so that it is:
oleg@orion ~ %</pre>
+
<pre>
 +
BASEPATH='/tftproot/winxp/i386/'
 +
</pre>
 +
Generate driver cache
 +
<pre>
 +
cd /tftproot;./infparser.py winxp/i386/
 +
</pre>
 +
Start binlservice
 +
<pre>
 +
./binlsrv.py
 +
</pre>
  
= Additional links =
+
== Booting the client ==  
* [[gentoo-wiki:Root filesystem over LVM2, DM-Crypt and RAID|Root filesystem over LVM2, DM-Crypt, and RAID]]
+
If all is well, you should be able to boot the client choosing to ''boot from network'' in the boot options, you should get to your PXELinux bootloader, and see the Install Windows XP option after pressing enter you *should* kick off your XP installation via network!! Congratulations!
* [http://wiki.archlinux.org/index.php/System_Encryption_with_LUKS_for_dm-crypt System Encryption with LUKS for dm-crypt]
+
  
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]

Revision as of 19:05, January 13, 2014

Howto use your Funtoo machine to serve a MS Windows installation over the network In this guide we will assume that you have followed the PXE network boot server Wiki article and have a working network/pxe boot setup. As of now this guide will cover Windows XP. Soon it will be expanded to also cover Windows 7.

Prerequisites

  1. A working Funtoo installation
  2. A working PXE Setup (DHCP, TFTP, PXELinux)
  3. app-arch/cabextract
  4. A legitimate copy of Microsoft Windows
  5. Driver for your NIC - Suggested to use a complete driver pack with all major supported NIC hardware for the version of Windows to be installed.
  6. RIS Linux toolkit >=0.4
  7. A working Samba server setup

Creating the Windows XP Image

  • In the previous guide, PXE Network Boot Server, we used /tftproot as the working directory so we will also use it in this guide for convenience. If you chose to use a different working directory then please apply it where needed in place of the /tftproot we will be going by here.

First you will need to create an ISO from your Windows XP installation disc. If you already have the ISO image you may skip this step.

# dd if=/dev/sr0 of=/tftproot/winxp.iso

If your cdrom device isn't /dev/sr0 please use the appropriate device in this command.

Mount the ISO and Prepare Installation Sources

Mount the image to /tftproot/cdrom:

# mkdir /tftproot/cdrom; mount -o loop /tftproot/winxp.iso /tftproot/cdrom

Create the new directory for the network installation files and copy the needed files to it:

# mkdir /tftproot/winxp; cp -R /tftproot/cdrom/i386 /tftproot/winxp/i386

Depending on your CD/DVD copy of windows the directory name may be I386 as opposed to i386, if that is the case you will just need to change the first part of the command, keeping the new directory name i386 - this is going to be very important later on when creating the remap file! Check the contents of your newly created i386 directory to see if the filenames are in all CAPS or if they are already in lowercase.

# ls /tftproot/winxp/i386

If you happen to have all UPPERCASE filenames, lets go ahead and run a script to convert it to all lowercase:

# cd /tftproot/winxp/i386;ls | awk '$0!=tolower($0){printf "mv \"%s\" \"%s\"\n",$0,tolower($0)}' | sh

Extracting and Modifying the Required Boot Files

Install app-arch/cabextract (package not on wiki - please add)

# emerge -av app-arch/cabextract

Extract the prepackaged drivers:

# cd /tftproot/winxp/i386;cabextract driver.cab

Install support for a large list of network cards:

# cd /tftproot/;wget http://downloads.sourceforge.net/project/bootfloppy/pxefiles.tar.gz
# tar zxvf pxefiles.tar.gz; cp pxefiles/drivers/* winxp/i386/

Copy the BINLSRV /INFParser tools to /tftproot:

# cp pxefiles/script/* /tftproot/

Extract the netboot startrom:

# cd /tftproot; cabextract winxp/i386/startrom.n1_

Fix the startrom for netbooting xp:

# sed -i -e 's/NTLDR/XPLDR/gi' startrom.n12
# mv startrom.n12 winxp.0

Fix XPLDR:

# cabextract winxp/i386/setupldr.ex_
# sed -i -e 's/winnt\.sif/winxp\.sif/gi' setupldr.exe
# sed -i -e 's/ntdetect\.com/ntdetect\.wxp/gi' setupldr.exe
# mv setupldr.exe xpldr
# cp winxp/i386/ntdetect.com ntdetect.wxp

Creating a remapping file

Create the file /tftproot/tftpd.remap and add the following to it:

# nano /tftproot/tftpd.remap
ri ^[az]: # 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
r ^xpldr xpldr
r ^ntdetect.wxp ntdetect.wxp
r ^winxp.sif winxp.sif

Install/Configure Samba

If you don't already have net-fs/samba (package not on wiki - please add) installed, then:

# emerge -av net-fs/samba

Create a Samba share for your tftp server in /etc/samba/smb.conf

Note

{{{1}}}

Be sure you have the other required samba settings configured in the file
# nano /etc/samba/smb.conf
[Global]
interfaces = lo eth0 wlan0
bind interfaces only = yes
workgroup = WORKGROUP
security = user

[tftproot]
path = /tftproot
browsable = true
read only = yes
writable = no
guest ok = yes

Start Samba:

# /etc/init.d/samba start

or if samba has already been started:

# /etc/init.d/samba restart

Creating a Setup Instruction File

Create the file /tftproot/winxp.sif and add the following, replacing SAMBA_SERVER_IP with the local IP address of your samba server:

# nano /tftproot/winxp.sif
[data]
floppyless = "1"
msdosinitiated = "1"
; Needed for second stage
OriSrc = "\\SAMBA_SERVER_IP\tftproot\winxp\i386"
OriTyp = "4"
LocalSourceOnCD = 1
DisableAdminAccountOnDomainJoin = 1

[SetupData]
OsLoadOptions = "/fastdetect"
; Needed for first stage
SetupSourceDevice = "\Device\LanmanRedirector\SAMBA_SERVER_IP\tftproot\winxp"

[UserData]
ComputerName = *

Editing the pxelinux.cfg/default boot menu

Edit your boot menu so that it contains the following entry:

LABEL WinXP
	MENU LABEL Install MS Windows XP
	KERNEL winxp.0

Re-Start all required daemons

If the daemon isn't already running use start instead or restart in the following commands

/etc/init.d/dnsmasq restart
/etc/init.d/in.tftpd restart

Modify Binlsrv, update driver cache, and start driver hosting service

Change the BASEPATH= variable at or around line #62 of binlsrv.py so that it is:

BASEPATH='/tftproot/winxp/i386/'

Generate driver cache

cd /tftproot;./infparser.py winxp/i386/

Start binlservice

./binlsrv.py

Booting the client

If all is well, you should be able to boot the client choosing to boot from network in the boot options, you should get to your PXELinux bootloader, and see the Install Windows XP option after pressing enter you *should* kick off your XP installation via network!! Congratulations!