this is obsolete doc -- see http://doc.nethence.com/ instead

unattended@sf usage and configuration on RHEL5 

 

Update: this guide is considered obsolete, we're now using WinPE (http://pbraun.nethence.com/doc/sysutils_windows/install_sys.html) 

 

 

Introduction 

We don't like unattended@sf, we prefer to use our own scripts (http://pbraun.nethence.com/doc/sysutils_nhii/index.html) to install Windows XP automaticly. But here's the guide for using it with RHEL5 anyway. 

 

 

Applications only 

If you only want to install applications on an existing Windows sytem, follow only tose parts: 

- Installation 

- Scripts 

- Samba configuration 

then map Z: to \\server\install, add z:\bin to your path, define winlang and run the batch scripts from z:\scripts. 

 

 

Specifications 

Here's a few hints: 

- best is to configure two network interfaces, one on your local network and one for serving PXE separately. 

- normally we should configure a dns record so that 'ntinstall' points to the samba share. But you can also skip this step, here we simply force the samba server IP in the PXE configuration (z_path). 

- you'll need quite a large mount point store the third-parity install packages (~7GB if you want all of them). 

- be careful, depending on your level of automation (see below) you have to be careful to what subnet of yours you'll plug this PXE monster in. 

 

 

Dependencies 

Make sure you've got those available, 

rpm -q \
xinetd \
tftp-server \
syslinux \
dhcp \
samba \
samba-client \
perl \
unzip

Note. no need for 'named', as mentioned in the introduction here. 

 

 

Installation 

Note. we're assuming quite a large moint point at /srv/ (see specifications above). 

 

Fetch Unattended (http://unattended.sourceforge.net/) and extract the archives, 

cd /srv/
wget http://sourceforge.net/projects/unattended/files/unattended/49rc4/unattended-4.9.zip/download
wget http://sourceforge.net/projects/unattended/files/unattended/49rc4/unattended-4.9-linuxboot.zip/download
wget http://sourceforge.net/projects/unattended/files/unattended/49rc4/unattended-4.9-dosboot.zip/download
unzip unattended-4.9.zip
unzip unattended-4.9-dosboot.zip
unzip unattended-4.9-linuxboot.zip
ln -sf unattended-4.9 unattended

 

Make a symlink to easyness, 

cd ~/
ln -s /srv/unattended/install

 

 

Preparing the i386 folder 

Copy the i386 directory from the Windows XP Pro SP2 or SP3 CDrom or ISO to the install/os share, 

cd /srv/
cp path/to/share/winxp_pro_fr_sp2.iso .
mkdir -p winxp/
mount -o loop winxp_pro_fr_sp2.iso winxp/
mkdir -p ~/install/os/winxp/
cp -R winxp/i386/ ~/install/os/winxp/
umount winxp/

 

 

Scripts 

Unattended provides way to much application scripts (and you feel it when you download the packages) so get rid of everything but Perl, 

cd ~/install/
mv scripts/ scripts.dist/
mkdir -p scripts/
cd scripts/
cp ../scripts.dist/perl.bat .

and define precisely the applications you want e.g., 

cp ../scripts.dist/firefox.bat .
cp ../scripts.dist/putty.bat .
cp ../scripts.dist/spybot.bat .
cp ../scripts.dist/thunderbird.bat .
wget -O - http://sourceforge.net/apps/trac/unattended/wiki/filezilla?format=txt \
| sed '/^{{{/d; /^}}}/d; /^==/d' > filezilla.bat
wget -O - http://sourceforge.net/apps/trac/unattended/wiki/WinRar?format=txt \
| sed '/^{{{/d; /^}}}/d; /^==/d' > WinRar.bat

Ref. the last ones come from http://sourceforge.net/apps/trac/unattended/wiki/Scripts 

 

Update the scripts you selected (otherwise you might have lots of 404's while fetching them), 

cd ~/install/tools/
./script-update

 

Now download the language specific (here French) packages for the choosed applications, 

cd ~/install/tools/
./prepare FRA

Note. ENU (English) is the default 

 

See if some packages are missing (they shouldn't, since we updated the scripts), 

cd ~/install/tools/
./check FRA

Note. ENU (English) is the default 

 

 

Samba configuration 

Configure Samba to share the install folder with login and password 'guest' e.g., 

cd /etc/samba/
mv smb.conf smb.conf.dist
#sed '/^[[:space:]]*#/d; /^[[:space:]]*;/d; /^[[:space:]]*$/d' smb.conf.dist > smb.conf

like (Samba 3.0.33 on RHEL), 

[global]
        server string = Samba Server Version %v
        security = SHARE
        passdb backend = tdbsam
        load printers = No
        cups options = raw

 

[install]
        comment = unattended
        path = /srv/unattended/install
        guest only = Yes
        guest ok = Yes

Note. 'public = yes' is the same as 'guest ok = yes' 

Note. 'security = yes' plus 'guest only = yes' skips authentication (see the smb.conf manual) 

 

Create and setup a password for the guest account, 

groupadd guest
useradd -s /sbin/nologin -g guest guest
smbpasswd -a guest
smbpasswd -n guest

Note. we're not using 'username map' (/etc/samba/smbusers) 

 

Start and enable the daemon at boot, 

testparm -s
tail -F /var/log/samba/*
service smb restart
service smb status
chkconfig smb on

 

Check you're able to connect with as guest user, 

smbclient -U guest -L 127.0.0.1

also check from a windows XP host, 

start > execute
\\server\install

 

 

PXE configuration 

Proceed with a usual PXE configuration (http://pbraun.nethence.com/doc/net/pxe.html), 

cd /etc
vi dhcpd.conf

like, 

allow bootp;
ddns-update-style none;
allow unknown-clients;

 

subnet 10.1.1.0 netmask 255.255.255.0 {
  range 10.1.1.51 10.1.1.99;
  next-server 10.1.1.1;
  filename "pxelinux.0";
}

 

Serve the Unattended kernel and initrd. Copy the templates, 

cp -R /srv/unattended/linuxboot/tftpboot/* /tftpboot
cd /tftpboot
wget http://mp-gif.ac-versailles.fr/ftp/unattend/fichiers/fr.kbd

change the boot options to point directly to your windows share w/o DNS and define your keyboard, 

cd /tftpboot/pxelinux.cfg
vi default

like, 

default menu.c32
prompt 0
menu title PXE
kbdmap fr.kbd

 

label unattended
        menu label unattended
        kernel bzImage
        append initrd=initrd z_user=guest z_pass=guest z_path=//10.1.1.1/install
        #kbd=fr-latin1

 

Enable TFTP, 

cd /etc/xinetd.d
vi tftp

add/change, 

        server_args             = -s /tftpboot
        disable                 = no

 

 

Unattended configuration 

For a fully automated installation, we will simply use untattend.txt for most of the settings, then config.pl just for a few other ones. 

 

First unattend.txt, 

cd ~/install/site
wget http://pbraun.nethence.com/code/net/unattend.txt
vi unattend.txt

note. unattend.txt in DOS text format (dos2unix...) 

note. it installs various applications : firefox, putty, ... (unattended scripts called with middle=) 

note. w/o winamp.bat, it has troubbles removing eMusic 

note. w/o winzip.bat, it also has troubbles, using 7-zip instead 

note. this examples needs that custom script (called with top=), 

cd ~/install/scripts
wget http://pbraun.nethence.com/code/net/0custom.bat

note. 0custom.bat in DOS text format (dos2unix...) 

 

Manually download missing packages. As for 0.49 with our untattend.txt, PuTTY is missing, 

cd ~/install/packages/putty
wget http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.60-installer.exe

 

Then config.pl (worgroup doesn't work into untattend.txt, donno why), 

cd ~/install/site
cp config.pl config.pl.dist
mv unattend.csv unattend.csv.dist
vi config.pl

add, 

$u->{'Identification'}->{'JoinWorkgroup'} = 'WORKGROUP';

 

$u->{'UserData'}->{'ProductKey'} =
    sub {
        my $media_obj = Unattend::WinMedia->new ($u->{'_meta'}->{'OS_media'});
        my $os_name = $media_obj->name ();
        if ($os_name =~ /Windows XP/) {
            return 'XP KEY';
        }
        elsif ($os_name =~ /Windows Server 2003/) {
            return '2K3 KEY';
        }
        return undef;
    };

 

$u->{'UserData'}->{'ProductID'} =
    sub {
        my $media_obj = Unattend::WinMedia->new ($u->{'_meta'}->{'OS_media'});
        my $os_name = $media_obj->name ();
        if ($os_name =~ /Windows 2000/) {
            return '2K KEY';
        }
        elsif (defined $u->{'UserData'}->{'ProductKey'}) {
            # It is OK for us to return undef as long as there is a
            # ProductKey.
            return undef;
        }
        die "No ProductKey nor ProductID!";
    };

Note. change XX KEY accordingly 

 

 

Additional drivers 

Add third-parity drivers to your windows installation, 

#cd ~/install/tools
#chmod +x lower-caseily.pl
#./lower-caseify.pl /srv/unattended/install/os/winxp

 

cd ~/install/os/winxp/I386
mkdir -p \$oem\$/\$1/drivers
cd ..
ln -s I386/\$oem\$/\$1/drivers

 

mkdir -p drivers/nic
mv ~/nic/Netrtle.inf drivers/nic
mv ~/nic/Rtenic.sys drivers/nic
mv ~/nic/Rtenic64.sys drivers/nic
mv ~/nic/Rtenicxp.sys drivers/nic
mv ~/nic/netrtle.cat drivers/nic

 

Also edit unattend.txt, 

       DriverSigningPolicy = Ignore
       OemPreinstall = Yes
       OemFilesPath = "..\$OEM$"
       OemPnPDriversPath = Drivers\NIC

 

 

Ready to go 

Start and enable the daemons, 

service dhcpd restart
service smb restart
service xinetd restart
#service named restart
chkconfig dhcpd on
chkconfig smb on
chkconfig xinetd on
#chkconfig named on

 

Boot the workstation(s) with PXE -- be careful -- it will automaticly erase everything and install Windows without even asking. Once the installations are finished, don't forget to unplug the PXE server from your network. 

 

 

Update procedure 

Just like for installation but overwrite the symlink, 

cd /srv
wget...
unzip...,
ln -sf unttended-new unattended

move the install/os share AND FREE SOME SPACE, 

mv unattended-old/install/os/* unattended/install/os
rm -rf unattended-old

and proceed with the script updates. 

 

Update the linuxboot kernel, initrd and syslinux, 

cd /tftpboot
rm -f bzImage initrd menu.c32 pxelinux.0
#wget http://mp-gif.ac-versailles.fr/ftp/unattend/fichiers/fr.kbd
cd /srv/unattended/linuxboot/tftpboot
cp -f bzImage initrd menu.c32 pxelinux.0 /tftpboot

 

No further changes are required. 

 

 

References 

http://unattended.sourceforge.net/step-by-step.php 

http://unattended.sourceforge.net/pxe-win2k.html 

http://unattended.sourceforge.net/apps.php 

http://unattended.sourceforge.net/meta.php 

 

References (application only) 

http://sourceforge.net/apps/trac/unattended/wiki/Scripts 

http://sourceforge.net/apps/trac/unattended/wiki/appsonly 

 

References (other) 

http://www.diderot.org/moodle/mod/resource/view.php?id=103 

http://www.productionmonkeys.net/category/technology/unattended 

http://www.corax.at/wiki/index.php/Unattended_Setup 

http://www.windowsnetworking.com/articles_tutorials/Customizing-Unattended-Setup.html 

http://herve.rozec.free.fr/wordpress/?tag=unattend 

 

References (mail archive) 

http://www.mail-archive.com/unattended-info@lists.sourceforge.net/msg03136.html 

http://www.mail-archive.com/unattended-info@lists.sourceforge.net/msg06135.html 

http://www.mail-archive.com/unattended-info@lists.sourceforge.net/msg09021.html 

 

References (M$) 

http://support.microsoft.com/kb/155197 

http://support.microsoft.com/kb/196288