How to dual-boot Ubuntu 12.04 and Windows 7

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.

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.

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.

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.

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.

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.

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.

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.

So the window now looks like this. Click OK.

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.

Google has got competition, because Presearch is building a blockchain-based search engine controlled by the community. At $0.15 a token, you can participation in Lot 3 of the token sale by clicking here

Open Money is building a solution that will run mainstream software on blockchain tech. Click here to get free tokens that will be the digital currency of the platform

Sir,
I had followed this tutorial to install Ubuntu 12.04 alongside Windows 7 and Windows 8, so I had a case of Triple boot.
However, I don’t know how, Ubuntu was my primary boot manager and then Windows 8.
But recently I deleted the Windows 8 and upgraded my Windows 7 to Windows 8. Now Windows 8 is my primary boot loader but I can’t access the Ubuntu OS nor can I access the Ubuntu drives since they are of ext 4 format.
What should I do?

Thanks for the tutorial, but I have a quick (and hopefully not stupid) question: Can the two main partitions used for data storage (one for Windows and one for Ubuntu) be merged into one partition and shared among Windows OS and Ubuntu?

Thanks for the guide, But i got an issue here. After I choose to boot the ubuntu (I already followed through all from the guide) it didn’t take me to the Ubuntu. Instead, I got into somekind of command prompt.
Can you help me?

Same problem here for me. Followed instructions exactly, except I skipped the /home partition, as I’m the only intended user of this installation. Started with 120GB SSD, setting aside 55 GB for Ubuntu (500MB boot / 50GB root / 4.4GB swap). After selecting Ubuntu at boot time, I get a GRUB2DOS screen, with a grub> prompt.

I am attempting to do this tutorial, but I have a problem. Once I specify the partitions, I want to select sda5 (the boot partition) as the “Device for boot loader installation”, but in the drop-down menu, sda5 is not an option! I can choose any of the windows partitions (sda1-3), or sda6 (which is the root partition). What should I do?

@finid
I got it working, although it was a strange work-around. I think I essentially “tricked” the ubuntu installer into putting the boot partition on the list by first creating the boot partition (sda5), then creating the root partition (sda6), then deleting the boot partition and re-specifying it. That last step of deleting the boot partition and then re-specifying it ended up switching the names, so now my boot partition is sda6 and the root partition is sda5, even though the sda6 block is loacated BEFORE the sda5 block on the disk (verified by looking at the start/end values of my partition table). This little switcheroo tricked the drop-down menu into letting me select the boot partition (sda6) as the device for the boot loader installation. It works, and I am happily posting from my computer that will dual-boot windows7 or ubuntu12.04. Thanks!

Great tutorial. I usually let the installer do it’s own thing but this seems a much cleaner option. One question though. After selecting Ubuntu at the windows boot screen it then takes me to the Grub screen and I have to choose which one I want to boot into again. Is this correct?

Thank you for the tutorial finid but I’m kind of stuck when trying to boot to Ubuntu. I can boot to Win7 with no problem but when I choose to boot to Ubuntu 12.04 I end up on the GRUB> prompt (not the menu). Where do I go from the GRUB prompt?

I tried following the steps in that link, but it doesn’t seem to apply. I end up with a grub> prompt, not a grub2>. An ls produces nothing that is shown in that article. Seems like I am getting grub installed, versus grub2. I specifically selected grub2 using EasyBCD.

And should I specify a path, or allow it to find it automatically? I have gone thru re-installs many times now, so quite frustrated, lol! When I enter ls at the grub> prompt, I end up with what looks like stuff on my C: drive (users, Windows, Program Files, etc.). It doesn’t show any of the linux file systems (sda). I only have one drive in the system, and it is configured just like in your tutorial (ie. sda5/6/7).

Different, but still no succss! With Grub legacy, I have gone thru just about every combination of install point and whether to use EasyBCD’s version of Grub. Either get a very DOS looking screen indicating failure to load, or just a flashing cursor. One screen shot that would be useful is the View Settings, after you have added the new entry. Mine specifies C: as the Drive and bootloader path of \NST\AutoNeoGrub0.mbr. I noticed that a NST folder was created on my C drive at some point, but nothing in it is visible to windows.

Just an update on my lack of success. 😉 It looks like the machine is loading Grub, instead of Grub2. So if I try and debug grub issues using the steps outlined in the external link above, all the commands are not supported (ie. the command linux is not available in Grub, only in Grub2. I used the command kernel instead). Nevertheless, I was able to replicate their instructions, but it will still error out.

I am wondering if the problem is that I have UEFI BIOS on my GA-Z68X-UD3 motherboard? I read that Grub2 supports UEFI. I just can’t figure out why Grub2 isn’t being called, as it should be installed by Ubuntu.

thanks for this very good tutorial. I was into my third day of trying to get Linux Mint installed and working alongside Windows 7, and your tutorial helped me finally get it to work (if not perfectly..yet).

For the benefit of anyone else tearing their hair out with dualboot issues:

I have an 64 GB SSD that hosts the Windows 7 OS. In addition to that I have 320 GB and 1 TB drives.

I initially tried to install Linux Mint to a an empty partition on the 320 GB HDD (in Windows this would have been I drive), with boot, root, home and swap partitions, just as outlined here. I then used EasyBCDEdit as per instructions in another tutorial (sorry don’t have the link), but could not get Windows Boot Manager to load Linux Mint. And after finishing all the steps in your tutorial, I had this same problem. At boot time I would be presented with two choices, WIndows and Linux Mint, but when selecting Linux Mint I got the following error message:

From (hd 0,2) onwards those are the partitions created in this tutorial then. Swap does not show at all.

I eventually got Linux Mint to load by selecting Grub (legacy) and manually selecting the boot partition under “Device” in EasyBCD. BTW I had created a 500 MB boot partition for Linux and it showed up as (Partition 3 – Linux 476 MiB).

Now I first get the Windows Boot Manager, then the Grub loader after that….sure I will find the solution to this yet, but right now I am just happy to get Linux Mint to load at all!

BTW, Windows 7 freaked out a bit after I repartitioned the C drive and formatted part of it as Ext4 – I was prompted to run a consistency check. It took perhaps 5 minutes to execute and on seems to have been a one-time thing.

Many thanks again for the tutorial. Now on to exploring Linux, newbie as I am to it…! 🙂

Great article, but I am stuck at Installation type step:
Installed Win7 on Dell Optiplex-790, it has created a 100MB boot partition and next to it an NTFS one for Win7, left 60GB free space for Ubuntu at the end of the disk.
Rebooted with Ubuuntu 12.04, got the first and second screen, then when clicked on continue, it does not seem to be able to see the free 60GB space and the partition selection window is flat empty showing the /dev/sda only as selectable. Not sure what causes it. Any advice would be greatly appreicated.

At that step, click the Something else option. That should take you to the Advanced Partitioning Tool. You should see all the partitions on the disk. From there, you can start creating partitions for Ubuntu.