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
Mike in NYC
Mike in NYC
9 years ago

Thank you. You saved me hours of pain.

I was able to do this one the first try. Very clear instructions!

DavidA
DavidA
Reply to  Mike in NYC
9 years ago

I Agree. The instructions are concise. Worked great for me too.

Sameer
Sameer
9 years ago

I have tried this tutorial so early and it works greate but this i followed all steps but while installing i install ubuntu over 320 hardisk which lead to unable to open winows7 … Please healp me how can i get back to my windows with dual boot i have lots of file in windows7 please please help me ..

Sameer
Sameer
Reply to  finid
9 years ago

I did same and made partition as u mentioned but at time installing ubuntu i install directly on dev 320GB wTa hardisk something like this which directly take me in to ubuntu no boot option comes…. Plz help me how to access back into windows7

Mental Mouse
Mental Mouse
10 years ago

I used these instructions to set up my dual-boot system OK. Where I ran into problems was when I plugged in the old disk drive from my old computer, which had been the boot drive. Once it was plugged in, the Wubi menu’s Ubuntu entry booted off the “new” (old) drive instead of the boot partition on its own drive. Even adding a new entry in EasyBCD didn’t help.

I’m currently just copying the data the hard way, but it would be nice to know how better to enforce which Ubuntu drive gets the boot.

deviant
deviant
10 years ago

thank you its working on my machine

~max
~max
10 years ago

What if, presumably in my case, you have “system”&”data” partitions only and it didn’t cross your mind to create a new one when installing Win7 so you installed it straight to “data” partition? Mind you, having 12.04. on the “system” partition already, but lack of space made the call.

TL;DU:
Partitions:
C:/ uses Ubuntu 12.04.
D:/ uses Windows 7

I am able to start only Windows 7, and C:/ partition is detectable only by Windows partition software as unknown region, and easyBoot detects it normally as Linux, yet creating a false MBR to try and boot diferently fixed nothing, and keeps showing me the GRUB2 fail on startup(OS doesn’t load at all).

Cheers.

Himanshu
Himanshu
10 years ago

I am trying to install ubuntu along with Windows 7. However on trying to manually edit the existing windows partition, the size option is not coming. Even on the installatio type window ( which comes just befor Edit partition window) The system is showing unused memory as unavailable.

My HDD is of 320GB with close to 100GB as available

Eddy
10 years ago

HI,

I read your post and you seem to give the clearest and most concise instructions. Also, you appear to have quite a number of happy customers!

I want it to run Ubuntu 12.04 LTS alongside windows 7. on my machine.

I am an utter newbie to Linux based anything. Have used Windows for years, partly because I was initially given a windows machine, and also because it is easy for a non programmer.

I don’t like windows and never have never trusted Microsoft and even less now.

Form what I can see on the forums, there are disadvantages to using Wubi, including diminution of speed. I have also noted quite a lot of people repeatedly having problems with GRUB failure either on install or during update. This is a problem I hae now encountered in both contexts. I DO NOT want to risk my windows setup or data. I really can’t afford the time to attempt repairs etc. which may in any case prove impossible.

Can you please point me to the most stable, most reliable and efficient means of installing ubuntu on the same computer as win 7 with its own partition and the least amount of errors / problems etc. for my machine? And confirm for me, if I should be running ubuntu 32 bit or 64? I am unsure as the machine has windows 32 bit running now with 4 gig of ram – I am aware that 3 bit can only use 3.25 gig of ram, but there are 2 two gig sticks, – no point in taking them out.

I am, however somewhat concerned, as I read that ubuntu 64bit may not see the existing windows installation – especially if it is a 32 bit program.

I don’t need to re partiion anything – there is already a partition empty and waiting [currently formatted NTFS]. Labelled as I drive currently – in case that makes a difference.

AMD Athlon 64 x2 dual core 3800+ 2.00 GHz
4 gig RAM
32 bit OS
Acer

Added an NVIDIA graphics card added.

1 TB barracuda hard drive partitioned into 3

1 partition [201GB] set aside for Ubuntu

Any and all advice very much appreciated.

Sincerely,

E

Eddy
Reply to  finid
10 years ago

Many thanks for your help!
Unfortunatley grub problem did arise; have tried 3 time now using grub repair with no luck.

am going to get another HD and use that as you suggest.

Regarding windows – i LOQATHE THEM! Howwever, haev a [not small] fotrune in WIn7 software that i leaned {painfully] to use and am unwilling to surrender.

When i get the new drive, i will let oyu know how it goes – usng your excellent instructions.

Thanks once again,

Eddy

Eddy
Reply to  finid
10 years ago

HI,

ONE OTHER THING:
Hard drive ordered and on the way.

BUT i am still unsure wether to go for 12.04 32bit or 64bit?

i have win 7 32 bit installe, but 4 gig of ram is sufficient for 64 bit, and i have [as stated above] an AMD 64 dual core. The machine is a bit of a patchwork, im afraid, but it’s what i have for now.

I read that ubuntu 64 bit may not “see” windows 32 bit. WOuld be a great help if you could clarify this.

What do you think? 32 bit or 64??

many thanks

E

Dinesh Kumar L
Dinesh Kumar L
10 years ago

hey.. thanks.. this works perfectly..

Kaushal
Kaushal
10 years ago

hey,
i followed your guide and the installation was succesful, however after adding the entry in easybcd when i select “ubuntu 12.04” i get sent to command line grub. Please help!

DavidA
DavidA
10 years ago

I had a Windows 7 / Ubuntu 12.10 dual boot set up on my laptop. Recently, I “upgraded” the Win 7 Partion to Windows 8.1. Of course, the windows boot file is altered and I cannot access the Ubuntu installation. I was using EasyBCD, and saved a backup. Using it and the backup was not successful. Should I just reinstall, or do you know the exact commands to edit the boot manager using bcdedit?

DavidA
DavidA
Reply to  finid
10 years ago

Thanks for the reply. I agree with your recommendation.
Happy New Year

ljacmi
ljacmi
10 years ago

I have one problem, few days ago i decided to install new Mint 16, in that time I had dual boot Win 7 and Mint 14. As it was my donno what version of Mint that I am using I didn’t expect no problems with installation and to be honest I wasn’t very careful when making new installation. Anyway I made installation, I noticed that installation process didn’t recognise my Win 7 but only Mint 14, so I went on manual installation. Anyway I messed it up, so I had to go from scratch.
To say I am not pc expert, donno all the thing just simple user. Anyway I try to put just linux, 1st Mint than just Ubuntu. But result was I couldn’t boot anything of it. So I gave laptop to friend just to put me Win 7 on and I will put Mint later.
So he did, put Win 7 on and made 2 NTFS partition. Win 7 boots ok, so started Mint instalation and I have this problem.
Mint instalation doesn’t recognise Win 7 nor the partitions?? I remember when I had win and Mint 14 instalation didn’t recognize Win but id did recognize parititon.
Now nothing of both. That why I with Gparted in Live Mint checked HD and it doesnt recognize partitions, but on the other hand, Disks program of same Live Mint recognize partitions as NTFS and also Disks usage analyzer recognize partitions.

just to ask you if you could help me what is going on, 1st why installation don’t see another OS and why it don’t see no partitions?

Simmilar problem I found on this page with same error msg when I start Gparted.
http://forum.linuxmint.com/viewtopic.php?f=46&t=140573

If you could help me or explain the problem I would be very grateful.

P.S. thank you for this great text, you have explained lot of things in good way and also to help me to understand more about installations and partition.

ljacmi
ljacmi
Reply to  finid
10 years ago

Sry for not replying before, thank you for fast reply and offering help, but I hadn’t time to start another installation.
I did manage to put Mint 14 on it, I was using your text for making partitions but and easybcd for boot options.
Unfortunately it couldn’t boot linux because UEFI, EFI and other s*it.
Anyway I looked around what is this and manage to boot linux by disabling ‘CSM’ in bios. Only problem is that in this form it wouldn’t boot win unless I enable it again. I can live with that as I rarely use Win and if I need it it just 10 sec job to get Win boot.

Thanks again for great text and help with, linuxbsdos.com in now on my ‘watch’ list.

P.S. if anyone needed additional info I get on this pages :
https://help.ubuntu.com/community/UEFI
http://ubuntuforums.org/showthread.php?t=2147295

Jared
Jared
10 years ago

HELP! I have followed your guide. I made a 115 GB partition for free space, but it’s showing up in the partition list as “unusable.” I can’t figure out how to delete it. Also, this partition has robbed 115 gigs from Windows, so I essentially am out 115 GB and cannot use it.

Jared
Jared
Reply to  finid
10 years ago

I figured out my issue with the 115 GB of unassigned space.

1 9 10 11

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