Finally fixing Wubi!

I’ve had so much grief with WUBI and the dreaded sh:grub prompt and grub-pc in the last few months. After many workarounds for getting fixing Wubi after each kernel update. I decided it was taking up too much of my time, so I erased Windows from my work laptop, and installed Ubuntu natively. However, there are so many people still using Wubi, and there is no official Wubi fix for the problem on their forums yet, so I decided to write up this post with a new fix which seems to work rather well (it works wonderfully on my home computer that had Vista and Wubi installed).

Thanks to Richard Carter for pinging back to my original blog post with what seems to be THE right way to fix this problem.

It seems the newer kernels (2.6.31-19 and up) and Grub2 had a strange incompatibility when trying to boot from NTFS. In this write-up, they mention that the cause of the problem is:

To be able to boot Wubi, Grub2 has to access the ntfs partition which is hosting Wubi. There is a bug in Grub 2, which prevents Grub2 to read any files on an ntfs partition beyond the first 4GB. If any of the boot files is outside of the 4GB limit, booting will fail. Depending on which boot file is outside the limit, the symptoms can be quite different. Since any kernel or Grub update relocates some of the boot files, you might be hit by this bug at any time.

So, how do we fix this? It’s actually very easy. All you need to do is download a new Wubildr file which corrects the problem from here. (You can safely do this from within Windows if you cannot boot into Linux). Then just copy that file to your Windows c:\ drive, overwriting the faulty wubildr file that was there.

After that, just reboot and your machine should boot into Linux normally. It worked like a charm for me, and it even kept on working well after upgrading kernels from 2.6.31-19 to 2.6.31-20.

27 thoughts on “Finally fixing Wubi!”

  1. doesn’t work in all cases though. Like I commented on your other post, I updated to the latest kernel(2.6.31-20)and downloaded some updates. Now restarting the system drops me back in the grub shell.
    Trying to manually boot fails because grub complains about invalid magic number on the vmlinuz…2.6.31-20 kernel. cat /boot/grub/grub.cfg gives me all garbage on the screen.
    So looks like some updates can still screw up the way wubi/grub work.

  2. OK, please ignore my previous post. I identified the mistake. My stupidity actually.
    I have installed wubi(and ubuntu) on my E drive.(C: has windows XP, D: is for data and E: is the ubuntu installation). Now when the suggested fix was to overwrite wubildr with the “patched” one, I was always overwriting the E:\ubuntu\winboot\wubildr with the patched one.

    What I should have done was to patch C:\wubildr with the fixed version. Actually, I never realised that C:\wubildr exists in the first place.
    For those of you who are equally ignorant like me, please replace C:\wbuildr with the fixed version. and you should be able to boot normally again.

  3. Wow.

    After running into this problem at least 5 times on two different computers and doing several Wubi reinstallations, breaking my Windows boot twice, having to actually reinstall Windows once, and then memorizing the grub-sh boot steps, it’s almost painful to know the fix is as simple as replacing a file in Windows.

    Thanks a ton for this info, it’s good to know I can fix it in a single step if I run into this problem again. Every other forum/blog was useless for me, some of their solutions actually made things worse.

    Thanks again!

  4. Hi all!
    I’m experiencing some problems with this issue. After replacing wubildr in C:\ I’ve fixed one problem (I deleted it ¬¬) But I still have problems, so I tried with the other post related to this problem: http://www.omaregan.com/?p=583 and I’m not able to find my kernel file. In linux/boot I’ve this files:
    bcd BCD.LOG BCD.LOG1 BCD.LOG2 boot.sdi bootfix.bin bootstat.dat cs-cZ/ da-DK/ (several folders like these) etfsboot.com and memtest.exe ;
    in each of these “es-ES/” like folders I’ve : “bootmgr.exe.mui” and “memtest.exe.mui”.

    I hope anyone can help me :)

    Thanks in advance!

  5. That’s the simplest solution given ever! Thanks a lot! Is there a way that you can edit your old blog with the solution of typing in the grub shell? (http://www.omaregan.com/?p=583). It still comes before this page in a Google search and is a much more complicated way.

  6. Thank you so, so much. I was just about ready to delete wubi. It just amazes me that the solution ended up being so simple (though hard to come by). You are saving a lot of people from much frustration with this good deed.

  7. Thanks so much!!! I’m just a normal person who was so fed up with Windows that I chose to try Ubuntu. Seems like it takes more of a geek to really be able to work with open-source software, but I’ll keep trying.
    Took me 2 days and 3 nights to find this post, but the solution couldn’t have been more simple – thank you!
    S

  8. Well, I still have the problem after replacing the wubildr file in windows C:\. When i chose to edit the command in grub, i found it that it showed hd(0,1). Actually my windows C:\ is in hd(0,5), do it related to the problem?

  9. Thanks for this. It seems like I run into these issues that keep Linux from booting from time to time. Sometimes I figure it out myself..usually I just search and am lucky enough to find someone else who has solved the problem and been kind enough to document the solution (as in this case).

    I’m not about to stop using Linux any time soon, but I can see where things like this are going to keep Linux from ever going mainstream. That’s too bad.

    Anyway, I’ve added your blog to my RSS feeds in Feed Demon. Thanks again!

  10. Omar,

    From my experience, the problem is solved with wubi 10.04 install. I’ve done three systems now and no issues whatsoever using the update manager. And it did step the kernel at least once.

    Can anyone else confirm this?

  11. Omar,

    I’m using 10.04 via Wubi. Contrary to the previous poster’s experience, this grub2 updating bizo was driving me mad. I decided to revert to legacy grub. I uninstalled grub2 and installed legacy grub according to instructions I found on the Ubuntu site. However, I was stumped when running grub-install at the question as to the device on which to install grub. I tried /dev/sda1, but got a message like /dev/loop0 has no BIOS device.

    What device name, I wonder, should one be using if one’s running Ubuntu via Wubi?

    Since I couldn’t figure it out, I took a chance at that point and reinstalled grub2. When I was asked for the number of the partition on my single hard disk on which to install grub2, I said to proceed without doing that. Then, when I rebooted, I chose Ubuntu and everything worked as normal.

    Could the simplest solution to this problem be that, when one is invited to update grub2, one declines, uninstalls the exiting version of grub2 and installs the new version of grub2?

  12. THANK YOU SO MUCH!!
    Everything I tried didnt work, until this! and it was so simple!
    again, THANK YOU SOOO MUCH!!

  13. SOLVED SOLVED SOLVED
    machine : dell M65 Win 7 , and , ubuntu 10.04 using wubi ( super grub2 1.98s1.150)

    After update Ubuntu and restart the system I had the message ERROR

    Error: No such Device: fc538f9e-594b-4379-a765-17af584161bb.
    grub rescue>

    I fixed it with :

    http://www.omaregan.com/?p=608

    and

    Bootrec.exe tool to remove windows 7 startup problems
    http://www.programmersheaven.com/user/jacobluis/blog/4979-Bootrecexe-Tool-To-Remove-Windows-7-Startup-Problems/
    http://neosmart.net/blog/2009/windows-7-system-repair-discs/
    http://neosmart.net/wiki/display/G/Burning+ISO+Images+with+ImgBurn
    and

    How to restore the Windows Vista or 7 bootloader
    http://ubuntuforums.org/showthread.php?t=1014708

    Et voila l’ordi à nouveau !!! Kool

  14. Doesn’t solve the problem yet. To begin with, the Ubuntu auto-update destroyed GRUB to the extent that I can’t even boot into Windows, and I’m typing this comment from my mobile.

    I tried to install wubi with Ubuntu 10.04 on my Fujitsu AH530, which helpfully pre-installed Windows 7 in a way which something like wubi is the only possible way to make it dual-boot, and the first Ubuntu auto-update destroyed the bootloader completely. I can’t even go back to Windows to uninstall wubi. All I could do was dig out the recovery CD, and restore the factory Windows 7 image, losing all my programs and data.

    So much for wubi. I’m going back to what my new laptop came with.

  15. it worked only for couple first times.. but doesnt work anymore.
    so the fun continues..
    load windows
    copy file
    load ubuntu
    not much fun, anyone has the same problem?

  16. Pingback: Anonymous
  17. Thx man. Its great to find an easy solution for a problem tha lt lukily for me only consumed a few hours i’ll tedt it 2morrow and inform as it’s 2 late 2day

  18. Please help me:

    i am having 5 Drives in my system:

    C: Vista
    D:,E,G
    F: Ubantu(wubi)

    today by mistakely i deleted wubildr.mbr file. now when i rebooted my system, 2 drives are not visible(G,F).
    when i try to boot to ubantu it says /ubuntu/winboot//wubilder.mbr the selected entry cound not be found.

    please help me

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>