skip to main | skip to sidebar

:: Linux tune-up ::

Settings, configuration files, tweaks, etc. for (K/X)Ubuntu

I have used GNU/Linux on and off since 1999. On 2005-11-08 I made Ubuntu 5.10 "Breezy Badger" my primary system. There is no going back.

Friday, January 27, 2006

Slipstreaming Windows CD under Linux

required tools: mkisofs, cdrecord, dd, mount, lcab, text editor
optionally: hex viewer, hex->dec converter

1. Create an image of Windows CD.

# dd if=/dev/dvd of=win_xp.iso bs=2048 conv=noerror,notrunc

2. Extract files from the image.

# sudo mount -o loop win_xp.iso /mnt
# cp -a /mnt win_xp_slipstream
# chmod -R +w win_xp_slipstream
# sudo umount /mnt

3. Extract the CD boot image and add it to the root of Windows directory. The value of the 'skip' parameter needs to be found. More info below.

# dd if=win_xp.iso of=boot.img bs=2048 count=1 skip=375
# mv boot.img win_xp_slipstream/

4. Add your RAID driver files in $OEM$/$1/drivers/

# mkdir -p 'win_xp_slipstream/$OEM$/$1/drivers/sii680r'
# unzip -j sii680r.zip -d 'win_xp_slipstream/$OEM$/$1/drivers/sii680r'

5. Create a .cab archive of the RAID driver's .sys file in the i386 directory.

# cp 'win_xp_slipstream/$OEM$/$1/drivers/sii680r/pnp680r.sys' win_xp_slipstream/i386/
# lcab win_xp_slipstream/i386/pnp680r.sys win_xp_slipstream/i386/pnp680r.sy_
# rm win_xp_slipstream/i386/pnp680r.sys

6. Get the RAID driver ID info.

# cat 'win_xp_slipstream/$OEM$/$1/drivers/sii680r/txtsetup.oem' | grep 'PCI\\VEN'

---8<---
id = "PCI\VEN_1095&DEV_0680&SUBSYS_36801095", "PnP680r"
--->8---

7. Add the RAID driver info to the bottom of txtsetup.sif before the last EOF. You'll need the .sys file name, "PCI\VEN" string, device ID and name.

# vi win_xp_slipstream/i386/txtsetup.sif

---8<---
[SourceDisksFiles]
pnp680r.sys = 1,,,,,,3_,4,1

[HardwareIdsDatabase]
PCI\VEN_1095&DEV_0680&SUBSYS_36801095 = "PnP680r"

[SCSI.load]
PnP680r = pnp680r.sys,4

[SCSI]
PnP680r = "Silicon Image Ultra-133 Medley ATA RAID Controller"
--->8---

8. Create a winnt.sif file and add the info below with the right driver path.

# vi win_xp_slipstream/i386/winnt.sif

---8<---
[Data]
UnattendedInstall=Yes
MSDosInitiated=No
AutoPartition=0

[Unattended]
OemPnPDriversPath="Drivers\sii680r"
--->8---

9. Re-create the CD image, now with the included driver.

# mkisofs -v -volid "XP_RAID" -d -D -l -N -relaxed-filenames -no-iso-translate -no-emul-boot -boot-load-size 4 -b boot.img -c boot.cat -hide boot.img -hide boot.cat -J -hide-joliet boot.img -hide-joliet boot.cat -o win_xp_slipstream.iso win_xp_slipstream

10. Finally, write the image to a CD.

# sudo cdrecord -v -sao win_xp_slipstream.iso

***

Finding the CD boot image

I. The quick and easy way.

1a. Dump ISO info from CD.

# isoinfo -d

---8<---
Eltorito defaultboot header:
Bootid 88 (bootable)
Boot media 0 (No Emulation Boot)
Load segment 0
Sys type 0
Nsect 4
Bootoff 177 375
--->8---

1b. Alternatively, dump ISO info from the image file.

# isoinfo -d -i win_xp.iso

2a. Extract the boot image from CD. Use the second value from the "Bootoff" line in the 'skip' parameter.

# dd if=/dev/dvd of=boot.img bs=2048 count=1 skip=375

2b. Same as above but from an ISO image.

# dd if=win_xp.iso of=boot.img bs=2048 count=1 skip=375

II. The real hacker's way ;)

1a. Dump a chunk of the CD to a file. Increase 'count=' to 2000 or more if the boot image is not found at first.

# dd if=/dev/dvd of=dump.img bs=2048 count=500

1b. Alternatively, dump data from an ISO image.

# dd if=os_image.iso of=dump.img bs=2048 count=500

2a. Look for the boot image string. Note the starting address in hex. If there are multiple matches, start with the first and complete all steps. If the CD doesn't boot, try the second matching address, and so on.

# xxd dump.img | grep '007c fb8c'

2b. Alternate method using 'hexdump' and visual examination. Look for a string "fa33 c08e d0bc 007c fb8c".

# hexdump -C dump.img | less

---8<--- 00bb800: fa33 c08e d0bc 007c fb8c c88e d852 e800 .3.....|.....R..
00bb810: 005e 81ee 1100 7412 81fe 007c 7575 8cc8 .^....t....|uu..
00bb820: 3d00 0075 7fea 3700 c007 c606 ae01 3390 =..u..7.......3.
00bb830: 8cc8 3dc0 0775 7e8c c88e d8c6 06ae 0134 ..=..u~........4
00bb840: 9080 fa80 726f c606 ae01 3590 bbfe 078b ....ro....5.....
00bb850: 073d 55aa 755f 5a88 1699 0468 8a04 6a0b .=U.u_Z....h..j.
00bb860: 6800 20e8 7603 0f82 0f00 601e 068a 1699 h. .v.....`.....
00bb870: 049a 0000 0020 071f 6168 7e04 6a0c 6800 ..... ..ah~.j.h.
--->8---

3. Convert the address from hex to decimal.

# echo $((16#bb800))

4a. Finally, extract the boot image from CD. Note the 'skip' parameter!

# dd if=/dev/dvd of=boot.img bs=1 count=2048 skip=768000

4b. Same as above but from an ISO image.

# dd if=os_image.iso of=boot.img bs=1 count=2048 skip=768000

4c. Alternatively, calculate and use LBA to make things look pretty. 0xbb800 = 768,000 -> 768,000 / 2,048 = 375 (R/LBA)

# dd if=os_image.iso of=boot.img bs=2048 count=1 skip=375

Another example: Windows 2000 CD.

---8<--- 000a000: fa33 c08e d0bc 007c fb8c c88e d852 e800 .3.....|.....R..
--->8---

0xa000 = 40,960 -> 40,960 / 2,048 = 20 (R/LBA)

# dd if=/dev/dvd of=boot.img bs=2k count=1 skip=20

Posted by Obi Bok at 11:43 PM

12 comments:

Anonymous said...

Cool. Thank you very much! I'm making a Windows XP setup CD with slipstreamed SP3.

10:31 PM

Anonymous said...

This tutorial was a lifesaver!
Thanks, now I can finally slipstream my own "usbwindows" ;)

7:41 AM

Obi Bok said...

Wow, somebody actually found my notes and thought they were useful... I'm flattered!

Glad I could help. It was an interesting project at the time.

10:15 AM

Joshua said...

Was getting an NTLDR error after using your instructions, so I tried them again and now I get random characters and no response using qemu to test. I'll check my genisoimage params to see if I missed anything, but I've been at this all day.

10:34 PM

Joshua said...

Tried it again last night with cut-and-paste genisoimage params, and it worked perfectly, so I must have copied the boot image file wrong first, then tried coming up with my own (simplified) params second. It worked perfectly, and now my fiancee's Dell is freshly installed with XP SP3!

12:00 AM

Obi Bok said...

I'm very pleased to see another success story. Enjoy.

9:58 AM

Helge said...

Thanks a lot for writing this info. Just slip-streamed SP2 and it works perfectly :)

12:32 PM

vfdvgf said...

This comment has been removed by a blog administrator.

12:56 AM

Chris Huebsch said...

Thank you for your article.

Your mkisofs command line was exactly that what I was searching for. No other article was able to provide that.

7:32 AM

Anonymous said...

Thanks for this post! I was finally able to install win xp in my HP pavillion laptop with a SATA disk.

6:50 AM

Anonymous said...

This really help me a lot! Kudos!

6:08 PM

Andrew said...

Everything has worked great until I got to the part about unzipping RAID driver files.

unzip: cannot find or open sii680r.zip, sii680r.zip.zip or sii680r.zip.ZIP.

9:37 PM

Post a Comment

Newer Post Older Post Home

Subscribe to: Post Comments (Atom)

Blog Archive

►  2007 (8)

►  08/19 - 08/26 (1)

CD/DVD eject - disable lock

►  05/20 - 05/27 (2)

kqemu - backport from 'feisty' to 'dapper'

qemu

►  04/29 - 05/06 (1)

PDF electronic signature

►  04/22 - 04/29 (2)

DPI - change from 75 to 96

nVIDIA binary driver freq fix (Feisty)

►  04/01 - 04/08 (1)

Airlink101 AWLL3026 wireless USB adapter

►  03/04 - 03/11 (1)

Aliases: ls, cp, mv, rm, less

▼  2006 (18)

►  11/12 - 11/19 (3)

Backport 'MPD' to Dapper using Edgy source package...

Compile 'darkice' with mp3 support

Chaintech AV-710 (VIA ICEnsemble Envy24HT-S VT1721...

►  11/05 - 11/12 (1)

autofs: mounting iPod & USB

►  10/29 - 11/05 (1)

VNC (a.k.a. KDE 'Desktop Sharing') crashing and sl...

►  10/22 - 10/29 (2)

Dapper directory sizes

Initializing existing RAID-0 setup to install Ubun...

►  09/03 - 09/10 (1)

nvidia-glx 1.0.8762 binary driver fix

►  04/16 - 04/23 (2)

Firefox - Flash audio fix

iPod - safe remove fix

►  03/19 - 03/26 (1)

prelinking

►  02/26 - 03/05 (1)

multi source audio

►  02/19 - 02/26 (1)

sudo settings

►  02/12 - 02/19 (1)

Firefox - compiling from source

►  01/29 - 02/05 (1)

Bootable CD/DVD with GRUB

▼  01/22 - 01/29 (3)

Slipstreaming Windows CD under Linux

X performace tweak

aptitude - purge old config files

►  2005 (25)

►  11/20 - 11/27 (6)

lm-sensors

FreeNX server

Firefox - user.js

Firefox - userChrome.css

Keyboard - Win-keys start menu

Kernel - CPU optimized

►  11/13 - 11/20 (7)

TV-out - NVIDIA

Icons - KDE

Mouse cursors

Swap like RAID 0

Firefox extensions

Monitor power management

KVM switch - mouse problems fix

►  11/06 - 11/13 (7)

DMA - CD/DVD

Login screen theme - KDE (KDM)

Firefox form widgets

Keyboard: 'Win' keys, media buttons - Logitech Ult...

Sudoed apps look

GTK1 - themes and fonts

Fonts - Firefox

►  10/30 - 11/06 (5)

Fonts - Konqueror

Fonts - LCD optimized (similar to ClearType)

Fonts - custom TrueType

Fonts - more TTF

Links

Linux is NOT Windows

Why Linux is better

Ubuntu GNU/Linux

Kubuntu GNU/Linux

Ubuntu Documentation Team

UserDocumentation - Ubuntu Wiki

Ubuntu Forums

Kubuntu Forums

Unofficial Ubuntu 5.04 Starter Guide

Breezy Customization Guide

Kubuntu 5.10 Quick Guide

KUDOS Unofficial Kubuntu FAQ

Automatix - Ubuntu automated GUI installation script

Automatix for Kubuntu

Ubuntu packages

Unofficial APT repositories

Penguin Liberation Front - pre-built litigious packages

Debian mentors - public package repository

Tuxfinder - Linux search tool

freshmeat - web's largest index of Linux software

KDE-Apps

Softpedia - latest Linux downloads

UsingLinux.org - Linux software and documentation for all your needs

Linuxsoft.cz - Linux software

Linux vs Windows software