A Technical Note About Ghost And Sysprep

Be Safe And Considerate

Another technical note, of no particular interest to people who come here coveting the funny. It’s about software deployment, which isn’t even funny when it goes wrong, so there is no funny today. There will be more of the funny later, I promise. I hope, at least.

A friend of mine asked me some questions about Symantec, formerly Norton, Ghost; it was giving him grief, but he knows that I love it very much and that it loves me back and he felt (and I’ll admit to putting words in his mouth here) that he wasn’t getting any of that love, which was making him sad. I said (and I’ll admit to putting words in my mouth here) that baby, it doesn’t need to be like that, you just need to know how to treat it right. So, for the sake of posterity and Google and so forth, this is how you treat it right. His actual goal was a piece of bootable standalone media that would quickly blow a clean Windows machine image onto a standard(ish) standalone PC with minimal human intervention. There are two files mentioned here that I won’t link to, for fear of abusing my gracious hosts’ bandwidth, but I’ll mail you the disk image and the sysprep.inf file if you need them.

Oddly enough, the original recipient’s mail filter sent all this back to me twice for reasons of profanity, urging me to be more polite while also including the full text of the mail-filtering rule, a surprisingly complete list of variations on the offending terms. Which made me laugh: “Our politeness filter doesn’t want our delicate users to see this, but also thinks you’d be interested in this elaborate, comprehensive fecal howto!”

You must be this tall to ride the mail server, I guess. This sort of thing is, incidentally, the reason the inside of my head is such a sewer.

Ok, so are you all seated comfortably? Then we’ll begin.

You’ll need:

  • WinImage from here : http://www.winimage.com/ for manipulating floppy images.
  • IsoBuster from here: http://www.isobuster.com/isobusterdownload.php is helpful for tearing apart existing .iso images and getting the floppy image out of them, but not necessary to this process.
  • Nero is my preferred burner for this – it’s got very clear options about making bootable media. Making sure you’ve picked “2.88 MB floppy image” is I think the only thing you need to remember, during that process.

So, using WinImage on the floppy image that I mentioned above (a modified Win98 recovery disk), extract Autoexec.bat and look at these lines:

LOADHIGH MSCDEX /D:MSCD001 /M:8 /L:X
LOADHIGH SMARTDRV
LOADHIGH DOSKEY /INS
x:\ghost.exe -clone,mode=restore,src=x:\winxp_img.gho,dst=1 -fni

The “/L:X” bit in the first line chooses the drive letter to assign to the contents of the CD, and it’s used immediately in the last line. You’ll need to change the name of the file specified in “src=X:\whatever” to whatever the name of your ghost image is. Make your modifications and use winimage to reinsert it. The “dst=1″ bit means “restore to the first drive”. The -fni option, though, is critical. It is hard-won knowledge, and you will respect it as such; none of this will work on SATA drives if you don’t have that switch in that place, and that shit isn’t written down anywhere, because it’s Symantec and fuck those guys.

So, all you need to do is to change src=x:\winxp_img.gho to whatever.gho and burn the CD with ghost.exe and whatever.gho in the root directory, and the floppy image you’ve appropriately-modified as the magic 2.88MB booty thing, and the DVD that comes out the other end will boot straight into Ghost and ask the monkey in front of the screen if they want to restore that image, and they say yes, and you’re off. On modern systems, that should be done in less than half an hour.

So, that’s what happens if you have no hardware drift ever, and those machines never coexist on the same network. If so, you need to create that image using Sysprep and the sysprep.inf file that I mentioned above. You can read about sysprep here: http://support.microsoft.com/kb/302577 but the gist of it is “copy my sysprep file over the default, modified so that where it says

[UserData]
ProductKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
FullName=”Guy LeGuy”
OrgName=”GuyCorp”

… you have a legit Windows prodkey, username and orgname, then run sysprep.” Check the “use minisetup” option and click the “reseal”, not “factory prep” button. All this does is that instead of ghosting an image onto random hardware and then losing its mind when it boots and finds out that it’s a spirit inhabiting a different body, it boots into a defensive posture and does a hardware autodetect and autoinstall before moving on.

That should about cover it. Let me know if you’ve got any questions about the process.

One Comment

  1. Posted February 4, 2009 at 7:05 pm | Permalink

    I actually found this by near-complete randomness, not even Google searching for it, and it looks like exactly the sort of thing that’ll be super useful to me in the future. Could you email me the files in question? I expect that you can see my email address since you’re the owner of the blog and I entered it in the proper space.