Windows XP Remote Reimage

If you have RPC access to a PC it is quite easy to reimage it remotely.

This example applies to a working WinXP machine but can be easily altered for say Windows 7 or Vista.

Steps


 * Copy the needed files to the machine
 * Modify/replace the boot.ini for grldr (XP)
 * Reboot the pc, the XP bootloader chainloads the grldr bootloader which chainloads gPxe bootloader.
 * gPXE then obtains IP info and boots 'something' off the network, either via PXE, HTTP or FTP (or iSCSI or AoE etc.)

Main script
A bit of decoration :)

Test the machine given is alive AND connectable via RPC, it no hostname passed on command line it will prompt for one.

This copies the files to the remote machine, (boot.ini needs its attributes changing) and reboots it, so grldr will load and do the business.

[ Download the entire script HERE (all parts above)]

boot.ini
This is a typical modified Windows XP boot.ini script for windows' ntldr bootloader with grldr set as the default option

[ Download the entire script HERE]

grldr
grldr is a bootloader and is part of grub4dos 0.4.5b which is latest version at time of writing. (You cannot use syslinux etc. as they cannot read files on NTFS) (can ntldr boot gPXE directly? test!)

grldr menu
Simple menu.lst, grldr uses this to boot the gPXE kernel gpxe-1.0.1+-gpxe.lkrn

[ Download the entire script HERE]

gPXE script
gPXE script to embed when building on rom-o-matic.

In this example its booting my new Cyclone imaging system, kernel and initramfs via HTTP

In this example you would boot to the default PXE menu as if doing a normal PXE boot, allbeit using the drivers in the gPXE kernel, rather than using the target machines undi.

Or (on my specially modified Belkin router running lighty on a different port to built in webserver)

gPXE kernel
To create the gPXE kernel in rom-o-matic do this, leave the rest as default.

1)Choose an output format (in this case a kernel) > .lkrn 5)Customize image configuration options: > paste/modify suitable script (above) into the textarea 'Embedded script' near the bottom

Log
Very simple output csv log from bat script, in the example called clonemodremote-result.csv

Windows 7
Windows 7 / Vista

With Vista / Win7 as the target machine, you will need to use the bootmgr bootloader instead of ntldr.

Bootmgr cannot directly boot grldr (like ntldr can) and can only boot an MBR (grldr.mbr), which in turn loads grldr. Rather than repeat everything, the info is here about halfway down the page.