Install Windows on a computer that has Ubuntu on it !

The Ubuntu installer is fully capable of squeezing Ubuntu onto a computer that has Windows on it. What about the other way around? What if Ubuntu is the only operating system that’s installed and you want to install Windows alongside?
Here’s how it’s done—these steps tell you how to make space for Windows, install it, and then repair the boot loader so that Ubuntu can once again boot:
Boot from your Ubuntu installation CD/DVD and select the Try Ubuntu… option from the Ubuntu installer boot menu. Once Ubuntu is up and running click System → Administration → Partition Editor. This will start the Gparted partitioning tool. Right-click the Ubuntu partition (it will be the largest in Gparted’s display) and click Resize/Move. In the dialog that appears, click and drag the right-hand edge of the partition so that the Ubuntu partition shrinks to make space for Windows. About 3-4GB should be enough, depending on your needs. Click the Resize/Move button. Then click the Apply button in the main Gparted window. Once resizing is complete, you should see that Gparted now indicates an “unallocated” area to the middle-to-right of the disk display, similar to that shown in Figure
Partition Editor – Allows you to resize the space for Windows Installation

 

Reboot the computer using your Windows installation CD/DVD and install  Windows as you would normally, on a blank hard disk, but with one caveat—select the Unpartitioned Space option when prompted where on the disk you want to install Windows. Be careful you select it again after creating the partition—it will probably be identified as Partition 3 [New (Raw)]. You’ll be warned the other operating system on the disk must be marked inactive.
Once Windows installation has completely finished and the Windows desktop appears, reboot from your Ubuntu installation disk. You’ll now need to restore the Ubuntu boot loader (you’ll no longer be able to boot your Ubuntu installation on the hard disk, but don’t worry—it’s still there!). Select the Try Ubuntu… option on the menu. Once the Ubuntu desktop appears, open a terminal window (Applications → Accessories → Terminal). Then type the following:
Restore the Ubuntu boot loader
$ sudo grub
grub> find /boot/grub/stage1
You will see something like (hd0,0). Using this information, type the following
grub> root (hd0,0)
grub> setup (hd0)
grub> quit
When you reboot, the Ubuntu boot menu will be back but you now need to add an entry for Windows. Choose to boot Ubuntu and, once the desktop appears, open a terminal window. Type gksu gedit /boot/grub/menu.lst. At the bottom of the file, below the line that reads ### END DEBIAN AUTOMAGIC KERNELS LIST, type the following (this assumes that, as described above, you created the Windows partition in the middle of the disk, in-between the Ubuntu main and swap partitions):
Title of Boot into Windows
rootnoverify (hd0,1)
makeactive
chainloader +1
You’ll also need to change two lines at the top of the file—put a hash before the line that reads hiddenmenu on its own, so that it now reads #hiddenmenu. Then change the line that reads timeout 3 to read timeout 10 (the number of spaces between timeout and the number don’t matter). Then save the file and reboot. You should find that there’s now a Windows entry on the boot menu.
Source : Ubuntu Kung Fu Book

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s