VuULF Dot Com Geek, Tweak and Game

31Dec/080

How To Install Windows XP on a Windows Vista Machine (Part 4)

Step 4: Editing the Boot Configuration Database (BCDEdit)

These are the final few steps that you will need to perform in order to allow you to boot from both Windows XP and Windows Vista on the same machine, without having to switch back and fourth between drives in the BIOS. Hopefully, you still have your Computer Management screen up and an Administrative Command Prompt. If not, just refer back to STEP 3 to open those again, if you don't recall how it is done.

Administrative Command Prompt with NotepadIn the administrative console (command prompt), unless you had to open it again, type c: or whatever the drive letter is that corresponds to your Windows Vista installation. You will probably be in c:\Windows\System32 so we will want  to change the directory to the root of the drive. To do this, simply type 'cd c:\', replacing c with your drive lettter for Windows Vista, and removing the quotes, then hit enter. Now we will need to edit the boot.ini file which we copied to your Vista drive. Type 'notepad.exe boot.ini'.

Original Boot.iniHere is where things get a little bit confusing. We need to tell boot.ini on which drive Windows Vista lives, even though we use this file to boot Windows XP. This is because the bootloader is located on the Windows Vista drive and is not accessed from the Windows XP drive. You will have to look at the partition table again on the management console. You now need to find the Drive number that Windows Vista is installed on. In our example this drive was drive 1 and Windows XP was on drive 0. Because the bootloader is on the Windows Vista drive, we need to tell boot.ini to find the loader on the first partition of the same drive that Vista is on. If your Windows Vista installation is on drive 0 then you shouldn't have to make changes, but if it is on a different drive number then we will need to change the value of rdisk in the boot.ini file. In our example, the Vista installation is on drive 1 so we will have to change the boot.ini values of the rdisk to 1 in both the default and operating system sections. If you don't change both values, then you will get a second bootloader option for Windows XP, one working and one not, so make sure to change both rdisk values if you have to. As I mentioned, though, if your Vista is located on disk 0 then you will not have to make these changes. You should end up with a boot.ini file that looks like the following. Make sure you save your changes, if you had to make any, and exit notepad.

Edited Boot.iniAs you can see in the image above, we have changed the value of rdisk from 0 to 1.

Now we come to the final steps of the installation. Here you have to perform a series of commands in an administrative console which will install Windows XP into the Boot Configuration Database. BCDEdit is a handy little tool which will allow you to enter the values needed to create a multiboot environment. You can use this command to install a Linux boot partition or any other boot partition, however that is beyond the scope of this article, so we will stick with Windows XP.

BCDEdit CommandsBack at the Administrative Console, and at the root of your Windows Vista hard drive (c:\ presumably), we need to know two things. What would you like the bootloader to display as the operating systems name? and What hard drive letter does Windows XP reside on? The following commands (duplicated in the image to the left) need to be issued in order to install the OS into the BCD.

bcdedit /create {ntldr} /d "Windows XP"

This command installs only the name of the operating system that you wish to add to the BCD. You can replace Windows XP for whatever it is you want the OS to show up as in the bootloader. Make sure to note that you need braces around ntloader and you need quotes around the OS description. Next command.

bcdedit /set {ntldr} device partition=g:

This command tells the booloader where to find Windows XP. You will have to replace g: with the hard drive letter corresponding to the hard drive that holds your Windows XP installation. Don't forget to add the colon after the drive letter, and do note the space between device and partition. Next and final commands.

bcdedit /set {ntldr} path \ntldr
bcdedit /displayorder {ntldr} /addlast

The first command tells the Windows Vista bootloader where to find the ntldr file. The second command tells the Windows Vista bootloader to list Windows XP as an entry and to place the Windows XP entry at the end of the available operating systems list at boot time - this step is not optional, Windows XP will not show up in the list if you do not issue this command.

You can now close all of your windows, and reboot your machine. You should be greeted with a menu that lets you choose your operating system and will be able to boot into either Windows Vista or Windows XP. Enjoy!

-=[V]=-