Windows XP on a USB stick

Windows XP installation 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.

Disclaimer

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!

513 thoughts on “Windows XP installation from USB”

  1. “You will also need an already functional Windows system to prep the USB disk from.”

    let’s say you only have a computer and you need to reinstall the OS, probably damaged partitions, you can’t store all the required files to “prep the USB” on the virtual space of PE.

    they would like you more if you gave ’em a .rar file with all the files and tell them how to boot from it.

  2. hey folks!
    first of all, i read that some of you seem to be in need for a good partitioning tool. i used “ultimate boot cd 4 windows” (UBCD4Win), which is basically a BartPE builder with lots of plugins added. it also comes with good partitioning tools. only drawback: it takes longer to copy because it is larger.

    secondly, i want to present my problem:
    bartpe/ubcd4win worked like a charm such that i could wipe my hd and run
    winnt32.exe /syspart:c: /tempdrive:c: /makelocalsource /noreboot
    graphical setup ran without errors. i then removed the usb stick and booted into the newly created temp textual setup on my hdd. it created the folder c:\windows and put files into it.
    so i tried to boot the newly created windows installation. while booting, it said autochk.exe not found. after that it crashed with a blue screen with errors c000021a and c000003a which is something like “session manager couldn’t be started”.
    microsoft knowledge base sais this error could be an issue of roxio goback. but i’m sure, i never had roxio goback. also my partition is of type 7 (ntfs). roxio goback has an other partition type.
    last but not least, my device is an acer aspire 751 netbook with 160gb hdd.
    does anyone have a clue?

    greets, hank

  3. hey folks, it’s me again.

    i shouldn’t have integrated sp3 into my xp installation files.
    by creating a new xp installation folder from scratch and integrating only sp2, i got beyond the blue screen.
    setup is running just at the moment, already in graphical mode and it seems to be fine.

    conclusion: don’t integrate sp3 into setup i386 folder if you have an acer aspire 751. sp2 works.

    thanks for this helpful page, roderick!
    greets, hank

  4. I needed this for a Dell E1705 whose optical drive was not powering up. I had trouble using PE2USB and instead followed another’s suggestion here about using flashboot. In flashboot, I had to use emulation. Note, that selecting “emulation” isn’t an option, but there is a point when creating the bootable USB that you need to de-select “save data…”. This allowed the usb to boot up fine. I chose the USB-HDD option, and the rest is history. Installing as I type this.

  5. Great guide. As “Juice777” recommended, I used “Bootable USB-Drive Utility (http://www.911cd.net/forums//index.php?showtopic=21702) “. It all worked great.. i installed windows MCE and it works fine.

    NOTE1: As someone stated.. Harddisk gets drive letter D if no drive has letter C, the usb occupies that. Create partion(s) and restart and that will sort it.

    NOTE 2: if you have a 1 meg mem drive and wanna install bigger stuff.. its ok to copy that to the tempdrive before starting the windows installation (from usb to harddrive using the BartPE file manager.

  6. when i run the D:\i386\winnt32 /syspart:E: /tempdrive:E: /makelocalsource it says You must be an administrator to run this application. what should i do? thanks

  7. Howdy, I’ve just started up a site and in the middle of creating rather diverse articles. Do you object if I blog something about this blog? Obviously I’ll provide you and this post due acknowledgment.

  8. YES! MY LAPTOP IS WORKING AGAIN! I LOVE YOU! Hahah ;]
    I had to use 2 flash drives, cuz I got lazy to do it over when I got my 2GB PNY flash drive, and the other one was a 512MB Cruzer. I installed BartPE in the 512MB, then put the i386 folder (546MB) into the 2GB and it works! Thanks you for this great guide ;D
    Now I have Windows XP Black Edition on my laptop.

  9. Roderick, I did everything you told us in your tips, and all worked like a charm. For all those who didn’t succeed with windows installation I used a KINGMAX USB2.0 Flashdisk memory stick with 1GB available memory.

    Thank you so much for your help !

  10. Took a while but worked great in the end. Thanks.

    Solved an issue with trying to setup a Dell PC which needed the AHCI drivers. Even though I slipstreamed the drivers onto a CD with nLite, still had issues not finding the drive.

    Used a 4GB USB stick (with 4GB partition) and Service pack 3 with no issues, once I had all the files.

    Only comment would be that it was not clear what i386 files needed to be copied. Initially I only copied over the BartPE\i386 but soon realised that there were a ton of files missing, so then copied over the full slipstreamed set of files.

    Next job will be to see if I can slipstream all the Windows Updates into the XP installation. But will leave that for another day.

  11. Try to install Windows XP on a Compac nc4200. Run into the same NTOS problem as described a few times above.
    Every time I try to boot my laptop using BartPE the message c:\system32\ntoskrnl.exe file missing. Error code 14. press any key ….

    Unfortunately the solution is missing.
    Any suggestions?
    Thanks, Maarten

  12. I’ve been able to do everything up until the restart after taking out the USB. I haven’t been able to find my problems in the comments posted so far, though. My computer says:

    Non-System disk or disk error
    replace and strike any key when ready

    after taking out the USB. I’ve partitioned and formated it as the guide tells me to do, but I’m not really sure how to get past this screen. I’ve already copied i386 onto the hard drive so that the installation could continue after I take out the USB that seemed to have solved the problem for some people who couldn’t get past the restart, but I’m not sure what to do next. Anybody have a solution?

  13. Nevermind. I was stupid and had an external HD plugged into the laptop while I was trying to install it. Thanks anyways!

  14. Thanks a lot!!!
    It works perfect in my Acer Aspire One AOA150 netbook. I could install WinXP SP2. Used 1Gb USB Stick.

  15. Nice bro! Tnx! Works perfectly in my PC’s! It lessens my effort in troubleshooting unlike in typical installation using CD/DVD Drive and CD/DVD installer!!!

  16. WAIT UP?! What if if the USB doesn’t work at the end and gets a DISK ERROR and will not start? Is something wrong with my USB Drive?

  17. I SOVED MY OWN PROBLEM!! This USB I just made works PERFECTLY in another computer NO COMMENT. BIOS ANYONE? Don’t forget to read… It’s all there

  18. WTF>>>>!!!!!

    everything works fine until the step of installing Windows XP, everytime i insert the product key, it says “Invalid product key” though i insert my GENUINE XP Product KEY.

    WTF isgoingon here???

    anyone can help???

  19. I followed the steps exactly and when I restart the following message appears:

    iaStor.sys is corrupted

    Any Ideas on the problem???

  20. Thanx a bunch for this great tutorial!!!

    However, I too have something of a challenge: a HP Omnibook XE1400 with faulty XP-install, defective cd-rom, working floppy-drive but NO usb-boot-support from the BIOS…

    So I thought to simulate the USB-drive by partioning the laptops-hdd into 1Gb and 19GB, creating the first one as a USB-bartPE’s drive. No luck, it won’t boot… 🙁

    Any suggestions? Perhaps how to update the BIOS without the possibility of using floppy OR usb?

    Many thanx so far!
    Regards, Matthijs

  21. WOO HOO! After spending 2 days trying to use other methods for installing from USB, this procedure worked for me perfectly! I did initially have a problem in that I was attempting to use an OEM Windows XP CD. My first attempt at building BartPE gave me a warning about using an OEM disk, and even though it did build, it did not work. I just happened to have a genuine Windows XP CD (with no service packs), so used that and followed the instructions for incorporating SP2.

    Not sure if there is a solution out there that works using an OEM disk.

    I also did have an issue with my Product Key coming up as invalid. Realized that I was trying to use the OEM product key with a non OEM installation. Had to use the product key from the genuine Windows XP disk. At least I assume this is the explanation.

    Anyway, after struggling for 3 days, Windows is installed on my laptop with the dead CD drive and I’m now fine tuning it. WooT!

    Huge THANKS! BartPE rocks. I totally forgot that I had used it 5 years ago to revive a totally screwed up XP installation on a laptop.

  22. Wow, this really worked. Was able to install Windows XP SP2 though. Got errors with SP3. Anyways As such SP2 will update to SP3 via MS updates 🙂

  23. In STEP 4: PREPING BART PE BUILDER

    It say:
    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.
    ————————–
    Do I copy the I386 folder from C:\pebuilder\bartpe ?
    or the original i386 from my setup disk?

  24. Dear all,

    i hope you all will be fine

    Dear Reader,

    i have Dell OptiPlex GX 280 Desktop PC,

    BIOS = A04 02/09/05

    Service Tag = 8FRRL1J

    Express Service Code = 18367887943

    RAM = 1GB

    HDD = 80GB SATA

    Processor = 3.0 Ghz Pinless HT

    My problem is , when i install ubuntu from my bootable pen drive all is going very well, but when i install Microsoft Windows XP Service Pack 3 From USB FLASH Drive

    Setup Continuous well

    Like ” 1. TXT Mode Setup …. “,,,” 2. GUI Mode Setup…. ”

    when i start setup from TXT Mode Setup or GUI Mode Setup, The Setup Goes and Windows XP Loading Files very well but when it come ” Setup is Starting Windows ” My system Hangs for a while and give me a Blue Screen of Death (BSOD)

    Some Errors Like ” May B your hard drive is crash or viruses are … ” and some coding errors Like ” 0x00000.. ”

    Note : Ubuntu Setup Goes Very Well , Pen Drive is Kingston 2GB,

    Hurry Please i am still waiting for your helpful replies…

    mail me at = [email protected]

    Thanks

  25. Hello,

    I have question regarding the following remark in this tutorial:
    “The drive shouldn’t be partitioned any larger than 1 GB. If it is, then repartition it using Computer Management in the Control Panel.”

    I am trying for past 3 hours with all kind of tools to get the partition of my USB-stick below 1Gb, but none of the tools allow me to alter the USB-stick partitions.

    Any help/suggestions are very, very welcome!

    Cheers, Bas

  26. WORKS FOR ME ON MY ACER ASPIRE ONE NOTEBOOK.

    Carefully follow instructions “Run D:\i386\winnt32.exe /syspart:C: /tempdrive:C: /makelocalsource”. That’s what made the difference for me.

    Before though, my 120gb hard drive was unstable (blue screen of death) I used unetbootin (Ubuntu’s linux on usb version) (http://www.howtogeek.com/howto/linux/create-a-bootable-ubuntu-usb-flash-drive-the-easy-way/)) to re-partition my drive to NTFS using the gparted tool in ubuntu.

    Worked like a charm…

  27. I just successfully installed XP/SP3 on my Acer. The CD drive still doesn’t work, but installing from USB while walking around was oddly satisfying.

  28. Just echoing what someone else said – you MUST use the Windows 2003 *SP1* files. I tried with SP2 first and it hung on the “Please wait” during startup. Redid it with the SP1 files and it just worked.

  29. Yeah i am formating my Eee PC900 But when i finally put the USB in i get an Error called

    Disk Error
    Press any key to restart
    _

  30. Very rubbish guide to be honest. So many things are weird. Why did I need to use the PE builder and make a BartPE folder if it was never touched. You said copy the i386 folder to the usb but it was hard to finally understand which of the 3 i386 folders u are talking about. Why did I need the windows 2003 server and stuff if it never was used on the usb stick? I just did those things and they never got touched.

  31. @Richard on March 3rd, 2010

    The Server2003 SP1 files are needed for BartPE to be able to boot from a RAMDRIVE which is what these files are for.

    These files get picked up during the C:\pebuilder\pe2usb -f [drive:] step.

    To quote Bart Lagerwiej, “The 2003 setupldr with ramdisk option prevents windows from crashing or a 0×7b stop error (inaccessible boot device).

    This happens when windows is loading the USB devices drivers and the USB driver “resets” the USB bus. When we are riding from the ramdisk loader, we are not dependant any USB vendor windows driver from resettings the USB bus. We can now boot successful from “most” usb capable of booting hardware.”

Leave a Reply