Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old January 10th, 2009   #1
hyperdude111
Quad Shot of Ubuntu
 
hyperdude111's Avatar
 
Join Date: Sep 2008
Location: London, UK
Beans: 471
Ubuntu Jaunty Jackalope (testing)
“How to” Dual boot Ubuntu and Windows 7 (Ubuntu installed first)

“How to” Dual boot Ubuntu and Windows 7 (Ubuntu installed first)

##This guide does not work for Karamic or future releases, For that see page 14 and follow the link provided by presence1960 for how to dual boot with Grub2 (requires some reading) I will update this guide for grub2 when I have more time##

I have recently seen many posts from people trying to dual boot Ubuntu and Windows 7 beta, but not succeeding. So I tried it out myself and found a solution.
Index
1. Obtain a copy of Windows7.
2. Partition your disk with gparted.
3. Install Windows7.
4. Re-install Grub.
5. Edit Grub to List Windows 7.
6. Have Fun.
__________________________________________________ ________________________________

1. Obtain a copy of windows 7.

*You can also find a torrent of this but for legal reasons I cannot provide a link. *


2. Partition your disk

**This does go wrong in some cases, if in doubt back up your valuable data.**

Boot from a Ubuntu live cd or a gparted live cd.
Start up gparted, If ubuntu is on the whole disk you need to re-size it by at least 8 gb for Windows 7. (Make sure windows 7 is on the second partition to make it easier for grub) You will be left with some unallocated space on your hard disk if you want you can partition it to NTFS or you can do it later on the windows install.

3. Install Windows 7

Follow the on screen instructions, Select the un-partitioned space to format and install windows on, or if you already made it NTFS choose your NTFS partition.

**It will ask for a product key but you have 30 days to do that. Note: Beta keys will work with the RC**


4. Re-install GRUB

Now you have windows 7 but it has completely eaten your boot loader so you need to re-install grub.
Boot from the ubuntu live cd and go to terminal.
Type in terminal:

"sudo grub"
"grub> find /boot/grub/stage1"

That should return your Ubuntu partition in the form of (hdX,Y), use that:

grub> root (hdX,Y)
grub> setup (hd0)
grub> quit

(you don’t need to type the grub> bit)

That has re-installed grub but you can no longer see windows7

5. Edit grub.
Go to terminal from normal ubuntu and type :

“sudo gedit /boot/grub/menu.lst”

A large text file will open and at the bottom leave a line and add this:

title windows 7 beta (Loader)
root (hd0,1)
savedefault
makeactive
chainloader +1

(Do not type this line but if that does not work on re-boot try “hdo,0 or hd0,2” and so on until it works.)

Now that is done you can re-boot into windows 7 and ubuntu happily

******************Edit***********************
Hi
I have remembered that if you also have vista installed on your machine when you in install 7, that windows 7 will add itself to the vista bootloader.

So You will need to point grub to the vista partition so it will load the vista loader and give you the option for 7 and vista.

Also To work out what partition number your 7 partiton is use gparted it will give you results like "Windows 7 sda2" that means hda0,2 or if you have two internal hard drives than change the tab in the top right to the appropriate disk. Then take note of the sda2 but as it is on the 2nd drive it will be hda1,2. And so on..........
****************Edit*************************
Wow over 20,000 views

Last edited by hyperdude111; October 29th, 2009 at 05:31 AM..
hyperdude111 is offline   Reply With Quote
Old January 19th, 2009   #2
meistercobbman
5 Cups of Ubuntu
 
meistercobbman's Avatar
 
Join Date: Jan 2007
Beans: 22
Ubuntu 9.10 Karmic Koala
Re: “How to” Dual boot Ubuntu and Windows 7 (Ubuntu installed first)

Thanks for the simple tutorial. I installed win7 on virtualbox and it took about 13GB though, not 8GB.
__________________
Life: See. Do. Get. Share. Enjoy.
Visit my blog: The World of Brian
See my photos: PicasaWeb.
meistercobbman is offline   Reply With Quote
Old January 21st, 2009   #3
BLTicklemonster
Tall Cafè Ubuntu
 
BLTicklemonster's Avatar
 
Join Date: Oct 2005
Location: Rome, Ga
Beans: 2,616
Ubuntu 8.10 Intrepid Ibex
Send a message via MSN to BLTicklemonster Send a message via Yahoo to BLTicklemonster
Re: “How to” Dual boot Ubuntu and Windows 7 (Ubuntu installed first)

Thank you! I installed Windows 7 on a spare hard drive with everything else unplugged so I could just turn the machine off and plug cables back in to run Ubuntu, not knowing if or how I could dual boot, so I'm glad to find this. I'll be trying this out tonight or tomorrow sometime and will come back whining when I hit a glitch, you know, lol.

I do have to say, W7 seems like they got it right. So far the best windows experience I've had with the one exception of using XP to download the first Ubuntu Live CD .iso file, that is.

So, I shouldn't have any problems if I just turn off, plug everything back in the way it was in the beginning, right?
__________________
Al Gore didn't invent the Internet, but he did make up global warming.

-David Rockefeller, March 08, 2009
BLTicklemonster is offline   Reply With Quote
Old January 21st, 2009   #4
csddavies
First Cup of Ubuntu
 
Join Date: Jul 2008
Beans: 4
Re: “How to” Dual boot Ubuntu and Windows 7 (Ubuntu installed first)

Excellent article. Worked flawlessly.
csddavies is offline   Reply With Quote
Old January 21st, 2009   #5
damis648
May the Ubuntu Be With You!
 
damis648's Avatar
 
Join Date: Jan 2008
Location: the space between spaces.
Beans: 1,655
Re: “How to” Dual boot Ubuntu and Windows 7 (Ubuntu installed first)

Nice little guide, but this pretty much applies to any Windows installation when it is installed after Ubuntu.
__________________
"If a cluttered desk signs a cluttered mind, Of what, then, is an empty desk a sign?" -Albert Einstein.
damis648 is offline   Reply With Quote
Old January 22nd, 2009   #6
BLTicklemonster
Tall Cafè Ubuntu
 
BLTicklemonster's Avatar
 
Join Date: Oct 2005
Location: Rome, Ga
Beans: 2,616
Ubuntu 8.10 Intrepid Ibex
Send a message via MSN to BLTicklemonster Send a message via Yahoo to BLTicklemonster
Re: “How to” Dual boot Ubuntu and Windows 7 (Ubuntu installed first)

Jeez, you'd think there was a way to determine which hd was which. I have 4, so it ought to be hd0 through hd3, but I can't get grub to work with one I know is in there no matter what entry I use. I know it's either hd1,1 or hd3,1 because hd0,1 and hd2,1 have ubuntu loaded on both of them, and the other hard drive is storage only. The one in question has two partitions, the first, hd*,0 would not be the operating system, but hd*1, the second partition is the one with the operating system. I edit menu.lst so reflect either hd1,1 or hd3,1, yet each time I try to select the drive at the grub menu, it says that's not a partition. Dang.

And I don't really want to go having to installing anything on a disk to use it...

Oh well.

By the way, the hard drive in question has windows loaded on it, and it was loaded with the drive in the machine by itself.
__________________
Al Gore didn't invent the Internet, but he did make up global warming.

-David Rockefeller, March 08, 2009
BLTicklemonster is offline   Reply With Quote
Old January 23rd, 2009   #7
DSL5
5 Cups of Ubuntu
 
Join Date: Aug 2008
Beans: 41
Re: “How to” Dual boot Ubuntu and Windows 7 (Ubuntu installed first)

I tried this, but I now when I try to boot into Windows 7, I get the following:

BOOTMGR missing
Press Ctrl+Alt+Del to restart

What's going on??

I have XP in (hd0,0), Ubuntu in (hd0,4), and 7 in (hd0,2)
DSL5 is offline   Reply With Quote
Old January 24th, 2009   #8
hyperdude111
Quad Shot of Ubuntu
 
hyperdude111's Avatar
 
Join Date: Sep 2008
Location: London, UK
Beans: 471
Ubuntu Jaunty Jackalope (testing)
Re: “How to” Dual boot Ubuntu and Windows 7 (Ubuntu installed first)

The Alt-Ctrl-Delete Problem normally happens to me after i have re-sized the windows partition after install to fix re install 7 and follow the rest of the guide. If this fails there may be a problem with your grub setup.
hyperdude111 is offline   Reply With Quote
Old January 24th, 2009   #9
lftolen
First Cup of Ubuntu
 
Join Date: Sep 2007
Beans: 1
Re: “How to” Dual boot Ubuntu and Windows 7 (Ubuntu installed first)

I received the
BOOTMGR missing
Press Ctrl+Alt+Del to restart
when I had selected the wrong partition to boot Windows 7. Are you sure you are selecting the correct partition number?
lftolen is offline   Reply With Quote
Old January 25th, 2009   #10
marmel
First Cup of Ubuntu
 
Join Date: Nov 2006
Beans: 6
Re: “How to” Dual boot Ubuntu and Windows 7 (Ubuntu installed first)

Hi hyperdude111,

Thanks for the guide! Unfortunately it didn't work for me... When I boot Windows 7 via grub the system resets after trying to load Windows and no error message is displayed. I am sure that the partition number in the grub entry is correct (sda1 -> hd0,0).

Any suggestion?

Thank you so much!
marmel is offline   Reply With Quote

Bookmarks

Tags
dual boot, grub, ubuntu, windows 7

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:51 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry