This method describes how you can place all your Windows Vista 32-bit/64-bit ISOs, Windows 7 32-bit/64-bit ISOs, Server 2K8 ISOs etc. all one just one (large) USB Flash drive and install any version of Windows onto any system whenever you like.
This is a slightly neater alternative to tutorial #32 and uses FiraDisk.
Most of this is directly 'pinched' from a post by Karyonix (thanks!) on reboot.pro (this post) but I have added the AutoUnattend.xml file so that the process is completely automatic if using a USB Flash drive.
All ISO files must be kept in one single folder (called \ISO in this example. but you can change it) and if you want the user choice feature to work, then the ISO folder must also contain a marker file called 'Choose_an_iso'. Note that the ISO folder that contains the ISO files and the special tag/marker file Choose_an_Iso can be on any drive (e.g. a hard disk or a USB hard disk). You can change the name of the folder or marker file if you like, as long as you also change the path and name in the menu or you can just use one of your iso files as the marker file and delete the 'Choose_an_iso' file so it is not listed when the iso files are listed on the screen.
The method works if you use a USB Flash drive but does not work automatically for a single bootable USB hard disks because the AutoUnattend.xml file MUST be on a removable drive (which could be a USB flash drive or CD). If you want to use a USB hard disk, you have these options:
1. Prepare a USB Flash drive as described below but copy all the ISO files to the USB hard disk /ISO folder (or on a separate partition on the internal hard disk on the target system into a /ISO folder). If using two USB drives (USB Flash & USB HDD), make sure both are connected when you boot from your Flash drive.
2. Prepare a USB hard drive following the instructions below for a Flash drive. Then copy the AutoUnattend.xml file to any spare USB flash drive that you have. To install Windows, boot from the USB hard drive but make sure the USB Flash drive is also connected to the same system.
3. Prepare a USB hard drive following the instructions for a Flash drive below. When Windows Setup loads, press SHIFT+F10 to open a command console and type F:\firadisk\loadiso (where F: is the drive letter of your USB hard disk - which may vary).
4. See Addendum below for how to modify each Windows Vista/7/2K8 ISO so that a single bootable USB hard drive can be used, without a flash drive being needed and without the need for the user typing in extra commands.
1. Create a new folder on your hard drive called C:\WINFira
3. Now copy your Windows install ISO files to the C:\WinFira\ISO folder - Note: the iso filenames must NOT contain spaces!
You can download some Windows 7 ISOs from here.
4. The sample menu.lst contains 3 menu entries. The first menu entry is set to boot a fixed iso name. Just copy the first menu entry to make as many more as you like for all your ISO files. The second menu entry is merely to allow you to reboot to your hard disk after Windows has been installed onto it. The last menu entry allows the user to choose which iso to boot to, by getting the user to type in the name of the iso that they want to use. You can delete any menu entries that you do not require.
Edit the menu.lst and change the first line (title) and second line (ISO filename) in each menu, the sample menu included in the download, is shown below:
5. Now prepare a USB Flash drive using RMPrepUSB (optional - if you already have a bootable USB drive with grub4dos)
Run RMPrepUSB (use v2.1.622 or later)
To wipe and format the USB drive (optional) - set the following options in RMPrepUSB:
2. (any volume name you like!)
3. WinPE v2/v3 (or DOS or FreeDOS or XP)
4. FAT32 or NTFS (or FAT16 but it has a 2GB limit) and also select the Boot as HDD option
5. Tick Copy OS Files box and set the Copy Folder to C:\WINFIRA
6. Click Prepare Drive to format the drive and copy the files over
NOTE: Whether you already have an existing grub4dos USB drive or have just formatted one as detailed above, you need to install the latest version of grub4dos as follows:
Now click on Install grub4dos and choose Yes for MBR and hit Enter to copy across the grldr file. You need the correct grub4dos grldr file as this supports some newer grub4dos commands.
Contents of bootable grub4dos drive:
To test your menu, run RMPrepUSB and hit F11 to run the QEMU emulator (you do not need to create a virtual hard disk so enter 0 when prompted). Note that you can only test the menu out using this method, once the ISO starts to runs it seems to crash under QEMU!
This is the unchanged menu.lst provided with the download. You can add more entries or delete the ones you do not want.
Now go boot it and install Windows on something - you should see the blue Windows Command Shell window flash up briefly and install the FiraDisk driver and load the ISO file when Windows Setup starts. If a repair utility is present, you will be asked if you want to try to repair the current installation.
The screenshot below shows the INSTALL WINDOWS - Boot from any Windows ISO menu option action.
The grub4dos menu will look for a marker file (the file '\ISO\Choose_an_iso') on every drive and list the files in that folder when it finds it, so that the user can choose one of them...
Note: you must use the USB drive on a real system - WinPE needs to see a removable drive containing the AutoUnattend.xml file.
You may have problems using an emulator such as QEMU as the dd command needs a writeable drive in order to succeed - but most emulators do not allow writes to physical drives such as USB drives.
Once your OS has installed, if the system reboots back to the USB drive again, just use the 3rd menu item to boot from the hard disk (or just remove the USB drive and reboot).
Note: To add a standard XP install ISO to your USB drive, see Tutorial #30.
The auto-detection of \AutoUnattend.xml will not work if you use a hard drive (neither USB nor IDE/SATA) as a hard drive is not a 'removable' disk, we need to patch the ISO files themselves so that they will automatically run the LOADISO.CMD from the boot drive. To do this we need to copy the contents of the ISO file to an empty folder, modify the ISO file contents and then create a new version of the ISO file.
The guide below is for advanced users. I assume you already know how to mount images using ImageX (or DISM or GImagexX) or can use similar tools. It is easiest to download and install the Windows 7 WAIK. Please refer to my other tutorials (e.g. for WAIK and Virtual CloneDrive see Tutorial #1) for details on installing and using the WAIK.
1. On your Windows system, Mount the ISO that you want to modify using ImDisk or Virtual CloneDrive or any suitable tool and extract all the contents to an empty folder on your hard drive (e.g. C:\TESTISO)
2. If you want to be able to install any edition of Windows (e.g. all SKUs rather than just Professional), then delete the C:\TESTISO\SOURCES\EI.CFG file.
3. Run a WAIK command prompt as Administrator (found in the Start Menu after installing WAIK) and mount the C:\TESTISO\Sources\boot.wim file (use Imagex /info to determine the correct image number that you need to mount, usually this is Index #2 - but not always!). e.g.
(check what images you have by looking at the output)
4. Now we just need to copy the two files to the C:\mount\windows\system32 folder - winpeshl.ini and mysetup.cmd. Use the ones in the \FiraDisk folder inside the tutorial download. Their contents are shown below just for reference:
Although these two files are located in the \FiraDisk folder inside the Tutorial #43 Tut43_FiraIso.zip download for your convenience, they are not actually used in booting and can be deleted from the\FiraDisk folder after copying them to the mounted ISO folder - if you wish.
4. Commit the changes and unmount the mounted image - e.g.
5. Create a new ISO file from the WAIK command prompt:
to make a bootable ISO use the command:
oscdimg.exe -b"C:\Program Files\Windows AIK\Tools\PETools\x86\boot\etfsboot.com" -u1 -d -h -m -lWIN732SP1 C:\TESTISO\ C:\Win732SP1.iso
- OR - for a non-bootable ISO (but still usable for this tutorial and it will still load Windows Setup) use:
oscdimg.exe -u1 -d -h -m -lWIN732SP1 C:\TESTISO\ C:\Win732SP1.iso
(-l specifies the volume Label - note that the source path C:\TESTISO\ should end in a back-slash!). The -u1 (ISO9660) option ensures that the ISO is readable in both UDF and ISO 9660 (grub4dos readable) format - NOTE: when mounted by grubdos, all filenames will be uppercase - e.g. BOOTMGR not bootmgr. For maximum compatibility (e.g. with WinImage) you can also add -j1 for Joliet format (upper/lower case and long filenames).
6. Now follow the tutorial above but use this new ISO file. The Repair menu options in the menu.lst (menu's 2 and 5 can be deleted as you will be offered the repair option anyway).
7. (optional) The Autounattend.xml file in the root of the USB drive is not required and can be deleted.
If you delete the AutoUnattend.xml file, you need also to change the menu.lst slightly and delete the lines that mention AutoUnattend.xml, otherwise the grub4dos menu will give an error as the file no longer exists.
8. The new ISO should allow you to install any Edition of Windows that is contained within the Install.wim file. You can also use the same files on a USB Flash drive if you wish.
Note: MySetup.cmd can run different versions of Setup.exe
X:\Setup.exe will run Setup and offer the Repair Operating System option.
%RAMDRIVE%\Setup.exe and \Sources\Setup.exe will go straight to the 'Install Windows' GUI and will not allow the user to Repair Windows.
If you do not want the Repair option offered, you should comment out the line shown in purple in MySetup.cmd (i.e. place a double colon :: in front of it - or delete the line).
Check you have a recent (2011) version of grub4dos - only later versions support grub4dos variables. If you already have a grub4dos boot drive and do not want to re-format it or install grub4dos using RMPrepUSB, then just copy over the grldr file from the RMPrepUSB folder to your USB boot drive to update it.
If any of the commands fail, try adding a pause command after each line to see which line gives the error:
title Install Windows 7 64-bit Enterprise Edition\nRun the Windows install DVD to install a copy of Windows to your hard disk
echo 1 && pause
find --set-root /Firadisk/loadiso.cmd
echo 2 && pause
set mm=map /ISO/%MYISO% (0xff)
If the map command fails for 'file not contiguous' - you will need to run WinContig.exe (download from here) on the failing ISO file (on the USB drive) to defrag it. If this fails to work (usually because you do not have enough spare space on the USB drive), then you will need to copy ALL the files from the USB drive to your hard disk, reformat the USB drive using RMPrepUSB as in step 3. It is often faster and easier to re-copy the files than it is to use WinContig on a large USB iso file.
Some grub error numbers are reported here - these may or may not be the same as in grub4dos, but may be useful as a reference.
If Setup seems to want to install the wrong version of Windows (e.g. you are prompted to install Vista Business instead of say Windows 7 Home Premium) check that none of your drives have a file in the folder \SOURCES called INSTALL.WIM - this includes any Windows install DVD-ROM you may have left in your DVD-ROM drive!
Some members of reboot.pro have reported that their system does not detect the AutoUnattend.xml on their USB pen. In one case this turned out to be an unlucky combination of Buffalo USB pen, Server 2008 ISO (not R2) and a Dell Latitude E6400. Other USB pens worked and other OS ISO's worked. Another user reported difficulty with their SanDisk pen. If the blue command console window does not briefly pop-up and run during the boot from the ISO or the first part of the Windows Setup GUI, then press SHIFT+F10 to get a console window and type DISKPART followed by LIST DISK to see if your USB drive is listed (if no USB drive is listed then it means your USB drive is incompatible with the OS ISO your are trying to use) - if the USB drive is not listed, type RESCAN and then LIST DISK to see if it is now listed. If it is you may have an incompatible USB drive - try a different make or model. Use EXIT to quit Diskpart.
Alternatively, try the workaround for Fixed disks at the top of this page (i.e. also insert another different USB pen drive with the AutoUnattend.xml file on it).
If you are using an OEM Recovery Disk ISO file, the AutoUnattend.xml detection may be suppressed. In this case you will have to use the manual method detailed in the workaround for Fixed disks at the top of this page and run a command prompt (SHIFT+F10 may not work so use the OEM Command prompt menu entry instead) - or - unpack the ISO and make a new one without any unattend.xml file in it (the new ISO does not need to be bootable so any 'makeiso' tool will do to make the ISO).
How it works (when using a USB Flash drive)
The boot/mapping sequence goes like this:
The way that we pass the correct path for the ISO file is via these lines in menu.lst
When LOADISO loads the FiraDisk driver using devcon.exe, FiraDisk looks for the special grub4dos parameter in memory and then searches all media until it finds the file specified and then loads it as a CD/DVD.
Some ISOs do not allow the user to choose the repair option but instead show all Editions of Windows that are present in the install.wim file if an AutoUnattend.xml is detected and is valid. This is great unless you actually want the Repair option! To force the repair option to appear, we need to remove the text from within the AutoUnattend.xml file. This is what the dd of=()\Autounattend.xml line does in the 2nd menu. It overwrites the \AutoUnattend.xml file with a lot of spaces. The files must be over 2K in size because the NTFS filesystem (if used on your flash drive) under grub4dos gives an error if the file length is under 2K and you try to use dd.
Forcing the Repair option to be given is done using this line to get rid of the xml content by filling the file with spaces...
or we can load the ISO as a DVD for an install by putting the correct commands into the Autounattend.xml file using...