Wednesday, March 26, 2008

How to dual boot Vista and XP (with Vista installed first) -- the step-by-step guide

Scenario: You want to install Vista on your PC alongside your XP installation, on the same drive. You have installed Vista already. (If you have XP installed first, check out our earlier tutorial on how to dual boot Vista and XP with XP installed first.)

Tutorial Summary: We're going to use the DISKPART on the Vista DVD to shrink the Vista partition on the hard disk and create enough space for an installation of Vista. We'll then install XP, repair the Vista bootloader which will be overwritten during the XP installation, and then use the EasyBCD utility to configure Vista's bootloader to boot the XP partition.

This is an updated tutorial, based on our first Windows Vista/XP dual-booting workshop. The main difference is that EasyBCD has been updated, but the processes are essentially unchanged.

This tutorial was tested on a VMWare 6 Workstation and an AcerPower SK50 system.

Prepare Windows Vista

This tutorial assumes that Vista has been installed on a partition which takes up 100% of the hard drive, so we need to create some space. Boot off the Vista DVD. Hit Next from the start screen and then select “Install now”. (If Vista came preinstalled on your machine and you don't have a Vista install DVD, you can use the Gnome Partition Editor Gparted to do it. Our earlier tutorial on dual-booting XP and Vista if you've installed XP first describes how to use it.)

Install Vista

Install Vista

Don’t type in your product key and untick “Automatically activate Windows when I’m online”, then hit “Next”, and “No” when asked whether you want to enter the key.

Vista Product Key


Vista Product Key

When prompted to choose the edition of Vista you’re installing you can actually select any of them as we’re not doing a Vista install at this point. Also tick “I have selected the edition of Windows that I purchased” and hit “Next”.

Vista Version


Vista Version

Accept the license terms and hit “Next” again, then choose a Custom installation.

On the screen where you’re asked where you want to install Windows, you should see a single large partition marked Primary – this is where Vista is already installed.

Vista Partition


Vista Partition

Press SHIFT + F10. This is a Windows PE 2.0 shortcut to open up a command window – very useful trick.

Command Tool


Command Tool

Type in DISKPART and press Enter. This opens the Microsoft DiskPart application. You need to select the active disk, so type in:

list disk

The primary disk is generally Disk 0, so type in:

select disk 0

DISKPART Disk


DISKPART Disk

Now we need a list of volumes on this disk, so type in:

list volume

In this case Volume 0 is the one we want, so type in:

select volume 0

DISKPART Volume


DISKPART Volume

Now type in:

shrink

DISKPART Shrink


DISKPART Shrink

DiskPart will go off and reclaim as much of the drive as it can – you should get at least 50% of the space back.

Now type

EXIT

and

EXIT (again)

to quit the command window and get back to the install screen. Click Refresh and the partition window will update – you should now see the original Primary partition plus a brand new partition.

New Partitions




This is where we will install Windows XP. Eject the DVD, restart the machine (just hit the reset button) and boot off the Windows XP CD.

Now, install Windows XP

When the Windows XP setup reaches the point where you’re prompted where it is to be installed, you’ll see that while XP can see the space we created earlier, it can also see the partition with Vista on it.

XP Partition


XP Partition

You should be able to see the space you reclaimed on the disk earlier which has become "unallocated space".

Create a second partition using the Windows XP installer screen above by selecting the free space on the drive and pressing "C" to create a partition (if prompted, choose NTFS as the file system.)

Irritatingly, XP assigns a drive letter to this partition (C:) which means that it will use the next available drive letter after all the other physical drives have been taken into account.

This means that the system drive of the XP installation won’t be C:.

From XP’s perspective this isn’t really a problem – it’s smart enough to figure out where everything should go – but some applications make assumptions about where they should install to, and can’t cope with a non-standard Windows configuration.

This was also the case with our tutorial on dualbooting Ubuntu and XP, where Ubuntu had been installed first. However in that scenario, even though the XP system drive had a non-standard drive letter, it couldn’t read the Linux partitions so there was no danger of the two systems overlapping. This is not the case with Vista/XP.

Nonetheless, install XP as normal – there’s no need to do anything differently.

IMPORTANT NOTEafter the initial file copy, Windows XP reboots and loads up the GUI-based component of the install. You may get the following error: “A disk read error occurred – press Ctrl-Alt-Del to continue”. This is caused by a corrupt bootloader – click here to see how to fix this problem.

When the system reboots it won’t bring up a boot menu. Although XP recognises the Vista partition it doesn’t recognise Vista itself.

The Windows XP bootloader gets installed to the MBR and Vista can no longer boot.

When XP loads, open up Windows Explorer and you’ll see something interesting – a C: and (in this case) an E: drive.

The C: drive contains Windows Vista, and as Windows XP can read NTFS partitions, it can browse and modify Vista’s file structure.

More importantly, applications which have installation paths hard-coded into their install scripts rather than using Windows system parameter variables could easily dump files into C: when they should be installing to E:. This isn’t such a great situation.

Two Drives

Two Drives

Restoring Vista and dual booting

Because you can’t use the Windows XP bootloader to boot Vista, we have to reinstate Vista’s bootloader to the MBR and configure it to manage both operating systems.

Compared with scenarios involving Ubuntu where you have to reinstall the GRUB bootloader, getting Vista up and operational again is very easy.

Boot from the Vista DVD and on the screen where you’re prompted to “Install now”, select “Repair your computer”.

Repair Vista

Repair Vista

The next screen searches for local Vista installations – there should only be one, so click Next.

Choose Vista

Choose Vista

This loads the System Recovery Options screen. Select the first option – Startup Repair. This looks for problems which would prevent Vista from loading (like a missing bootloader) and automatically fixes them.

Startup Repair

Startup Repair

If you click on “Click here for diagnostic and repair details” and scroll to the bottom of the list, it shows that the problem detected and repaired was a corrupt boot sector (according to Vista, anyway).

Repair Diagnostics

Repair Diagnostics

Click Close and then Finish, and the system will restart and boot into Vista.

Now we need to enable dualbooting with XP, and EasyBCD is the best application to achieve this.

Download and install EasyBCD.

Launch the app and go to Add/Remove Entries.

Under “Add an Entry” and under the Windows tab and select in the Version drop-down list “Windows NT/2k/XP/2k3”.

Change the Drive to E:\ and the name to “Windows XP”, then click “Add Entry” and “Save”.

Vista & XP - EasyBCD

Vista & XP - EasyBCD


Reboot the system and you’ll have two entries in the Vista bootloader, and can boot into either operating system.

Vista Bootloader

Vista Bootloader

Removing Windows XP

If you eventually decide that dualbooting XP as the second OS isn’t all it’s cracked up to be, it’s pretty easy to undo the changes made.

Use EasyBCD to remove the Windows XP boot entry, and then go into Computer Management (right-click on Computer, Manage) and go to Disk Management.

Right-click E: drive (the Windows XP partition) and select Delete Volume.

Right-click the newly-created partition and select Delete Partition.

Then right-click the C: drive (the Vista system partition) and click Extend Volume – this opens up the Extend Volume Wizard.

Extend Volume Wizard

Extend Volume Wizard

The wizard gives you a readout on how much space is actually available to extend the partition – enter in how much you want to use and press Next. Vista will extend the system partition to reclaim the disk and Windows is well and truly gone.

Fixing the corrupt bootloader

If the Windows XP bootload corrupts during the install, performing a reinstall won’t fix it, nor will going into the XP Recovery Mode and attempting to repair the MBR.

Luckily, the install was up to the stage where all you need to do is be able to boot from the Windows XP partition, and the install will pick up from where it left off.

To achieve this, follow the procedure outlined above to restore the Vista bootloader (under "Restoring Vista and Dualbooting").

This allows the system to boot into Vista, and then you can use EasyBCD to create an XP boot entry and boot into that to continue on with XP's installation. (For details on using EasyBCD, also see the section "Restoring Vista and Dualbooting".)

No comments: