Ubuntu on windows loader

/contrib/famzah

Enthusiasm never stops

Boot Linux using Windows 7 boot loader

Windows 7 and Linux live together on the same hard disk in perfect harmony. I had Windows 7 installed first, and a few GBytes of free space at the end of the hard drive which I left unpartitioned. Here is how to install Ubuntu:

  1. Download Ubuntu and burn the ISO on a CD.
  2. Boot from the CD, and install it. Make sure that you choose an empty partition, and also make sure that you select to install the boot loader on the Linux partition (example: on “/dev/sda3”, and not on the main MBR “/dev/sda”).

Until here you have an Ubuntu installation which you cannot boot, yet.

Here is how to configure the Windows 7 boot loader to include Ubuntu in the boot choice menu:

  1. Download EasyBCD and install it. EasyBCD is free for non-commercial use and offers a nice GUI to edit the Windows 7 boot loader menu.
  2. Do the following in EasyBCD — Add New Entry -> Operating Systems -> Linux/BSD:
    • Type: GRUB 2
    • Name: Ubuntu
    • Device: (Automatically configured)
  3. Finally, click on “View Settings” in EasyBCD. You should see something similar to the following:

EasyBCD ships the “stage1” boot loader of GRUB2 (\NST\AutoNeoGrub0.mbr), so you don’t have to do anything else. Just reboot your Windows 7, and the boot menu should present a choice between “Windows 7” and “Ubuntu”.

A note of caution: It is highly recommended that you do a backup of your whole hard disk before you try to install Ubuntu or modify the boot loader options.

Ubuntu Documentation

This page documents how to restore or recover the boot-loader (GRUB) after installing Windows. Some reasons to repair your boot-loader might include installing Microsoft Windows after you have installed Ubuntu, adding or removing a hard drive, or changing hard drive settings.

Note: this tutorial does not apply if you had installed Ubuntu inside Windows (via the Wubi installer). In this case, please read this page.

Using the Ubuntu CD (Recommended)

The graphical way

    Insert your Ubuntu CD, reboot your computer and set it to boot from CD in the BIOS and boot into a live session. You can also use a LiveUSB if you have created one in the past.

Install and run Boot-Repair

  • Click «Recommended Repair».
  • Now reboot your system. The usual GRUB boot menu should appear. If it does not, hold Left Shift while booting. You will be able to choose between Ubuntu and Windows.
  • The terminal way

    * Open a terminal. As of Ubuntu 11.10 and 11.04, this can be done by opening the Unity Dash (you can click the Ubuntu logo in the top panel or use the Windows key on your keyboard) and typing in «Terminal», and clicking what comes up. On earlier versions, you can achieve this by going to Applications -> Accessories -> Terminal. Alternately use the Keyboard Shortcut: CTRL + ALT + T.

    For full details on using terminal to fix grub on hard drive from Live Installer DVD or Flash: https://help.ubuntu.com/community/Grub2/Installing#via_the_LiveCD_terminal

    • You are then presented with a standard bash prompt, type — this only works to reinstall to MBR of a working system:

    where XXX is the device of your Ubuntu install. (eg: grub-install /dev/sdb). Hint: You can also use /dev/disk/by-label/ if the partition you installed on has a label. You can determine the /dev node for such a device by running:

    This will give the output of something like:

    You can also use fdisk if you do not see the /dev/disk/by-label:

    From here, find only the drive name, ignore the partition number, that is, for partitions labeled «root», «data2», «fat», «home» and «swap» it’s all still just sda. This is due to the fact that GRUB is installed in the MBR of the drive, and not on a partition.

    Trouble? If other things are messed up, e.g. if you have deleted the partition from where Grub was previously installed, grub-install may return an error message such as «cannot find a device for /. (is /dev mounted?)». You may have to do grub-install a bit differently. Refer to the handy guide on fixing a broken system

    Now reboot your system. The usual GRUB boot menu should appear. If it does not, hold Left Shift while booting. You will be able to choose between Ubuntu and Windows.

    Using the Ubuntu Alternate CD

      Boot your system from the Ubuntu Alternate CD.

    When the Ubuntu splash screen comes up with the boot: prompt, type in rescue and press enter.

  • Choose your language, location (country) and then keyboard layout as if you were doing a fresh install.
  • Enter a host name, or leave it with the default (Ubuntu).

    At this stage you are presented with a screen where you can select which partition is your root partition (there is a list of the partitions on your hard drive, so you are required to know which partition number Ubuntu is on). This will be dev/discs/discY/partX, where the X is a partition number and Y is the number of the drive.

  • Now proceed as described in «The terminal way» above.
  • See also

    RecoveringUbuntuAfterInstallingWindows (последним исправлял пользователь mcchots 2015-01-27 14:44:04)

    The material on this wiki is available under a free license, see Copyright / License for details
    You can contribute to this wiki, see Wiki Guide for details

    Ubuntu Documentation

    Introduction

    This page describes how to set up your computer in order to dual boot Ubuntu and Windows. While there are some benefits to dual-booting (e.g. better performance for a native install), it is not recommended. Instead, it is best to do a native install of Ubuntu, and then virtualize the other operating system.

    Back Up Your Data

    Although this may seem obvious, it is important to back up your files to an external backup medium before attempting a dual-boot installation (or any other hard drive manipulation), in case your hard drive becomes corrupted during the process. External hard drives, USB flash drives, and multiple DVDs or CDs are all useful for this purpose.

    Have a Windows recovery CD/DVD available

    Some computer manufacturers that pre-install Windows provide a Windows recovery/re-installation CD or DVD with the computer. However, many companies no longer ship a physical disc but instead create a hidden partition on the hard drive in which the recovery-disk information is stored. A utility is then usually provided which allows the user to burn a recovery/re-installation CD or DVD from it. If you are buying a new computer and intend on dual-booting, make sure you have (or can make) a physical Windows recovery/re-installation CD or DVD. If neither a CD/DVD nor a recovery partition/burning utility is provided by your computer manufacturer, you may need to contact your vendor and ask for a CD or DVD (to which you are normally entitled under the Windows EULA).

    Getting Recovery Media

    You may need to request a physical recovery/re-installation CD or DVD directly from your computer manufacturer. See WindowsRecoveryCd.

    Once you have created a physical backup disc from a restore-image partition on the hard-drive, the restore-image partition can either be removed or left in place. Ubuntu can be installed with it intact without problems.

    Install Ubuntu after Windows

    A Windows OS should be installed first, because its bootloader is very particular and the installer tends to overwrite the entire hard drive, wiping out any data stored on it. If Windows isn’t already installed, install it first. If you are able to partition the drive prior to installing Windows, leave space for Ubuntu during the initial partitioning process. Then you won’t have to resize your NTFS partition to make room for Ubuntu later, saving a bit of time.

    When a Windows installation already occupies the entire hard drive, its partition needs to be shrunk, creating free space for the Ubuntu partition. You can do this during the Ubuntu installation procedure, or you can see How to Resize Windows Partitions for other options.

    If you have resized a Windows 7 or Vista partition and cannot boot up Windows, you can use the instructions from WindowsRecovery to fix it.

    Install Ubuntu

    Download an Ubuntu LiveCD image (.iso) from Ubuntu Downloads and burn it to a disc (see BurningIsoHowto).

  • Insert the LiveCD into your CD-ROM drive and reboot your PC.
  • If the computer does not boot from the CD (e.g. Windows starts again instead), reboot and check your BIOS settings by pressing F2, F12, Delete, or ESC. Select «boot from CD».
  • Proceed with installation until you are asked this question: «How do you want to partition the disk?».
  • If you have already partitioned the disk and left space for Ubuntu, install it to that and then follow the rest of the steps.
  • Otherwise, choose one of the next two steps.
    • Choose the first option, which should say «Install them side by side, choosing between them each startup».
    • Specify the size of the new partition by dragging the slider at the bottom of the window.
    • Click on «Forward».

    Manual partitioning

    • Choose «Manually edit partition table».
    • Listed will be your current partitions.
    • Select the partition you want to resize and press Enter.
    • Select «Size:», press Enter.
    • Select Yes, press Enter.
    • Type in a new size in gigabytes for your partition, it’s recommended you free up at least 10 GB of free space for your Ubuntu install. Press Enter when happy with your changes. It may take some time to apply the changes.

    Create a swap partition of at least your amount of RAM (if you don’t know, 8000 MB is a good value).
    Create a partition for your Ubuntu installation.

    Create other partitions if necessary: see DiskSpace

  • Select «Finish partitioning and write changes to disk».
  • Master Boot Record and Boot Manager

    GRUB2 is the boot manager installed in Ubuntu by default. GRUB2 is an open source boot manager that install the main parts of the boot loaders inside Ubuntu. This means Ubuntu is independent and avoids any need for writing to other operating systems. To accomplish this, the only thing in your computer outside of Ubuntu that needs to be changed is a small code in the MBR (Master Boot Record) of the first hard disk, or the EFI partition. The boot code is changed to point to the boot loader in Ubuntu. You will be presented with a list of operating systems and you can choose one to boot. If you do nothing the first option will boot after a ten second countdown. If you select Windows then GRUB or LILO will chain-load Windows for you at the Windows boot sector, which is the first sector of the Windows partition.

    Windows Vista no longer utilizes boot.ini, ntdetect.com, and ntldr when booting. Instead, Vista stores all data for its new boot manager in a boot folder. Windows Vista ships with an command line utility called bcdedit.exe, which requires administrator credentials to use. You may want to read http://go.microsoft.com/fwlink/?LinkId=112156 about it.

    Using a command line utility always has its learning curve, so a more productive and better job can be done with a free utility called EasyBCD, developed and mastered during the times of Vista Beta. EasyBCD is very user friendly and many Vista users highly recommend it.

    Installing Windows After Ubuntu

    There are two different approaches:

    Recovering GRUB after reinstalling Windows

    Please refer to the Reinstalling GRUB2 guide.

    Master Boot Record backup and replacement

    This method does not work for computers with UEFI boot. In consequence, it won’t work for pre-installed Windows 8 and some pre-installed with Windows 7.

    Back-up the existing MBR, install Windows, replace your backup overwriting the Windows boot code:

      Create an NTFS partition for Windows (using fdisk, GParted or whatever tool you are familiar with)

    Backup the MBR e.g. dd if=/dev/sda of=/mbr.bin bs=446 count=1
    Install Windows

    Boot into a LiveCD
    Mount your root partition in the LiveCD

    Restore the MBR e.g. dd if=/media/sda/mbr.bin of=/dev/sda bs=446 count=1

  • Restart and Ubuntu will boot
  • Setup GRUB to boot Windows
  • Also see

    MultiOSBoot — How to boot more than two operating systems from a single hard drive.

    WindowsDualBoot (последним исправлял пользователь tobefree 2015-06-29 08:09:22)

    The material on this wiki is available under a free license, see Copyright / License for details
    You can contribute to this wiki, see Wiki Guide for details

    Add an entry for Ubuntu on Windows 8 boot loader

    I have installed Ubuntu 12.10 by creating free space in Windows 8 and then using that space to create 3 partitions, one for SWAP, one for GRUB (mounting point is /boot) and one for the actual OS. I did this so the Windows 8 boot loader wouldn’t be overwritten in case I ever wanted to remove Ubuntu. I can still boot into Ubuntu if I select the boot loader from the BIOS.

    I want to add Ubuntu to the Windows 8 boot loader and I’ve been told to use EasyBCD. The issue with that is it doesn’t actually direct Windows to the GRUB file, but rather to something like autogrub0.mri . I have found another programme called Visual BCD which will allow me to actually set the bootloader paths and drives.

    From here, I don’t quite know what to do. I believe I have it set to the correct drive but I don’t know if I’m directing to the right file. I think it’s /boot/grub/x86_64-efi/grub.efi . I don’t know if that’s the right file, if I need to remove /boot or if the / need to be \ as that’s what Windows uses.

    Sorry for such a lengthy post, please help!

    3 Answers 3

    Are you using UEFI and Secure Boot? I’m going to assume you are since you are picking a UEFI file. I also would recommend disabling secure boot while you at least try to get it to work. Re-enable it when done and re-test.

    I’m assuming you are running a 64 bit Windows 8, and therefore must use a 64-bit Boot Loader per the UEFI standard, and then you must be running 64-Bit version of Ubuntu. If you are not, then you have to disable UEFI. I would recommend just re-installing with the 64 bit version.

    To answer your question:

    If you are using 64 bit Ubuntu the file I believe you should use would be located in

    If you are using secure boot I think you will need to launch this file since it’s signed:

    If you are using 32-bit Ubuntu you must disable UEFI

    So, here is a link about EasyBCD, looks like you must need 2.2 to have EFI support

    You would probably want to look for threads about GRUB using the last loaded and set it to zero time if you are using Windows the boot loader so you never see it if you pick Ubuntu.

    I’m going to agree with the other answer, I highly recommend running GRUB as your boot loader. It works great, it detects the Windows .efi files and launches them (Not in secure boot though this is bug #1091464). I would be surprised if EasyBCD allows you to boot all OS’s in SecureBoot. I use Grub Customizer to delete unneeded entries, give it a background, and reduce the timer. It’s just far more customizable and has a lot of support and history.

    Hopefully you have figured something else out by now.

    But just wanted to suggest that you not use the windows boot-loader, as it is incredibly fickle when it comes to recognizing Linux partitions. I’ve had it working fine, then had it go missing again after windows updated and I’ve also had it keep Ubuntu listed, but fail to actually boot to it both after upgrading Ubuntu versions and reinstalling Ubuntu.

    Instead, it is very easy to use Grub, and if you ever decide that Ubuntu is not for you (which will hopefully never come up), you can use a ‘secure remix’ liveCD/USB to uninstall Ubuntu and run Boot Repair so that it loads directly into windows as it normally would. I’ve heard people say that they don’t like Grub, but in my experience it rarely has troubles recognizing any other OS and when it does it is easy to fix by simply running Boot Repair, which has a great support system to help you should you encounter anything you can’t resolve. (I don’t imagine Microsoft is overly keen on helping you get your Ubuntu partition running, hence why you are asking here, not there.)

    Again, hopefully you have figured something out, but I just wanted to make you, and anyone else who might have the same problem, aware that you will have a much harder time getting the windows boot-loader to work and will surely have more troubles with it in the end.

    Читайте также:  Как сменить часовой пояс windows
    Оцените статью