- How do I manually add windows 7 to grub list?
- 4 Answers 4
- How do I set Windows to boot as the default in the boot loader?
- 16 Answers 16
- Customizing the /etc/default/grub file
- Finding the menuentry to set as the new default
- Editing the /etc/default/grub file
- Update the boot configuration
- Addendum
- Notes on nano
- Notes about nano, sudoeditor and other editors
- Notes on my grub file
- Add Windows 10 to GRUB OS list
- 9 Answers 9
How do I manually add windows 7 to grub list?
I am desperate to add Windows 7 to grub. I have tried sudo update-grub, I have run sudo os-prober, but I can’t seem to get windows to be added to grub.
Can someone please explain how to manually add windows 7 to my grub?
4 Answers 4
sudo nano /etc/grub.d/40_custom
by appropriately modifying the location of windows 7 in your computer.
Note If you are not careful these operations can mess up your computer.
grub-customizer helped me. It auto-detected Windows 7 for me and I was able to add it and change position and title in the menu.
Before you attempt anything further, I suggest you go to a terminal by pressing Ctrl + Alt + T and enter the following:
This should scan your system for all existing OS’s and add them to the Grub menu (See Note¹)
Next download and run boot-repair
The program should launch automatically or you can open it from the Apps list.
If none of the above works, see Note² to manually add a Windows entry to the GRUB menu.
If you have multiple Windows systems installed on the same hard drive, you will likely only see one Windows system in the resulting GRUB menu when it boots up. This is because that option is referring to the Windows boot loader which resides on the boot sector of the hard drive and/or at the beginning of each Windows partition. When that option is invoked it will run the Windows boot manager which will allow you to select your other Windows environments.
You should understand there’s a difference between a boot manager and a boot loader. For the most part both GRUB and the Windows Boot Manager (BOOTMGR) perform both duties. However Windows Boot Manager cannot load a Linux environment and vice versa, GRUB can’t actually load a Windows environment.
Hence if you’re using GRUB as your primary boot manager and you select a Windows environment at boot-up, it will load BOOTMGR as the boot loader for any Windows system you have installed and will be taken to a BOOTMGR screen which allows you to select either Windows 10 or Windows 7 from the list.
Similarly if you instead are using BOOTMGR as the primary (using bcdedit ), when you select the Linux distribution from the menu it will not boot directly into the system: it will just run GRUB (which should then reside at the beginning of the root partition instead of the boot sector of the HD) and allow you to select the desired system from there.
If none of the above works you can manually add windows entry. This solution provides a proper entry in the grub2 menu to boot into Windows 10.
A requisite word of caution, editing the GRUB menu is not recommended because it can break your system. But if you need to do it, here’s how.
First check on which disk and partition is the Windows EFI boot:
Now find the UUID of the partition. E.g:
Then you can edit the /etc/grub.d/40_custom grub file to add the lines which will help you to boot into your Windows system
Add the following modified according to your configuration:
note that entry is configured to boot from the 2nd partition gpt2 of the 1st hard drive hd0 or ahci0. If you are working on legacy, then replace all gpt with msdos
How do I set Windows to boot as the default in the boot loader?
How do I set the bootloader so that in my dualboot with Windows 7/Ubuntu 11.04, Windows start up as standard instead of Ubuntu?
16 Answers 16
Customizing the /etc/default/grub file
There are two ways of doing this using editing a grub file. These are described in the Ubuntu Community Documentation Grub2 page
The two ways are:
- Boot which ever operating system you booted last time, the «saved method»
- This is the one I use. It lets me decide which one I going to use and will allow me to reboot into that system, handy when I’m updating.
- Boot a specific operating system by default.
- The answer to your exact question.
Finding the menuentry to set as the new default
To start we need to find out what we are booting or want to boot. Open a terminal with Ctrl + Alt + t and type in
grep menuentry /boot/grub/grub.cfg
You can see that the «saved» method can come in handy when booting multiple operating systems. Save the name of the entry you want e.g. Windows NT/2000/XP (loader) (on /dev/sda1) , we need it later.
Editing the /etc/default/grub file
Type in the terminal
sudo nano -B /etc/default/grub
and your password if asked. The nano editor will open.
A. Saved method — In my preferred way, I made the following changes from the standard grub file.
I changed the value of GRUB_DEFAULT to saved :
I enabled the SAVEDEFAULT functionality by adding the following line:
B. Specific menuentry — In the way you are asking for
- Change the value of GRUB_DEFAULT to the name of the Windows system you want to always boot. The name of the corresponding Grub menuentry can be found as described in the previous section.
I wanted to have Window XP always set as default at boot, I would set GRUB_DEFAULT to «Windows NT/2000/XP (loader) (on /dev/sda1)» :
Note: Some versions of Ubuntu require single quote (‘) vice double quote («).
You could also set GRUB_DEFAULT to the line number in the menu entry list (with 0 being the first), but when the kernel in Ubuntu is updated grub adds the new kernel to the top of the list, you would have to change the number, since Windows is the last one in the menu entry list. You can see this in my menu entry list.
Update the boot configuration
Now you have to run
to update the system generated grub.cfg file in the /boot/grub/ directory.
Addendum
Notes on nano
nano is especally easy to use in the terminal. Move around with the arrow keys. Type in you addtions, delete the unwanted.
The -B or —backup option backs up the previous version of it to the current filename suffixed with a
. Very handy in case of the dreaded Fat pfinger effect.
When you are through, Ctrl + o will allow you to save your edits by hitting Enter and Ctrl + x will close. These and other options are shown at the bottom of the terminal screen with the ^ indicating Ctrl .
Notes about nano, sudoeditor and other editors
Some in the Ubuntu community suggest sudoedit instead of nano . I recommend nano — which is the default sudoedit editor in later distributions of Ubuntu — instead of sudoedit , because the default can be overridden in non-obvious ways, unless you are an administrator. sudoedit is safer in that it automatically saves a backup copy of the edited file, but the -B command line option in nano does the same thing. nano is more intuitive than editors like vi or emacs , which are very flexible but require learning a lot of commands, shortcuts or different modes.
If you prefer not to use the nano editor and prefer the Gnome Text Editor, instead of sudo nano -B use gksu gedit . I generally do this for large files, and /etc/default/grub could easily be considered a large file. Thus type in gksu gedit /etc/default/grub instead of sudo nano -B /etc/default/grub . Note that the Gnome text editor does not automatically make a backup!
Notes on my grub file
I made some changes to grub for my personal needs. Such as the background picture of the moon launch. How to do these are discussed at the Ubuntu Community Documentation page on Grub2, recommended.
Add Windows 10 to GRUB OS list
I recently got a computer from school. It came with Windows 8.1 installed. I then installed another copy of Windows 8.1 (so it would use the built-in Windows Pro license) and upgraded it to Windows 10. I then installed Ubuntu alongside both Windows 8 and 10.
Note that I made a separate 255MB ext2 partition for /boot.
Now, when I boot the computer, I first see a GRUB prompt (I already un-hid the grub prompt ‘cuz I like it that way) with Windows 8 and Ubuntu options. However, there is no Windows 10 option. If I select Ubuntu, the computer boots into Ubuntu. However, if I select the Windows 8 option, I then get sent to the Windows bootloader, where it then gives me options to boot either Windows 8 or Windows 10. (However, by this point, the computer has already loaded the kernel and all. Apparently Microsoft misunderstood the concept of a bootloader and decided that that meant «boot practically the entire system before actually showing the bootloader». Typical Microsoft.)
How can I disable the Windows bootloader and add a Windows 10 option to GRUB?
EDIT: Someone has answered telling me to disable the Windows bootloader. However, I still do not know how to add Windows to the GRUB OS list. Can anyone help with this?
EDIT 2: After removing Windows 10 from the Windows bootloader with EasyBCD, it seemed that, after a few reboots, it would continually unhide itself and Windows 10 would reappear. However, I then later deleted Windows 10 from the list of OSes in msconfig, and it seems to have stayed deleted.
However, I STILL have not managed to get Windows 10 to appear in GRUB. It’s as if GRUB simply doesn’t detect it.
Also, I’ll put this in the question so that people see it — I have tried using boot-repair , however, it has NOT helped any.
9 Answers 9
Sometimes os-prober is wrong.
Look at the UUID of your Windows 10 partition, for exemple:
Then edit /etc/grub.d/40_custom , and at the end of the file add:
Don’t forget to change the UUID.
And finally update your grub config file:
commands in terminal of Ubuntu, probably it will solve your problem.
By this command the system will automatically detect your Windows installations and add them to the GRUB list.
This solution provides a proper entry in the grub2 menu and chainloads directly into Windows 10 without reference to the BIOS. It comes from this webpage so I claim no credit. It was such a relief to find a working solution.
Briefly, edit /etc/grub.d/40_custom and add:
To find the UUID for the —set=root line (CC66-4B02 in the example) you use sudo fdisk -l to identify the EFI partition then sudo blkid /dev/sda1 (or whatever) to find the UUID of the EFI partition. Note it’s not the Windows partition but the EFI one you need. Once you’ve saved the edit, run sudo update-grub to generate the /boot/grub/menu.cfg file and then restart to test.
use this app EasyBCD for windows http://neosmart.net/EasyBCD/ download the free version and install it.
when you open it you will see an entry for windows 8 and one for windows 10.
delete the windows 8 entry and you’ll be good to go.
Update after doing the steps above go back to Ubuntu,
open the terminal by pressing ctrl + alt + T
then copy past this commands to it one after another,
and by this you will install a tool called boot-repair.
open boot repair from dash and you’ll get this window
choose the recommended repair and follow the steps.
Note you have to be connected to the Internet when using boot-repair.
As far as I understood your question you have two different Windows installations on one or more harddrives and you don’t want the Windows loader to get in the way or managing both Windows installations. I remember that it was possible on legacy setups to directly boot the Windows kernel from Grub (I may be wrong here) but I haven’t been able to do this on UEFI setups. Having two independent Windows bootloader configurations that can be called from Grub independently should be very close to what you are looking for.
It came with Windows 8.1 installed.
I’m going to assume that this is a UEFI capable computer.
- Please check that the computer actually is UEFI capable (I will remove my answer if it is not) and familiarize yourself with the differences between BIOS and UEFI (different boot modes, efibootmgr, different partition tables, EFI system partition (ESP), EFI loaders…).
- Then check that all OSes are installed in UEFI mode and check that you have a GPT partition table. You can use Windows’ dism to backup and restore partitions to a new partition table layout and use the command prompt from latest Windows installation media to reinstall the bootloader, more details on this in the next point.
- Since you have been recommended to try various other tools that don’t address your issue you have to revert these changes to a pristine condition, otherwise this will get more and more confusing. Sorry about that. 🙁
- You can use my answer from How to boot Windows 8 from a legacy MBR partition in UEFI mode via GRUB?
- This answer does install an independent Windows boot loader configuration through bcdboot in a different location where Grub will call it. For convenience I have chosen the Windows root partition. You will need to do this for every Windows installation, so that every Windows installation has its own and will only boot itself (clean the individual Windows boot menus from other entries).
- Remember that you need to create an individual entry for each Windows installation you want to boot in /etc/grub.d/40_custom and follow the instructions and explanations about UUIDs, partitions and partition tables.
- Probably disable every semi-smart feature that detects different OSes like OS-prober in Grub ( GRUB_DISABLE_OS_PROBER ) or troubleshooting boot issues with Windows or boot-repair (or manually clean up after them).
N.B.: Your request was to be able to manage all OSes with Grub, however with UEFI, the traditional «dualboot» term becomes almost a misnomer. UEFI allows coexistence of several bootloaders on the ESP and you can choose which one to boot (if they have been registered in the UEFI firmware and the manufacturers firmware doesn’t do out of spec patronizing like only booting Windows). The sad thing here is that only very few people can think about installing more than one (independent) version of Windows, Linux or one release of Ubuntu onto one computer (or a harddrive that is used with several computers and boots a different installation of the same OS release on each computer). Most of this is already possible, but mechanisms in Windows and Ubuntu (Fedora,…) plainly choose to overwrite what is in their namespace under the false assumption that there can only be one.
(I do boot Windows8/10, Ubuntu, Ubuntu LTS and Fedora on one computer and have tinkered a few times with UEFI booting under different requirements.)