Deploy Windows XP/2003 from Network

So here what we need: 

1. DHCP server also main Deploy server
Red Hat Enterprise Linux 5.5 ( not manadatory RHEL but any linux dist.)
           eth0: xx.xx.xx.xx ( NET )
           eth1: 10.10.10.4/16 ( LAN ) 

Samba Config
smb.conf
++++++++++++++++++++++++++++++++++++++++
[global]
           workgroup = WORKGROUP
           server string = Samba Server
           netbios name = samba1
           log file =/var/log/samba/%m.log
           max log size = 50
           local master = yes
           passdb backend = tdbsam
           null passwords = yes
           bind interfaces only = yes
           interfaces = eth1 lo
 

[reminst]
            path = /tftpboot
            browseable = yes
            guest ok = yes
            read only = no
 

dhcpd.conf
+++++++++++++++++++++++++++++++++++++++++
ddns-update-style none;
allow booting;
allow boot;
subnet 10.10.0.0 netmask 255.255.0.0 {
                range 10.10.10.20 10.10.10.50;
                filename “pxelinux.0”;
                next-server 10.10.10.4;
}
 

Setting up tftp files:
+++++++++++++++++++++++++++++++++++++++++
1. create  /etc/tftp.rules ( IMPORTANT )

rg \\ /
r KDCOM.DL_   kdcom.dl_
r BOOTVID.dl_   bootvid.dl_
r SETUPREG.HIV   setupreg.hiv
r PCIIDEX.SY_   pciidex.sy_
r 1394BUS.SY_   1394bus.sy_
r USBPORT.SY_   usbport.sy_
r USBD.SY_   usbd.sy_
r HIDCLASS.SY_   hidclass.sy_
r HIDPARSE.SY_   hidparse.sy_
r HALAACPI.SY_   halaacpi.sy_
r SCSIPORT.SY_   scsiport.sy_
r SPDDLANG.SY_   spddlang.sy_
r WMILIB.SY_   wmilib.sy_
r OPRGHDLR.SY_   oprghdlr.sy_
r VIDEOPRT.SY_   videoprt.sy_
r CLASSPNP.SY_   classpnp.sy_
r TDI.SY_   tdi.sy_

2. modify this line  of /etc/xinetd.d/tftp
server_args                = -vvv -s /tftpboot -m /etc/tftp.rules 

3. create a folder pxelinux.cfg inside tftpboot ( if not exists ) 

4. create a file default inside pxelinux.cfg
            default local ( if not exists )
            timeout 0
            prompt 1
 

            label local
                      localboot 1
           label 0
                     localboot 1
           label WinXp Sp3
                     kernel winxp.0
 

Here end the configs of main server
…so the structure of tftp folder should looks like

tftpboot –
                     \
                      |_ pxelinux.cfg-
                                             \
                                             |_ default
                      |_pxelinux.0
                      |_ winxp.0
                      |_ ntldr
                      |_ ntdetect.com
                      |_ winnt.sif
                      |_ winxp-sp3 \
                                          |_ $OEM$
                                          |_ i386
 

Now let’s go to the next stage: 

1. copy content of  Windows XP cd/dvd 

1.1 mount /dev/cdrom /mnt /cdrom
1.2 cp -R /mnt/cdrom/i386 \$OEM\$  /tftpboot/winxp-sp3 

in fact we need just content of I386 folder, but if you have an unattended cd/dvd with custom install applications we will also need the content od $OEM$ folder. 

so, content of winxp folder will be {$OEM$, i386} 

1.3 rename I386 to i386
1.4 rename of all files inside i386 folder from upper cases to lower cases; 

for f in `find`; do mv -v $f `echo $f | tr ‘[A-Z]’ ‘[a-z]’`; done
Just…. ignore if you get some errors.
the ideaa of renaming files is: Linux is case sensitive; Windows setup is serching for files inside i386 folder and is searching for lowercase files names, except a few files ( that’s why I have to create the tftp.rules ) 

2. content of winnt.sif  file 

[Data]
AutomaticUpdates=”Yes”
Autopartition=1

floppyless = “1”
MsDosInitiated=1
OriSrc = “\\samba1\reminst\winxp-sp3\i386”
OriTyp = “4”
LocalSourceOnCD = 1
UnattendedInstall=”Yes”
[SetupData]
OsLoadOptions = “/fastdetect”
SetupSourceDevice = “\Device\LanmanRedirector\samba1\reminst\winxp-sp3”
 

[Unattended]
UnattendMode=FullUnattended
UnattendSwitch=”Yes”
OemPreinstall=”Yes”
OemSkipEula=”Yes”
FileSystem=NTFS
WaitForReboot=”No”
Repartition=”Yes”
NoWaitAfterTextMode=1
NoWaitAfterGUIMode=1
DriverSigningPolicy=Ignore
NonDriverSigningPolicy=Ignore
 

[Display]
Xresolution=800
Yresolution=600
BitsPerPel=32
Vrefresh=75
 

[SystemRestore]
MaximumDataStorePercentOfDisk=10
 

[GuiUnattended]
EncryptedAdminPassword=”No”
AutoLogon=”Yes”
AdminPassword=”123456″
TimeZone=035
OEMSkipRegional=1
OemSkipWelcome=1
 

[Shell]
CustomDefaultThemeFile=”%WinDir%\Resources\Themes\Royale Remixed.theme”
DefaultStartPanelOff=”Yes”
 

[Components] 

[UserData]
ProductKey=”insert key here”
ComputerName=XP-SP3
FullName=”deployed system”
OrgName=”nlite”
 

[RegionalSettings]
LanguageGroup=1,2
SystemLocale=”0409″
UserLocale=”0409″
UserLocale_DefaultUser=”0409″
InputLocale=”0409:00000409″
InputLocale_DefaultUser=”0409:00000409″
 

[Networking]
InstallDefaultComponents=”No”
 

[NetClients]
MS_MSClient=params.MS_MSClient
 

[NetServices]
MS_SERVER=params.MS_SERVER
MS_PSched=params.MS_PSched
 

[NetProtocols]
MS_TCPIP=params.MS_TCPIP
 

[params.MS_TCPIP]
AdapterSections=params.MS_TCPIP.Adapter1
 

[NetAdapters]
Adapter1=params.Adapter1
 

[params.Adapter1] 

[params.MS_TCPIP.Adapter1]
SpecificTo=Adapter1
IPAddress=192.168.2.1
DHCP=”No”
SubnetMask=255.255.255.0
DefaultGateway=192.168.154.1
DNSServerSearchOrder=192.168.1.254
WINS=”No”
NetBIOSOptions=0
[params.MS_NWIPX.Adapter1]
SpecificTo=Adapter1
NetworkNumber=00000000
PktType=0xFF
 

[Identification]
JoinWorkgroup=”WORKGROUP”
;JoinDomain=my-domain.com
;CreateComputerAccountInDomain=Yes
;DomainAdmin=jonnybravo
;DomainAdminPassword=password

[GuiRunOnce]
“%SystemRoot%\System32\nLite.cmd”
 

Here is a strip down version of winnt.sif
[Data]
floppyless = “1”
msdosinitiated = “1”
OriSrc = “\\samba1\reminst\winxp-sp3\i386”
OriTyp = “4”
LocalSourceOnCD = 1
DisableAdminAccountOnDomainJoin = 1
 

[SetupData]
OsLoadOptions = “/fastdetect”
SetupSourceDevice = “\Device\LanmanRedirector\samba1\reminst\winxp-sp3”
 

[UserData]
ComputerName = _name_
ProductID= _insert_CDKEY_
 

3. copy ntldr, ntdetect.com and the winxp.0 

cd /tftpboot

cp winxp/i386/NTDETECT.COM .
        mv NTDETECT.COM ntdetect.com
cabextract winxp/i386/STARTROM.N1_
        mv STARTROM.N12 winxp.0
cabextract winxp/i386/SETUPLDR.EX_
        mv SETUPLDR.EXE ntldr 

Now we can start all necessary services: 

A. dhcpd 

service dhcpd restart 

B. samba
service smb restart 

C. xinetd
service xinetd restart 

+++++++++++++++++++++++++
Now… how windows setup will be abble to acces the share ( aka how it will be abble to load network card drivers…)
1. Download this Necessary files for windows RIS
tar zxvf ris-linux-0.4.tar.gz
cd ris-linux-0.4
./infparser.py /downloads/winpe/i386/inf
  ** 

** We need to make a BartPE ISO Image.

after finishing this command we will have 2 new files inside ris folder: devlist.cache and nics.txt 

BINL Server 

Microsoft BINL protocol handles a lot of request/response, but we only need one of them. The client detects the network card by scanning pci bus, the it ask binl server for a driver that matches Vendor ID and Product ID. So we can launch our binl server replacement as follows: 

./binlsrv.py 
Succesfully loaded 662 devices 
Binlserver started.. 

The client will start to ask for some files to the tftpd server, then you will see something in the binlsrv output: 

Recv NCQ len = 48 
NCQ Driver request 
[R] Vid: 0x1022 
[R] Pid: 0x2000 
[R] rev_u1 = 0x2 
[R] rev_u2 = 0x0 
[R] rev_u3 = 0x0 
[R] rev = 0x10
[R] rev2 = 0x88
[R] subsys = 0x20001022 
Checking PCI\VEN_1022&DEV_2000&SUB_20001022 
Checking PCI\VEN_1022&DEV_2000 
Found PCI\VEN_1022&DEV_2000 in netamd2.inf 

So: in our case Network card is in AMD card and is require pcntpci5.sys file

cp /downloads/winpe/i386/system32/drivers/pcntpci5.sys /tftpboot/winxp-sp3/i386

NOW everything is DONE.

** WARN!!
IF network card is not detected by windows setup here are a few steps:
– download network card drivers for XP
– extract INF and SYS files
– copy INF file to /downloads/winpe/i386/inf
– rebuild devlist.cache  ( ./infparser.py /downloads/winpe/i386/inf  )
– copy xxx.sys file to winxp-sp3/i386
– restart BINLRSRV

Advertisements

One response to “Deploy Windows XP/2003 from Network

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s