Partner links

How to dual-boot Ubuntu 12.04 and Windows 7

Windows 7 Dual-Boot Boot Menu

One tool that has seen very little or no change over the past several releases in Ubuntu Desktop is the installation program. So it is somewhat surprising that some users are having a hard time dual-booting Windows 7 and Ubuntu 12.04 using a tutorial written for Ubuntu 11.04.

Stemming from comments in that article, and email from readers, I decided to revisit that tutorial using Ubuntu 12.04. So the purpose of this article is to show how to dual-boot Windows 7 and Ubuntu 12.04 on a computer with one hard drive. And it will be on a computer with an existing installation of Windows 7. If there is a need to, you may reinstall your copy of Windows 7.

If you want to attempt this on a computer with two hard drives, see how to Dual-boot Ubuntu 12.04 and Windows 7 on a computer with 2 hard drives.

To get started, download an installation image of Ubuntu 12.04 from here. Depending on your platform, you may download the 32- or 64-bit image. Screenshosts used in this tutorial were taken from test installations using a 32-bit installation image in both a virtual environment using VirtualBox, and on real hardware. In either case, I did not encounter any errors that others have reported, so I am certain that if you follow this guide, you should have a computer with both Windows 7 and Ubuntu 12.04 installed in a dual-boot configuration.

So that anytime you reboot the computer, you should see Windows 7’s boot menu with two entries listed – Windows 7 and Ubuntu 12.04 (LTS). Then you may choose to boot into Windows 7 or Ubuntu 12.04.
Windows 7 Dual-Boot Boot Menu

Now that you know what the overall goal is, how do you get from here to there? First, understand that if you have a computer running Windows 7, that Windows 7’s boot manager is responsible for making sure that the system boots. Installing Ubuntu on the same hard drive throws another boot manager into the mix. So the most important decision you are going to make about this, is which boot manager (Windows 7’s boot manager or Ubuntu’s) do you want to be responsible for primary boot operations?

When dual-booting Windows 7 and a Linux distribution on a computer with one hard drive, the best option is to have Windows 7’s boot manager be the primary boot manager. Why? Because whenever you reinstall or update Windows 7, its installer will overwrite anything it finds in the portion of the hard drive where critical boot-related programs are installed. That portion of the hard drive is known as the Master Boot Record (MBR). Also, certain anti-virus programs have been known to mess with the contents of the MBR, so installing GRUB in another location will ease the maintenance headache associated with your system. This point determines where GRUB will be installed.

If you are not familiar with disk partitioning (in Linux) and dual-booting, it is highly recommended that you read guide to disks and disk partitions in Linux and tips for dual-booting Windows and Linux.

By default, a new installation of Ubuntu 12.04 is installed on two partitions – a main partition, and Swap. The main partition is usually a primary partition and the Swap, a logical partition. And if Ubuntu is the only operating system on the hard drive, you will see both partitions labeled /dev/sda1 and /dev/sda5. Because you are going to install it on a computer with another operating system on it, the partitioning scheme will have to change.

The recommended partition scheme that will work better with the system you are about to install will have at least three partitions. They are the:

  • Boot partition – This is where GRUB will be installed, instead of in the MBR. Installing GRUB in the boot partition is where users have encountered errors, so pay particular attention to what you do with this partition
  • Root partition – This is where all the programs will be installed
  • Home partition – This is optional, but it helps to have your files and folders on a separate partition
  • Swap space

I think what you need to do should be pretty clear now. Time to begin the process! If you have not done so already, burn the installation image (of Ubuntu 12.04) you downloaded to a CD or transfer it to a USB stick, and boot the computer from it. When booted from the CD, you will be given the option to boot into a Live Desktop or start the installation without visiting the Live Desktop. It does not matter which option you choose, but booting into the Live Desktop and starting the installation from there seems to be a very good choice.
Ubuntu 12.04 Live Desktop or Installer

Whether the installation process is started from the Live Desktop or not, clicking through the installer gets you to the step shown in the image below. The most important information here is the minimum disk space (4.4 GB) recommended for a successful installation of Ubuntu 12.04. That piece of information will help you determine how much disk space to allocate to the root partition.
Ubuntu 12.04 Installation Requirements

Clicking Continue from the previous step will land you here. If, as in this example, you have Windows 7 installed on the target hard drive, you should see the same three options shown here. Because you will be creating partitions manually, the option you want to select is Something else.
Ubuntu 12.04 Partition Options

That should bring you to the Advanced disk partitioning tool. Again, if we are operating from the same point, that is, if you have a default installation of Windows 7 on the target hard drive, you should see two ntfs partitions (/dev/sda1 and /dev/sda2) listed. The main Windows 7 partitions, also popularly known as the C drive, is your sda2. To install Ubuntu, you will have to resize that partition. Note: If have free unallocated space on the hard drive, you do not have to go through this partition resizing process. To resize the partition, select it and click the Change button.
Ubuntu 12.04 Advanced Partition Tool

That should open this window. The only thing to do here is tell the installer how much disk space you want to keep for Windows 7. The rest will be used for Ubuntu. The system used for this tutorial has about 324 GB of disk space. I chose to keep 100 GB for Windows.
Ubuntu 12.04 Partition Resize

So the window now looks like this. Click OK.
Ubuntu 12.04 New Partition Size

After the partition has been resized successfully, you should see the freed space marked as free space. Select it and click Add to start creating partitions for Ubuntu 12.04.
Ubuntu 12.04 Unallocated Partition Space

Share:

Facebook
Twitter
Pinterest
LinkedIn

Partner links

Newsletter: Subscribe for updates

562 Comments
Inline Feedbacks
View all comments
gattling
gattling
11 years ago

This is a magnificent tutorial! Never has setting up a dual-boot system been so easy (at least for me, anyway).

One quick question. I’ve edited my /etc/default/grub file such that GRUB_TIMEOUT is set to 0. Yet, I’m still seeing the GRUB menu after the Windows menu. Any thoughts?

gattling
gattling
Reply to  finid
11 years ago

Boom! You are officially my hero. 🙂

Seriously, thanks very much!

harnendra
harnendra
11 years ago

Got a problem here. Using EasyBCD, it keeps throwing me into something titled GRUB4DOS. What should I do from here?

If I manually select to boot to ext4 filesystem from EasyBCD, it is just showing a blinking cursor. I retried 3 times for the Ubuntu installation and I am very sure that I have chosen to install boot loader at /dev/sda5/

Here is how my drive looks. Any ideas how to fix this?
I am on Thinkpad x120e.

/dev/sda1/ windows boot partition ~100MB

/dev/sda2/ C: Windows 7 x64 installation ~70GB

/dev/sda3/ D: NTFS ~200GB

/dev/sda5/ ext4, Ubuntu, Grub, /, /boot ~16GB

/dev/sda6/ swap ~3GB

Nate
Nate
11 years ago

Great guide. Worked perfectly. The couple times I had tried to install Ubuntu using the “install alongside Windows 7”. However, I wasn’t aware it would default to the Ubuntu boot manager; and it was causing problems when trying to enter Windows. Thanks again!

missm
missm
11 years ago

Hello, I am following the steps one by one described here. The partition is done successfully and I see the freed space marked as free space. The problem is, I don’t see the Add button. I have only Change and Revert. What do I do?
Thank you

Maria
Maria
Reply to  finid
11 years ago

It is not there or anywhere. However I did it, by choosing Ubuntu alongside Windows. It works perfectly now, BUT I am facing another issue and I have no idea what the cause is: When running Ubuntu, the machine shuts down by itself, no warning, no nothing.

Abhishek
Abhishek
11 years ago

Hey, Finid, I followed this tutorial to a T back in October/September and I’ve never had any issues with it at all.
Now, given that my system is set up in the same way that’s been described in this tutorial, how can I upgrade my 12.04 to 12.10 and keep the basic structure same? (Primarily, Windows and GRUB boot loaders on different partitions)

I tried doing a direct upgrade, but I ended up borking my Ubuntu, and I had to do a reformat.

Thanks

macu
macu
11 years ago

Nice and easy-to-follow tutorial, but I have problems with Ubuntu.

I tried it with at least two copy of both 12.04 and 12.10. First neither the installation nor the Ubuntu live didn’t start. I could start installing by writing “nomodeset” after pressing F6 at the end of the command row. Then installation went without any problems. EasyBCD works fine too. But when I start my notebook, and I select Ubuntu it goes to an other (I think) bootloader. I can choose Ubuntu, Ubuntu advanced options, memory test, another memory test, and Windows7. If I choose Ubuntu everything goes black and nothing happens. If I choose Unubtu advanced optios, non-graphical interface works, but nothing more. Any idea?

Thanks a lot guys!

macu
macu
Reply to  macu
11 years ago

UPDATE

I followed this tutorial on my desktop pc and it worked fine. I found out that Ubuntu switches off the backlight. I can see there’s something on screen, but without backlight. This problem occurs only on my notebook. It’s a HP-G62 with Intel core i3 2.27 GHZ 64 bit and Intel HD graphics vga. Do you know about any solution?

domo
domo
Reply to  macu
11 years ago

Yeah, don’t buy HP/Compaq pieces of shit.

zig
zig
11 years ago

Beautiful tutorial – exactly what I needed!
I installed Ubuntu Server 12.04 LTS and added LXDE after. Now my old Intel T4200 dual core (Acer) laptop has a new lease on life. Before dual boot I could only run 32 bit Ubuntu in Virtualbox (slow) because no Vt-x…now I boot into 64 bit and it is WAAAY faster.

Thank you!!

Olympe
Olympe
11 years ago

What a great and clear tutorial!
Just two questions:
“computer should be connected to the Internet”; is wireless connection fine or should I have the (ethernet or whatever it is) cable connected?

I have Windows 7 on a Samsung 530U3C laptop, that might be affected by a scary bug.

https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557

Reading that thread it seems I should at least disable that UEFI and and maybe take some other precautions..
Do you have any tips on this?

minal
minal
11 years ago

If I have my hard disk partitioned as C: and D: how will it show up in the ubuntu installer ?
I had seen something like sda1 and sda2. Off this which one is C: and which one is D:. Is there a sure shot way of finding that?

minal
minal
Reply to  finid
11 years ago

Thanks. The latest I find is that ubuntu installer is not recognizing my windows partition at all. If I select the “something else” option for installation the partition table tells me:
sda1 : 107.4GB ntfs
sda2 : 142.7GB ntfs

where as from windows
C: 99.9GB and D: 132GB

I am not sure how to proceed. Do not want to risk loosing windows – which I did last time, when i went ahead and installed ubuntu on sda2 ( i had created the proper /boot , /swap, / partitions then. But after ubuntu installation, I cud never boot thru windows ! )

minal
minal
Reply to  finid
11 years ago

I had done that previously. I had installed ubuntu on sda2 ( complete D drive was free ). However, after that system always booted in Ubuntu and did not show up windows at all.

IWIH
IWIH
11 years ago

Thank you

George
George
11 years ago

I have a Pacard Bell computer with 250 GB Hard Drive. It had a fresh unused windows7 installed. I used a ubunu disc to install ubintu 12.04 and it ran perfectly having roughly devided the drive into two roughly equal partitions. It worked perfectly loading either windows or ubuntu. Un fortunately both had a lot of updating to do. At the end of the latest ubuntu update it required a restart. Having closed down I started windows 7 which faild to start. when ubuntu was restarted it worked OK. The windows 7 now refuses to start nomatter which form I try. Can you help?

George
George
Reply to  finid
11 years ago

The Windows Vista was preinstalled on a refurbished computer. The error is “Windows failed to start”. The options to start windows gets as far as “Microsoft Corporation” and the loading bar crossing the screen when it hangs up.If I try to load safe mode it loads a number of files up to “Loaded\Windows/system32/drivers/crcdisk.sys” and then hangs up.
The ubuntu 12.10 wasloaded from the disc in ubuntu user magazine which installed the GRUB where it normally does? I am sorry I cant be more helpful as I am an Old Beginner.

George
George
Reply to  finid
11 years ago

Thanks for your help , I tried using the info in UBUNTU USER issue 14 page 82. Unfortunately I used Figure 6 as my guide. It didn’t work. In exaspiration I got my Windows 7 reinstalled with the intention of reinstalling my Ubuntu. I,however, thought I would try the restoring Ubuntu instructions again. This time I used the instructions on the left hand side of the page and it worked. Back to the duaql booting system. The instructions on Fig.6 did not have the final line “sudo reboot”.
THANK YOU FOR TRYING TO HELP .

Daniel
Daniel
11 years ago

Hi, thanks for the tutorial.

I just have one question. At the moment, I have two partitions with Windows ( C: has 198GB with 157GB Free AND I have D: which has 398GB with 392 Free )

I just want to know if its possible to dual boot Ubuntu on the C drive and then have Ubuntu partitioned the same way as Windows and use D: for Ubuntu the same way I have windows set up ?

Thanks
Daniel

Daniel
Daniel
Reply to  finid
11 years ago

Sorry,

Okay. I have one hard drive in my PC. But has been split up into two partitions ( C: and D: )

C: has Windows 7 installed and has 157GB Free
D: has all program files and has 392GB Free

I just want to know, is it okay to install Ubuntu on C: even though there is 157GB free?

Is it possible to have Ubuntu installed on C: and then to use D: for Ubuntu installs and files?

Daniel
Daniel
Reply to  Daniel
11 years ago

Hopefully that makes sense. Is there any other way I can contact you directly to get a quick answer ?

Daniel
Daniel
Reply to  finid
11 years ago

Ok here is the file structure

/dev/sda

/dev/sda1/

/dev/sda2/ ((C:) Windows )

/dev/sda3/ (D:)

So I will need to install it on C: and split the windows drive up so Ubuntu has space.

What I’d like to know is if I’m able to install Ubuntu on D: as it has more space on it

Daniel
Daniel
Reply to  finid
11 years ago

Ok here is the file structure

/dev/sda

/dev/sda1/

/dev/sda2/ ((C:) Windows )

/dev/sda3/ (D:)

So I will need to install it on C: and split the windows drive up so Ubuntu has space.

What I’d like to know is if I’m able to install Ubuntu on D: as it has more space on it

Bill
Bill
11 years ago

Excellent tutorial – worked perfectly.

One comment; I purposely made a smaller partition for windows using it’s installer, leaving freespace for the Ubuntu load. Never liked having the partioner reduce the Windows partition….

One Question; When booting into Ubuntu, it’s boot loader comes up as well… Is there a way around that? Just make it go right into Ubuntu? Oh, and of course, Win 7 is listed!

I suppose I should do a wed search but thought I’d ask….

Alma
Alma
Reply to  finid
11 years ago

Really helpful article. Cheers for that.

I must add that it would be “/etc/default/grub” in place of “/etc/grub/default”.

JayC
JayC
11 years ago

this was very straightforward and helpful. I appreciate your effort. Keep up the good work!

Graham
Graham
11 years ago

Hey, nice clear tutorial, but I am still having problems dual-booting on a new 64-bit i7 box (which I assembled myself). I installed Win7 first, then followed your instructions carefully (except that I created primary partitions rather than logical).

Win7 works fine, but when I select the Ubuntu 12.04 option from the boot menu I get a grub prompt rather than Ubuntu.

Can you help?

Graham
Graham
Reply to  finid
11 years ago

Actually I think I may have selected the wrong partition for the boot loader. I deleted everything and repeated the procedure from scratch and it worked. Thanks, anyway.

tbullers
tbullers
Reply to  Graham
11 years ago

Yes, I’m having the same issue where choosing Ubuntu from the Windows Boot loaders takes me to a grub prompt.

I have a 500 GB drive and my /boot partition is about 410 GB into the drive.

Nag
Nag
Reply to  tbullers
11 years ago

im also facing the same issue..Any suggestions for fixing this. I kept 100 GB for windows and 200GB after that for ubuntu.

Get the latest

On social media

Security distros

Hacker
Linux distros for hacking and pentesting

Crypto mining OS

Bitcoin
Distros for mining bitcoin and other cryptocurrencies

Crypto hardware

MSI GeForce GTX 1070
Installing Nvidia GTX 1070 GPU drivers on Ubuntu

Disk guide

LVM
Beginner's guide to disks & disk partitions in Linux

Bash guide

Bash shell terminal
How to set the PATH variable in Bash
Categories
Archives