Windows XP on a USB stick

Installing Windows XP from USB

I wrote this piece back in March 2006 before transferring it to my new blog. It’s quite possible that bits and pieces of this HOWTO are outdated. If any are and you find a solution, then please leave a comment for the rest of us.

— Roderick

What follows is a recipe on how to install Windows XP from USB. You can cut right to the chase or read about how it happened to me first. Sit tight, you’re in for a ride!

Case In Point

You’ve got this Acer laptop with a malfunctioning DVD drive. Specifically, you removed it from its bay and now Windows XP crashes when you plug it back in. Knowledge Base article 310664 matches it to a tee.

Provided solution: update to Service Pack 1, or disable DMA in the BIOS. Current situation: running SP2 and blessed with a “user-friendly” BIOS that doesn’t allow you to disable DMA.

Your luck just ran out, but – being the geek that you are – you don’t whine about it. Instead, you come up with this bright idea: let’s install Linux, that’ll work some magic! And so you get Gentoo Linux installed using a home-bred LiveUSB distribution. And much to your dismay, no proper hot-plugging implementation is provided for your laptop. Curses.

So finally, you call the support line to have them collect your laptop for repair. One problem here: you’re betting they won’t like seeing Linux boot up and, hoping to forego service costs, it’s up to you to reinstall Windows XP.

One problem here: you don’t have a working CD-ROM drive to install Windows XP off, and from experience you know that Windows XP won’t install from an external drive. Blasted!

Enter the cavalry.


The procedure here is provided without any warranty or support whatsoever. It worked for me and so it might for you. It also might blast you and your laptop to pieces. Some of the procedures described here can wipe all of your data. Thought I’d warn you.

I don’t mean to be inventive here, either. In fact, all the technology has been laid out for us and is readily available. All I’m doing is wrapping it all up in writing. Shouts out to everyone who provided the technology!

That being said, let’s get down to business.

Ground Zero: Ingredients

You’ll be needing ample space on a USB storage device like a thumb drive or external disk drive. 1 GB of storage will suffice. Possibly, you could access the setup files from a network share in which case you’ll only need a 256 MB thumb drive, but I haven’t tried that.

Personally, I booted off a 512 MB thumb drive and put the Windows XP setup files on an external disk drive. So a combination will do just fine, but just make sure that you’ve got enough USB ports: all USB devices will need to be plugged in and stay plugged in while we’re booted into BartPE later on!

You’ll also need a bunch of software, including a valid copy of Windows XP. The other software components can be downloaded freely:

Q: Why Windows 2003 Server Service Pack 1? I want to install XP!

A: Well that’s exactly the trick, though it’s a bit technical. During booting, Windows resets the USB port and loses your boot device. That’s why installing from USB normally fails. But by using Windows 2003 Server’s ramdisk feature in the early phases of booting, we avoid that problem.

Don’t be mislead though: you’ll be installing Windows XP all the same. It’s just that we’ll be using two Windows 2003 Server files from the Service Pack to do it.

You can also do a Windows 2003 Server installation using this same procedure, save that you’ll be needing to update to Windows 2003 Server Service Pack 1 instead of Windows XP SP2, below. That’s assuming, of course, that you’ve got a valid copy of Windows 2003 Server.

You will also need an already functional Windows system to prep the USB disk from. In addition, your target system (the one that needs reinstalling) should support booting from USB. Virtually all modern ones do though.

Finally, not all cheaper USB devices properly support being booted from. The BartPE forums have a partial list of ones that don’t.

Step One: Preparing the Windows XP Setup Files

For this procedure to work correctly, you’ll need Windows XP to be at Service Pack 1 or Service Pack 2. Many newer Windows XP CDs already have either one included.

You can check by inserting the CD-ROM and looking at the files in the top folder. There should be a file named WIN51P.SP1 or WIN51P.SP2. If you see either one, fast forward to step two.If there is no such file, or you’ve got a SP1 CD that you would like to update to SP2, proceed as follows:

  1. Copy the Windows XP CD-ROM to a location on your hard drive. We’ll be assuming C:\winxpcd. I strongly recommend you to use such a vanilla CD. Users have reported strange happenings with custom XP distributions.
  2. Download the Windows XP Service Pack 2 Network Installation Package.
  3. Unpack Windows XP SP2 by running WindowsXP-KB835935-SP2-ENU.exe -x. Note the -x parameter that will allow you to specify a location to unpack to. We’ll be assuming C:\winxpsp2.
  4. Integrate SP2 into the setup files by running C:\winxpsp2\i386\update\update.exe /integrate:c:\winxpcd.

If your system needs special drivers to run, this would be the time to include them (called “slip-streaming”). Doing so isn’t exactly trivial and should only be necessary if you, say, need non-standard SATA support. The process is beyond the scope of this article, but fortunately Google is your friend.

Step Two: Prepping BartPE

First we’ll prep the USB drive we’ll be using for booting. This is by far the largest step in the process, though it shouldn’t be difficult for anyone to follow. It requires a functional Windows system.

  1. Install BartPE. We’ll be assuming that you install to C:\pebuilder.
  2. Unpack PE2USB to C:\pebuilder.
  3. Unpack Windows 2003 SP1 by running WindowsServer2003-KB889101-SP1-x86-ENU.exe -x (that’s assuming that you downloaded the English version). Note the -x parameter that will allow you to specify a location to unpack to. We’ll be assuming C:\server2003sp1.
  4. Create a folder named C:\pebuilder\srsp1.
  5. Copy C:\server2003sp1\i386\setupldr.bin to C:\pebuilder\srsp1.
  6. Expand and copy ramdisk.sys by running expand -r C:\server2003sp1\i386\ramdisk.sy_ C:\pebuilder\srsp1.
  7. Start PE Builder from the Start Menu. Point “Source:” to the location of your Windows XP setup files containing SP1 or SP2.
  8. Make sure the “Output:” is set to “BartPE”. If using SP2: go into the Plugins configuration dialog and enable “RpcSS needs to launch DComLaunch Service First – SP2 only”.
  9. Hit “Build”.
  10. When it’s done building, insert the USB drive you intend to boot from and run C:\pebuilder\pe2usb -f [drive:], replacing [drive:] with the location of your USB drive. This will destroy any data on your USB drive! The drive shouldn’t be partitioned any larger than 1 GB. If it is, then repartition it using Computer Management in the Control Panel.
  11. Copy the Windows XP setup files to the USB drive (or another USB device if you have insufficient space left). You’ll only need the i386 folder.

If no errors occurred in the process, you should now be all set to boot from USB!

Note: it’s possible to use Windows 2003 Server as the operating system to boot from, but I don’t recommend it. Many of BartPE’s included utilities won’t work properly.

Step Three: Configuring the BIOS

You should now reboot and go into the BIOS configuration to boot from USB. Instructions for doing so wildly from system to system, but generally entail the following:

  1. Reboot the system.
  2. While booting (before Windows starts loading), get into the BIOS configuration screen by hitting something like F1, F2, Delete or Escape. Hotkey instructions are generally provided on the screen.
  3. Go to the section that has your boot devices.
  4. With your USB drive plugged in, the USB drive should be listed. If it isn’t, your system might not support booting from USB. Assuming that it is supported (as happens with almost all modern hardware), promote your USB drive to the primary boot device.
  5. Exit from the BIOS configuration, saving all changes.

If you’re completely new to BIOS configuration, BIOS for Beginners over at Tom’s Hardware might be a good primer. Be aware though, that you can seriously screw up your system by providing incorrect settings!

Step Four: Booting into BartPE

Assuming that you properly configured your BIOS and your USB device supports booting, BartPE should now load. Depending on the speed of your USB device, this may take a while.

If it isn’t working, then double-check the following before making a scene:

  • Is your BIOS properly configured for booting from the USB disk? (Is the USB device listed and does it have top priority?)
  • Have you correctly prepared the USB disk in step two? (Restart the procedure.)
  • Does your USB stick properly support being booted from? (Try another one!)

Step Five: Prepping the Hard Disk

You need to make sure that your hard drive is partitioned and formatted properly. Especially if you’ve had Linux or some other operating system on it, you’ll need to repartition and format it. BartPE has DiskPart for disk partitioning and A43 File Manager to format your drive.

If you are sure that your hard drive is set up properly (i.e. it has only run Windows, it has a valid FAT or NTFS partition) then you can safe yourself the hassle and skip this step.

This procedure will destroy any data on the hard drive.

To repartition:

  1. From the Go menu, navigate to DiskPart.
  2. Enter the commands needed to repartition your drive. For example, try the following: select disk 0 (select the first disk), clean (purges the entire drive, essentially resetting it), create partition primary (creates a single partition from the entire disk), assign (assign the partition a drive letter), exit (quits DiskPart).

This procedure will destroy any data on the hard drive.

To format:

  1. From the Go menu, navigate to the A43 File Manager.
  2. Right-click on the target drive (e.g. C:) and click Format. Should be self-explanatory.

Step Six: Launching Windows XP Setup

With your drive all ready, you can now launch the Windows XP setup with a few custom parameters. Let’s assume that the files are available at D:\i386.

Plugging in a device now won’t work. Remember that all USB devices will need to be plugged in right from the start while using BartPE.

  1. Run D:\i386\winnt32.exe /syspart:C: /tempdrive:C: /makelocalsource. Replace C: with the drive you want to install Windows to.
  2. Proceed with the installation. When asked to convert the installation volume to NTFS, answer No. The setup program incorrectly believes that your USB drive (which is formatted as FAT) needs conversion.

The setup program will then silently close, which might make you think that something went wrong. Don’t worry though. Reboot your system, remove the USB drive(s) and – if all went well – you can now finish setting up Windows XP. Congratulations!

512 thoughts on “Installing Windows XP from USB”

  1. Hi Roderick,

    This is great stuff and easy to follow! One issue from my side though…

    I’m able to boot from the USB but then it simply doesn’t detect my hard drive, therefore not letting me install Windows where I want it to (actually the USB drive is the c: drive).

    Do you have any idea why this is and what I can do? (I’ve tried many things already).

    Thanks, Tomás

  2. oh man seems ur not too experinced do u want us to do all of that just to install xp from external hard disk? its better to go buy new cd rom and rinstall it from there then hahahaha fool

  3. Awesome tip sheet, worked as advertised with zero trouble, 2gb stick, from xp original disk (upped to sp2 per your instructions).

    Very clear. Thank you!

  4. Hello,
    I have a Samsung n150 with Windows 7 installed and the hard drive is partitioned in two parts.
    i want to change that.
    I have prepared the usb, BartPe loads up but i can´t run Diskpart or format the drives.
    If i try to run Diskpart, it just opens a window for like half of a second and then closes and nothing happens.
    If i try to format the drives i right-click on the drive and choose format and again the drop-down menu disappears but nothing happens.
    So i just ran the windows xp setup and from there i could format the smaller drive but for the bigger one it said that “can´t format the drive because there are important files to finish the installation of xp”
    So i installed xp on the smaller part, but my question is, how can i repartition the drives?

  5. Re Step 11, I wasn’t clear if it should be the files from the winxp directory or the winxpsp2 directory.
    Which is it?

  6. You only need 2 tiny files… do NOT waste your time downloading the massive Server 2003 full edition.

  7. This worked for me after trying to use multiboot 10 to do the same thing and failing. For those confused about what it means when he says to unpack files, go into the windows command prompt, and type in what Bart says to type. I replaced -x with /x and removed the .exe, and sometimes I had to type chdir followed by the directory that the file was held. For instance, the windows service pack 2 exe file was on my desktop, and so I typed in chdir C:\Desktop, enter, and then typed the name of the exe file (without the .exe) and /x, and then I was prompted to type in the directory for the files to be unpacked.

Leave a Reply