Wednesday, February 07, 2007

How-to: Create a dual boot laptop with Ubuntu and Windows XP

A few months ago, I configured my laptop to dual boot into Windows and Ubuntu. This post is dedicated to spreading the Ubuntu love :), and comes at the advice of a friend.

System Configuration
My laptop is a Dell Latitude D620, and came pre-installed with Windows XP Professional (+SP2). I also had a Ubuntu 6.10 CD (Edgy Eft) (I'd previously ordered it). You can alternately download it and burn an ISO. Note: Ubuntu comes with GNOME desktop, if you want KDE, you should download kubuntu.

Create the partitions
Mine was a fresh Windows install (the laptop was new), but if your's isn't, you should run defrag to free up any disk space before creating any partitions.

Using the Windows XP administration tool, I created 4 (roughly equal) partitions on my 80GB HDD: 1 for the Windows OS install, 2 NTFS partitions for my data and Windows programs, and 1 "blank" (unallocated) partition, for Ubuntu.

Install Ubuntu
First, I changed my BIOS boot sequence to boot from the CD drive before the HDD. Then inserted the Ubuntu CD, and booted into Ubuntu. I chose the Install Ubuntu option, and followed the steps in the wizard. At some point, the installation prompted me to create my partitions. I chose to "Manually edit partition table" and found my 4 partitions listed there.
I left the windows partitions as is - they show up as as sda* (*=1,2,3 depending on how many Windows partitions are there). Of the unallocated space, I created two partitions.
1. Linux swap, of 2GB (rule of thumb says that your swap partition should be about twice your RAM)
2. Linux (OS) partition, of all the remaining space.

Note: A lot of people forget to create the swap partition.

Almost done, just Reboot
I just continued and completed the installation process, removed the CD and rebooted, and I was ready-to-go. GRUB installed automatically, and figured out its config based on the partitions. It made Linux the default boot partition, which suited me fine. You can always change the GRUB configuration if you want to change the order.

I configured my network connections, including wireless connections using the network configuration utility, and it all worked fine. Amen.

Troubleshooting
If what I described doesn't happen to you :), this is a good place to look for help. In fact, I read the whole article before I dual boot-ed my laptop just for some perspective.


7 comments:

Anonymous said...

You could also install VMWare server on your ubuntu and boot the windows partition from within ur linux. VMWAre server is free now (requires registration,though). That way you can alt+tab to windows even as you are working on ubuntu.

suresh

Sowmya Karmali said...

True, you can create a dual boot with VMWare. But before you actually dual boot, understand why you are doing it, because what you use will change depending on what your requirement is.

Most of us will work on one OS at at time, and in that scenario, VMWare slows down your machine (since multiple OS are in memory).

If you need to work on multiple OS at the same time (e.g., you are testing your product) I'd recommend that you use VMWare. Thanks for bringing this up, Suresh.

Anonymous said...

Good How-to!!! And I sincerely appreciate your effort in sitting down, writing it all and posting it at 1.22 AM!!! Tee hee...

Neways, pretty much the same procedure for me on my Asus A8j lappy albeit one difference... I installed it to my external USB HDD. It works kewl... And yeah, it's awesome...

I'm amazed at the extent to which linux has gone with UBUNTU!!!

Chao...
Ashwin aka The Cruisemaniac

Anonymous said...

Hi,

Great "How-To."

I'm a Linux Virgin taking my first steps into that territory.

A few questions:
1a) When you're in Ubuntu, can you access the 2nd and 3rd partition's files? (The NTFS partitions you created earlier).

1b) Conversely, when you're in Windows, can you access files in the Ubuntu partition?

2) What is this Windows XP administration tool you speak of? Can you please point to a link to it?

3) The 20GB partition that you created for Ubuntu, is that just for the OS or also for the files (documents etc.)? I read somewhere that 2GB is enough for the installation, can I keep it that low and save all my files in one of the other partitions -- or does Ubuntu have problems with NTFS)?

Thanks a lot for your help,
- Adam

Sowmya Karmali said...

Adam,

1 a)Yes, you can access the Windows partitions from Ubuntu.

1 b)No, you cannot do so by default. There may be a way that I don't know of.

2)It is the Windows System tools (fdisk or Format), that comes by default with windows. More here

3) 2GB is sufficient for the OS. I used 20GB because I wanted to keep a clean separation between the 2 working environments. I'd recommend you keep some more space (10GB) for programs and software on Ubuntu if you intend to develop something. For files (docs,music,photos etc) you can use your Windows FS.

hth,
Sowmya

Anonymous said...

Sowmya,

Thanks so much for the help.

One last question. Can I reverse the order of installation of OS? Can I first install Linux (in the unallocated partition) and then install Windows in the allocated partition?

Thanks,
- Adam

Sowmya Karmali said...

You can. I did Linux later because it gives me more control over the OS as compared to Windows. I really know little about Windows under the hood.