How to install GRUB from inside Windows 7

14

5

I am trying to make a kernel in Visual C++ (Windows) using the tutorial here. What I am wondering is how to install GRUB from within Windows 7. If I have to download Puppy Linux or something I will, but I would prefer to install it from within Windows. In case you were wondering, I want to boot a PE EXE with a multiboot header that supports GRUB.

elijaheac

Posted 2012-01-23T00:13:27.927

Reputation: 259

Answers

18

EasyBCD can automatically install a GRUB-based bootloader called NeoGrub. It'll be chainloaded from the Windows bootloader, and you can edit its configuration file from within Windows; it also supports NTFS so you can save the kernel to the NTFS partition and load it from there.

Disclosure: I wrote EasyBCD.

Mahmoud Al-Qudsi

Posted 2012-01-23T00:13:27.927

Reputation: 3 274

I have a peculiar problem : I am able to get to grub rescue, using yours as well as a manual approach, but unable to generate a grub2.cfg from even the rescue disk (some error about not finding /etc/release) – Milind R – 2014-11-18T07:36:20.010

4Crackin' answer... "I wrote EasyBCD"... Boom. – Kinnectus – 2015-12-08T17:13:57.137

@Mahmoud Al-Qudsi: Excuse me, would you please take a look at this also?! link because nobody answered!(even low views!) Thanks in advance.

– Small Boy – 2016-11-30T18:37:16.113

Fails on Vista. Fails to install the .Net framework 2. Guess it's time for it to change the framework. Anyways great work. – Nagaraj Tantri – 2013-11-17T04:43:34.667

2The latest version of EasyBCD can use either .NET 2.0 or .NET 4.0. You cannot manually install .NET 2.0 on Vista because it already ships with it. – Mahmoud Al-Qudsi – 2013-11-17T18:22:39.020

4

Another solution is Grub4DOS.

Despite the name it even works with Windows (XP) - propably with 7, too.

Nils

Posted 2012-01-23T00:13:27.927

Reputation: 347

can it find grub.cfg which is in a linux file format such as ext4 ? I think no. – Don – 2014-07-26T02:17:31.010

@Don I did install grub4dos on a fat partition. That can be read and written by all systems. – Nils – 2014-07-26T21:04:07.977

do you have a tutorial to make it work on win 7 ? it does not show up partitions in the UI when i choose Install grub form the menu. – tgkprog – 2013-06-08T08:56:01.577

tried to run WinGrub from admin prompt that did not help either. i have ntfs on my main c drive – tgkprog – 2013-06-08T10:06:15.897

2

I had this problem: had Kubuntu installed, then installed Windows 7 (Pro x64), then Kubuntu disappeared from the boot menu.

My Solution:

Install EasyBCD, add GRUB2 to boot menu, reboot, enter *Ubuntu, do this:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

Run Boot Repair.

Boot repair photo

Choose Recommended repair.

Than again boot Windows and, using EasyBCD, remove GRUB2.

notgiorgi

Posted 2012-01-23T00:13:27.927

Reputation: 151

Welcome to Super User. External links can break or be unavailable, in which case your answer would not be useful. Please include the essential information within your answer and use the link for attribution and further reading. Thanks. – fixer1234 – 2015-12-08T18:20:15.710

I'm curious why you remove GRUB2 as the last step. Isn't adding it the objective? – fixer1234 – 2015-12-09T14:01:57.777

If you don't remove it from EasyBCD, when you choose windows 7 on GRUB, then you'll have choice between ubuntu and windows again. – notgiorgi – 2015-12-10T11:19:08.933

If you remove GRUB, it seems like you would be back where you started (without GRUB). If the issue is Ubuntu, wouldn't the solution be to remove Ubuntu from the boot list? For example, in a GRUB-based multi-boot system, GRUB is what gives you the choice of OS. You can edit GRUB to remove an OS, change the order, etc. – fixer1234 – 2015-12-10T16:53:44.553

2You remove GRUB that Windows created, not the one you created from Ubuntu, or else you'll have two GRUB-s – notgiorgi – 2015-12-10T17:43:36.343

2

Another solution is to use Grub2Win that supports both EFI and BIOS loading on Windows 7-10/XP/Vista. Based on grub version 2.02 and give you a GUI to handle a boot.

Max Vyaznikov

Posted 2012-01-23T00:13:27.927

Reputation: 121