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

James Bannan03 March 2009, 8:00 PM

How to dual-boot Windows XP and Linux, on a system where you have already installed XP. Easy step-by-step tutorial that doesn't assume prior knowledge of Linux.

Page 1 - Intro

Updated 28 February 2009 to use Ubuntu 9.04

Scenario: You want the simplest way to dual-boot XP and Linux. You've already installed Windows XP and now want to dual-boot it with Ubuntu 9.04

Summary of tutorial: This is an updated tutorial (we previously used Ubuntu 8.04, but in this tutorial we'll use Ubuntu 9.04 to make space on the XP partition and then use the GRUB bootloader to dualboot XP and Ubuntu.

This tutorial has been tested on a VMWare Workstation 6.5 virtual machine.

Continue to page 2: Install Ubuntu
Page 1 Intro
Page 2 Install Ubuntu
Page 3 Make room on the disk for Ubuntu
Page 4 Set up Ubuntu

Post your comment



First 50 Comments

View All Comments (238) RSS feed Email alert

judy mackenzie:

Thanks for a great tutorial to dual-boot XP and Ubuntu! All went well with the install, then tried to change boot sequence to make Windows XP default, removed 'saveddefault' from Ubuntu, but did not work, still wanted to boot Ubuntu first. Tried to go back into the terminal to see if I missed something, but now it will not allow me to put the password in, I can type in sudo gedit /boot/grub/menu.lst no problems, and it worked before, so what has happened?hope you can help,want to learn Linux so can ultimately get rid of Windows!'thanks

29 February 2008, 8:30 PM (5 years ago)report abuse Send to a friend reply

James Bannan:

The other way to load Windows XP by default is to change the value for “default” from a numerical value to “saved”. Then, GRUB will load whichever boot entry has been marked with “savedefault”.

Hi Judy - don't forget that to use the "savedefault" value to modify the boot menu, you have to use "saved" as the value for "default" instead of a numerical value.  Otherwise the boot menu will pick the default boot option based on the "default" number value.



29 February 2008, 8:42 PM (5 years ago)report abuse Send to a friend reply

judy mackenzie:

Thanks for the quick reply James but still not working.Heres an exerpt from the menu.lst, if u send me your email address I can send you a cop y of the lot.

title Ubuntu, kernel 2.6.17-10-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sda2 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-generic
quiet
boot

title Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sda2 ro single
initrd /boot/initrd.img-2.6.17-10-generic
boot

title Ubuntu, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
quiet
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1

thanks, Judy

29 February 2008, 8:42 PM (5 years ago)report abuse Send to a friend reply

Sweedenburg Field:

At the top of the .lst file (while editing) change the value after default to the value for the slot for XP. I had:

0 - Ubuntu, kernel 2.6.20-16-generic
1 - Ubuntu, kernel 2.6.20-16-generic (recovery)
2 - Ubuntu, kernel 2.6.20-15-generic
3 - Ubuntu, kernel 2.6.20-15-generic (recovery)
4 - Ubuntu, memtest86+
5 - Other OS's Divider(YES, this one is numbered)
6 - Windows XP

So this is my default:
"# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 6"

Along with that, I also edited the groot, which grub assigns as the default root. When I did only this, it didn't help but as it works now, I'm leaving it.:

"## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)" <~ 0,0 is my Windows root value

On a side note, I changed my time limit to 45 seconds because I always seem to look back at my computer when I actually want into Ubuntu as it goes 2, 1...
______________________________________________

Given, there may have been overkill done in this, but it sure fixed my problem. Anyone needing help understanding any of this feel free to e-mail me at Sweedenburg@Gmail.com or SweedenburgField on AIM. I really would Love to help.

29 February 2008, 8:42 PM (5 years ago)report abuse Send to a friend reply

panos (New user):

plz help!!
I followed the instructions given with ubuntu 7.10. Linux works fine but now, when i choose to boot with WIN Xp the message,"windows is starting up", appears, but the windows never start up!

Can you plz tell how to fix this?

31 March 2008, 9:19 AM (5 years ago)report abuse Send to a friend reply

WhiteKnight (New user):

so I started the install, and at the end of the process, I have a screen that says "Install 99% complete" "Removing All Of Ubuntu Art Work" and its been in that state since last night! Hard drive light occasionally lights (once per 20-30 seconds), mouse moves, but now what do I do? Force a hard boot? Looks like I can hit "back" or "cancel" from the install window. Should I just do a hard reboot and hope for the best?? I thought Ubuntu was more stable than windows? What gives? Please help!

17 October 2008, 6:18 AM (4 years ago)report abuse Send to a friend reply

CCCY:

Well : The above guidelines worked for me but not for my friend - now his XP is ruined and can't install ubuntu again ( Don't ask me why ). So people who want to try , it should work , but its slightly risky - What I would do is to think twice before you install - try not to install when you do not really want/need it as its slightly dangerous . But if you install it , I should say : Good Luck ! ( Note : 99.99% sure it will work ) !

29 February 2008, 8:42 PM (5 years ago)report abuse Send to a friend reply

AdminGuy:

There is nothing you can do to your MBR that is not recoverable using grub and some basic troubleshooting. Altering the MBR does not change the information on your windows partition AT ALL. The MBR simply points to where the pc should look for an OS. If it is corrupted, or contains incorrect config data, the pc will not boot. This can always be solved non-destructively by writing a correctly configured bootloader (grub, GAG, windows, etc.) installed.

I recommend anyone not familiar with working with MBR's (and anyone who is, for that matter) _BACKUP_ your MBR first, and know how to restore from that backup (boot disc/cd/usb, utilities, etc.) before they proceed.

If you take your time in understanding what you are doing and how/why, you will have a nearly 100% success rate.

29 February 2008, 8:45 PM (5 years ago)report abuse Send to a friend reply

tinge (New user):

Hi Adminguy - can you point to any resources on doing this (leanring to fix the MBR) my NTLDR goes missing when I install Ubuntu (in three separate installs) and I'd like to avoid starting from scratch AGAIN...

22 April 2008, 2:48 AM (5 years ago)report abuse Send to a friend reply

Jamie:

Hi James,

Thanks for providing the article above. I am hoping to try out Linux for the first time and this looks like it may provide a way in and Ubuntu also looks like a good starting distribution for a novice...

One thing I wanted to clarify about the article before I go ahead is this bit:

"Fortunately there’s almost no preparation needed from the perspective of the XP partition. Of course it needs sufficient space to install Ubuntu, and you can certainly create this space manually using either the latest version of the GNOME Partition Editor (available here), or use the application from the Ubuntu Live CD.

However, Ubuntu will use the same partition managing tools during installation, so we can leave it until that stage of the install."

Does this mean that I can effectively NOT worry about doing any partitioning - getting any other programs apart from the Ubuntu iso (I don't know whether the way Ubuntu does the partioning is any better than another program so I would prefer to follow JUST your instructions). Therefore, can you confirm that I can essentially skip that paragraph and head straight on to the next one starting "Install Ubuntu"

Thanks, Jamie





29 February 2008, 8:30 PM (5 years ago)report abuse Send to a friend reply

Augusto:

Thanks for the copy of Ubuntu7_04 included in the latest 'apc' issue (vol. 27, No.6). I followed the instructions to burn a bootable version of Ubuntu but my machine (Dell Dimension 5150) does not boot from the CD. I press F12 at booting time and select option 'boot from CD' but the machine doesn't recognise the CD and sends an error message.

I wonder if I didn't burn the CD correctly. I have checked and all files and directories seem to be there including the file 'start.exe', but still my PC doesn't boot from the CD.

Any help is appreciated.

Augusto


29 February 2008, 8:31 PM (5 years ago)report abuse Send to a friend reply

Numto:

You must download the iso file from ubuntu website and use a software like 'Virtual daemon manager' to manage iso file then you can easily burn with a burn sotfware

29 February 2008, 8:42 PM (5 years ago)report abuse Send to a friend reply

aj:

I am having the same problem while trying to boot from my CD drive. Could you please let me know how you solved this problem?

Thank You!

29 February 2008, 8:42 PM (5 years ago)report abuse Send to a friend reply

chessmaster2000:

check the bios settings. you want the boot sequence to be cd drive first, then hdd or floppy, finaly the drive still left. i have mine set as follows:
cd
hdd
floppy

to do this at initial start-up, access the bios using f-8 before any os starts to load.
you can then scroll down and find the exact application which opens the menu for boot sequence. i have win xp pro, and i use the second or third down the list. if it isn't the correct one hit esc to get back to the original list and check the next. once you set the boot sequence, you want to exit and save the bios settings.
you can then boot from the cd. (if no cd is in the drive, the bios tries to use the next boot entry and so on. if your hdd is second, it will boot from there, so don't worry about not having boot for the hdd os. you do, and it may take just a few short seconds to go through the sequence.)

29 February 2008, 8:47 PM (5 years ago)report abuse Send to a friend reply

jbussell:

you can use a basic cd/dvd burning programm to create a live cd like linux i use sonicDigitalMedia Plus but any programm will be similar i just choose the location of the .iso so say i select ububtu7.iso(has to be a .iso file) and click burn image and it burns it i check the cd and it should only have ubuntu.iso (or sam as downloded iso) then restart and boot from a CD it works!!.

29 February 2008, 8:42 PM (5 years ago)report abuse Send to a friend reply

Anonymous2:

Ordinary burners don't work because the create another .iso file and put the Ubuntu one in it. you need a .iso burner. these are free. do a google search under ".iso burner free" and use that to burn it. It should work.

29 February 2008, 8:42 PM (5 years ago)report abuse Send to a friend reply

ham_radio_rules (New user):

hey use imgburn!
google it an download it then make an chose the frist option
(burn image)the iso will come out as an image file then burn it
then boot on computer to make sure it works

23 July 2008, 12:22 AM (4 years ago)report abuse Send to a friend reply

Majkl (New user):

Hi, Augusto,

check your BIOS settings - there is a set order in which the boot sequence goes. The PC can boot from the HDD, from DVD-ROM, even from a copy. To boot from the CD/DVD you need to have the optical drive set as the default first option.

As to explain: When started, the PC is seeking some instructions. It checks the first medium (say CD) and when it finds something bootable, it boots up. If the drive is empty, it goes to the second medium (HDD) and boots from there. ... and so on. So, if you have the HDD (where your Win is) set as the first option, it will never boot from your CD.

Also you may wanna seek something about the "MD5 checksum" - a characteristics to make sure your burned CD is a complete match with what is on the Ubuntu site.

05 September 2008, 8:43 PM (4 years ago)report abuse Send to a friend reply

wwilliam.klein (New user):

Thanks mate, this is done now with dedicated hosting. Really helpful now.


05 August 2009, 6:47 AM (3 years ago)report abuse Send to a friend reply

Ismail:

Hi, I installed Ubuntu 6.10 to your instructions, but when I now try to boot to Windows XP my machine just restarts. The GRUB boot menu looks ok from what I can tell. The Windows XP entry is:
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1

Do you have any idea what could be wrong and how I can fix it? Any help would be greatly appreciated.
Thanks!

29 February 2008, 8:31 PM (5 years ago)report abuse Send to a friend reply

jiangzt:

I am Lenovo's

29 February 2008, 8:42 PM (5 years ago)report abuse Send to a friend reply

windows dual:

can i instal Ubuntu on an external hard drive instead of partitioning my internal one?

29 February 2008, 8:31 PM (5 years ago)report abuse Send to a friend reply

goo321:

yes, you can install second OS on external hard disk.

29 February 2008, 8:43 PM (5 years ago)report abuse Send to a friend reply

Fox:

I have followed this tutorial perfectly. I have followed countless other guides as well. I am able to install ubuntu perfectly fine, but on next boot up grub does not take over. Windows still loads without any grub boot loader... I've been working on this issue for days. Anyone have any suggestions why grub isn't starting?

-Fox

29 February 2008, 8:31 PM (5 years ago)report abuse Send to a friend reply

John Gilmour:

I have the same problem and no solution either.
I find that if the Unbuntu CD is in the drive, I get a choice of boot. Without the CD, no choice.

John

29 February 2008, 8:43 PM (5 years ago)report abuse Send to a friend reply

tim:

I too am having the exact same problem and have followed other guides as well (except I have Vista and XP not just XP). Grub never takes over. I have XP on my second hard drive. And I install Ubuntu on the same drive as Vista (different partition of course).

29 February 2008, 8:44 PM (5 years ago)report abuse Send to a friend reply

funkyidol:

I am also experiencing the same problem. I just install ubuntu 7.04 from the live CD but the computer directly boots to windows without giving me the option to boot to ubuntu.
Plz help

29 February 2008, 8:44 PM (5 years ago)report abuse Send to a friend reply

shang:

I got the same problem before, so I chang the BIOS setting let the PC boot from HDD first instead of CD, it works, may be work for you.

29 February 2008, 8:44 PM (5 years ago)report abuse Send to a friend reply

Majkl (New user):

Hi Fox and guys,

as for the issue with smooth installation and dabaged GRUB booting, make sure the GRUB is enabled. Currently using Mint (Debian/Ubuntu - based) myself, I recall there is "Advanced" button in step 6 or so of the installation. There you can tick "Anable GRUB" or "Allow Ubuntu to create a GRUB". I think this might be it.

10 June 2008, 9:33 PM (4 years ago)report abuse Send to a friend reply

Majkl (New user):

Hi Fox and guys,

as for the issue with smooth installation and dabaged GRUB booting, make sure the GRUB is enabled. Currently using Mint (Debian/Ubuntu - based) myself, I recall there is "Advanced" button in step 6 or so of the installation. There you can tick "Anable GRUB" or "Allow Ubuntu to create a GRUB". I think this might be it.

10 June 2008, 9:36 PM (4 years ago)report abuse Send to a friend reply

stewy (New user):

I think i can help with that. When I installed Ubuntu to my computer via wubi, program for windows to install ubuntu and download it from offline, I restarted my computer and it went straight to Windows xp and I was told by the directoins that the boot manager will pop up on restart however, it dodn't. I googled it and evevntually i found the answer. First boot into Windows xp then...
#2 GO TO START MENU
#3 CLICK ON CONTROL PANEL
#4 CLICK ON PERFORMANCE AND MAINTENANCE
#5 CLICK ON SYSTEM PROPERTIES
#6 CLICK ADVANCED (in tabs on top)
#7 LOOK AT THE SECTION ON THE BOTTOM THAT SAYS "STARTUP AND RECOVERY" AND CLICK ON SETTINGS.
#8 NOW MAKE SURE THE TOP CHECKBOX HAS A CHECK MARK IN IT SO THE BOOT MANAGER WILL POP UP WHEN YOU RESTART YOUR SYSTEM.
#9 THEN CLICK OKAY, AND THEN CLICK OKAY/APPLY ON THE OTHER WINDOW.
#9 RESTART AND IT SHOULD POP UP BUT IT WILL BY DEFAULT ONLY POP UP FOR ABOUT 30 SECONDS BUT YOU CAN CHANGE THAT TOO.
!GOOD LUCK!
:>

04 September 2010, 9:38 AM (2 years ago)report abuse Send to a friend reply

Fady:

windows xp is not in the list nor is other operatin systems.....any help plzzzzzzzzzzzzzzzzzzz?

29 February 2008, 8:31 PM (5 years ago)report abuse Send to a friend reply

Someone else who had this problem:

I had this problem. You need to follow some of the instructions on this page: http://apcmag.com/5459/dualboot_ubuntu_and_windows_xp

But also... it depends a bit on what your system looks like and this can be different depending on whether you put Ubuntu on before Windows or vice versa or perhaps like me you had Windows first, then installed Ubuntu, then upgraded Ubuntu... that messed up my config a bit.

What worked for me was:

Step 1 - make sure GRUB is used as master boot record - see instructions in link above

Step 2 - check the order of the partitions on your hard disk
Open Terminal (Applications, Accessories, Terminal) then type: sudo gparted
You want to know which drive and partition is Windows - first drive, first partition or whatever. Probably you've only got one drive, but perhaps you've got several partitions... one for Windows, one for Linux, another swap space partition for Linux and perhaps a PC recovery partition.

Step 3 - Open up the boot record with:
sudo gedit /boot/grub/menu.lst
(in step 1 you made sure this was what would be referred to when your machine boots up).
Just after (or just before) the Ubuntu startup options, put an option for Windows XP like this:

title Windows XP
root (hd0,0)
makeactive
chainloader +1

BUT - where I've put (hd0,1) you must refer to the disk and partition numbers you found out in step 2, remembering that Ubuntu starts counting at 0 - so in my example above, hd0,0 means disk 1, partition 1.

Also just a tip - don't put anything else in the file after the last operating system option in the list or it gets confused and says "Unrecognized command"

29 February 2008, 8:43 PM (5 years ago)report abuse Send to a friend reply

V Karpuram (New user):

I had the same issue over the weekend where ubuntu doesn't start after installing ubuntu. Here is what i did
1. Installed ubuntu again.
2. Made sure that the disk space allocated to ubuntu is around 50% of the drive.
3. Make sure that you change the boot location of ubuntu to be picked up from the new partition you have created for the ubuntu. Otherwise, the boot information will be defaulted to the xp boot location.

04 November 2008, 6:10 AM (4 years ago)report abuse Send to a friend reply

jimmy:

do you need xp pro or will it work on home ed as well tha!

29 February 2008, 8:31 PM (5 years ago)report abuse Send to a friend reply

sean:

no, uBuntu will work with any windows operating system, just read the tutorial on the site very carfully.

29 February 2008, 8:43 PM (5 years ago)report abuse Send to a friend reply

Rupesh dubey (New user):

how to can installation Linux o/s

05 October 2010, 4:15 PM (2 years ago)report abuse Send to a friend reply

James L:

I had this all sorted - by PC had Ubuntu 6.04 installed in one partition of the hard drive and Windows XP Pro installed on the other partition.
I just upgraded Ubuntu to version 7.04 using the auto upgrade and suddenly Windows XP is no longer an option in the Boot list. I cannot figure out how to load Windows XP. Anyone got any ideas?
Is pretty terrible, if you ask me, that an upgrade of my second operating system should wipe out my ability to get to my primary operating system... but nice back door attempt to take over the world!
Please Ubuntu sort this out - it shouldn't happen.
Please anyone else help me figure out how to get Windows back. I'm sure it must still be there somewhere. Not that I love Windows, but I have several vital apps that simply aren't supported on Ubuntu.

29 February 2008, 8:31 PM (5 years ago)report abuse Send to a friend reply

mrlarone:

same thing's just happened to me, you need to re-write the menu for the grub to add the option to access windows, don't worry it's still there.

1) boot to ubuntu
2) type: sudo nano /boot/grub/menu.lst
3) at the end of the file type the following:

title XP
root (hd0,0) #note (4)
makeactive
chainloader +1
savedefault #note (5)

4) (hd0,0) means (first hard-disk, first partion) this needs to point to the hardrive with the windows folder loaded (typically c:) for me my c: drive is on the second partion of my first (only) hard-disk so i use, (hd0,1) use qparted in ubuntu if you need to find out what partitions you have.

5) if you want the grub to automatically load to XP then add this line

29 February 2008, 8:43 PM (5 years ago)report abuse Send to a friend reply

CHINX21:

How about providing a guide in partitioning when Installing Linux?


29 February 2008, 8:31 PM (5 years ago)report abuse Send to a friend reply

palaskas:

Your article on installing dual-boot XP-Linux was very useful. But can you suggest how to uninstall Ubuntu and Grub to end up with original XP clean installation with no dual-boot options at bootup?
Thanks, TP

29 February 2008, 8:31 PM (5 years ago)report abuse Send to a friend reply

Skidpad:

Just a comment for all those experiencing difficulty. You can search the Ubuntu Forums and find answers to your questions almost immediately. If not, post your question and people will jump in to help.

The creator of these tutorials here has done a great job and provided a wonderful service to the Linux community, but I bet he doesn't have time to keep up with the demand for help.

www.ubuntuforums.org



29 February 2008, 8:44 PM (5 years ago)report abuse Send to a friend reply

Francis:

I burned ubuntu with Roxio, everything was perfect, but when i select start or install from the ubuntu menu, it says : Error reading boot CD. Can someone plz help ?

29 February 2008, 8:45 PM (5 years ago)report abuse Send to a friend reply

mahbub_007:


I want to make install linux redhot as a second os on my computer, but i dont know how. My harddrive is already split with ten gigs left to linux, but I'm unsure how to install it without wiping windows. Can anyone helpo me through it?
Thanks


29 February 2008, 8:45 PM (5 years ago)report abuse Send to a friend reply

chrisk:

I messed up my linux, so i tried to uninstall it. THE ONLY WAY to completely erase linux is to use the windows recovery console and use the fixmbr command. this will remove GRUB so be sure before you use it.

29 February 2008, 8:44 PM (5 years ago)report abuse Send to a friend reply

3qeafkl:

How do you get the partition on an external hard drive to work?

29 February 2008, 8:31 PM (5 years ago)report abuse Send to a friend reply

Anonymous121:

it shuld work the same

29 February 2008, 8:47 PM (5 years ago)report abuse Send to a friend reply

Josh Warry:

hey i am printing this page now and all the pages are out of order and all stuffed up!

29 February 2008, 8:31 PM (5 years ago)report abuse Send to a friend reply

Sally:

How much room do I need to partition for Ubuntu? I have 74 gb free.

29 February 2008, 8:32 PM (5 years ago)report abuse Send to a friend reply

The Penguin (New user):

You need to have at least 4GB to install Ubuntu.

29 April 2009, 8:02 PM (4 years ago)report abuse Send to a friend reply

View all comments (238)  

anonymous user Anonymous user

APC May 2013

May 
APC
out now!

Tags