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.

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

We Recommend These Vendors

Launch an SSD VPS in Europe, USA, Asia & Australia on Vultr's KVM-based Cloud platform starting at $5:00/month (15 GB SSD, 768 MB of RAM).

Deploy an SSD Cloud server in 55 seconds on DigitalOcean. Built for developers and starting at $5:00/month (20 GB SSD, 512 MB of RAM).


  1. 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.


  2. 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!

    • 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?

  3. 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!!

  4. 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.

    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?

    • Any form of Internet access if fine, though not having an Internet access is not a show-stopper, as you can still complete the installation without one.

      Disabling UEFI might be a good idea.

      That bug seems to have been fixed in the latest kernel release.

  5. 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?

    • On a default installation of Windows 7, where its installer creates a system partition and a data partition, the C drive is typically sda2. If you then create another partition (D), that partition will be sda3.

      From the Ubuntu installer, you can tell which is which only from their size, as the installer will see both as ntfs partitions, unless the D drive is not an ntfs partition.

      • 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 ! )

        • Well, from what you just posted, the installer recognized your Windows partitions just fine.

          sda1 is the C drive while sda2 is the D drive. That you see ntfs under file systems tells you that the installer sees them as Windows partitions.

          Now, you have two options. Shrink C and install Ubuntu on the free space, or shrink D and do the same.

          Note: Before shrinking any partition, first verify from Windows how much space is recoverable.

  6. 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?

    • Where was GRUB installed and what type of error message are you getting from Windows?

      • 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.

      • 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”.

  7. 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 ?


    • Question is kinda confusing. Please clarify.

      • 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?

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

        • The short answer is yes, you can install Ubuntu on C, because that’s one of the options the installer will present to you.

          The longer answer goes like this:

          The confusion stems from the fact that the question is being asked as if C and D are separate hard drives, when, as you correctly stated, they are partitions on the same hard drive.

          If you try to install Ubuntu on the system, the Ubuntu installer will see C and D as two partitions of /dev/sda. And since the hard drive has Windows 7 on it, there should be a System partition on it, in addition to C and D.

          So the installer will see 3 partitions:

          • /dev/sda1 – (System partition)
          • /dev/sda2 – C
          • /dev/sda3 – D

          Note that where you install Ubuntu is where its files will be located, you do not need to put any file on D, unless you want to use it as a data partition for both OSs.

          What you can do, is boot the system using the Ubuntu CD/DVD, then post the partitions you see from the Advanced Partitioning Tool’s window here.

          That way, I can give you a better idea of how to proceed. Meanwhile, you might want to read guide to disks and disk partitions in Linux.

          • Ok here is the file structure



            /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

          • Yes, you can. It will work perfectly.

          • Ok here is the file structure



            /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

  8. 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….

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

  10. 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?

    • That could be caused by any number of issues. Perhaps the boot partition is too far from the first sector of the HDD, or the system could not find GRUB where you told it to look.

      So, what’s the size of HDD and how far is boot located inside? Somethings selecting a different option in EasyBCD will do the trick.

      • 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.

    • 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.

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

  11. Another THANK YOU for a great how-to.
    I just wanted to mention that my HP G6 had to be plugged in, or the LiveCD wouldn’t even load correctly (on battery power.

  12. Hey there,
    thanks so much for your work! Got a problem thou:
    I followed all steps and I restarted after the EasyBCD step, everything looked fine and I ended up at the windows boot manager. When I click on Ubuntu following error occurs:

    !! number of heads for drive 80 restored from 255 to 224. (hd0,4) [Multiboot-kludge, loadaddr=0x100000, text-and-data=0x65c2, bss=0x0, entry=0x100950]
    Error: no such partition
    grub rescue>

    When I shut down pc and retry, it works; everytime I restart system, same error.

    Any ideas?

  13. I currently have my iMac set up with a dual boot for Mac OS-X Leopard and 64-bit Windows 7, and I’d like to install Ubuntu 12.04 so that the system keeps Windows 7 but replaces the Mac OS-X. Other than the fact that I wouldn’t be shrinking the Windows partition to create a new space for Ubuntu, how would the steps in your tutorial be different? That is, will the Ubuntu installer allow me to install the Linux OS on the Mac partitions in the same way you describe it happening on a freshly created partitions?

    • Aside form any iMac-specific issues that I may not be aware of, it should not be a problem.

      If Windows is the first OS on the disk and you want to replace Mac, then you can just delete the Mac partitions and install Ubuntu. If Mac is the first OS, it is still possible to delete its partitions and install Ubuntu, but you’ll have to be a lot more careful in messing with the partitions.

      I’ll like to know the specific here, so keep me posted on your progress.

      • Thanks for the prompt reply!

        Well, the Mac OS was the first installed, though I initially had the iMac OS set up to dual boot with Win XP. Without first changing anything about that setup, I upgraded Win XP to the 64-bit Win 7 a little while back, and when I did, I lost the Bootcamp application in Windows and Win 7 now thinks its the only OS on the machine. When I use the Windows 7 disk management, I can see the Mac partition is still there and “healthy,” and imagine that I could still load the Mac OS if I held down the option key on boot up (though I haven’t tried that, to be honest, as I haven’t needed or wanted to boot to the Mac OS in the months since installing Win 7). So given that, what sort of potential headaches might I be facing if I try to install Ubuntu on the Mac OS partition? I have a MacBook on which I’ve installed Ubuntu as the sole OS, and I love it so much that I’d like to have it on the iMac, too, but for business and professional purposes, I have to keep the Windows install and don’t really want to go through the headache of reinstalling just to get it to play nice with Ubuntu.

        BTW, thanks for all your invaluable info!

        • With Mac OS first, and you not wanting to reinstall Win 7, boot into the latter and delete the Mac partitions. Just be careful that you do not delete a Win 7 partition in error.

          Install Ubuntu on the free space. The only headache, a minor one, is that the partitions for Ubuntu will have to be created manually. The automatic method will not work in this case.

          Also, that freed space recovered from Mac will have to be created as an extended partition.

          But all that is the easy part. The tough part comes after the installation: By design, Windows will not respect the presence of another OS on the same system, so you will have to babysit this dual-boot system. For example, if you decide to upgrade Win 7, it will overwrite anything it finds in the MBR.

          • Okay, so by upgrade Win 7, you mean if I wanted to change to a different flavor of Win 7 or even move on to Win 8, right? And when you say create the Ubuntu partitions manually, you mean before running the Ubuntu install and not creating them, as you describe in your tutorial, via the Ubuntu install “Something Else” option?

            Thanks for your help! I definitely appreciate it.

          • Either upgrade Win 7 or, for any reason, reinstall it.

            Yes, you’ll have to use the Something else option to create the partitions for Ubuntu.

  14. How useful information! Really appreciate it!