I have Ubuntu 12.10 and Windows 7 Home Basic in one machine. After I put my Windows 7 to hibernate and then when I press the power button, instead of loading the BOOT OPTIONS or GRUB screen it directly boots Windows 7. I've read in some forum that pressing ESC after you press the power button, but even it couldn't help me as the laptop started making a loud noise. Please help me on how should I boot OS while hibernate W7 and again RESUME W7 after shutting down Ubuntu. Thanks in anticipation.
3 Answers
First, it's important to understand the technical reasons why what you are are hoping to achieve is likely infeasible. When you hibernate Windows the computer writes everything in memory to the harddrive and powers off the computer. When hibernating, any changes to the disk could corrupt the install and render your computer unusable. Therefore, hibernation is specifically designed NOT to allow you switch between OSes while one is hibernating.
That being said, see https://superuser.com/questions/46299/is-it-possible-to-enable-hibernation-when-dual-booting-windows
Depending on your setup you should be able to use your BIOS boot menu to switch between OSes when hibernating.
This relies on you having installed each OS on different physical drives.
Answer:
Because you have Ubuntu installed using Wubi, unfortunately, you won't be able to choose which OS you want to boot if Windows is hibernated.
Explanation:
From the comments, it seems that you have Ubuntu installed using Wubi, which means that you installed Ubuntu inside Windows. This is because in the comments, you said "Ubuntu is installed on partition H:", which probably means that you can access this H: partition from your Windows OS and see a folder called "Ubuntu" inside it, correct? If yes, read on:
When you restart your computer, it boots BOOTMGR by default, which is the Windows bootloader, and gives you the OS choice (Windows or Ubuntu). If you select Ubuntu, you go into GRUB. All good so far. However, the first thing BOOTMGR does (before giving you the OS choice) is it first checks if there is a hibernated OS. When it finds that Windows is hibernated, it directly boots into it, without giving you the options. This is what is happening on your machine. GRUB, on the other hand, does not do this.
How would you overcome this? By making GRUB the default bootloader (with Ubuntu and Windows as OS choices), not BOOTMGR. This, however, is in the case if Ubuntu is installed on a separate partition (a partition formatted in another format, ext4, that is not accessible through Windows). But because your Ubuntu is installed through Wubi, meaning that it's on the H: partition, meaning that it's on a Windows partition, this partition is part of the hibernated Windows! Get it =)? So we can't install GRUB as the default bootloader and ask it to boot Ubuntu from the hibernated partition, because then it will (I think) attempt to destroy the "hibernated data" and basically shutdown your Windows (and you lose all your unsaved data when you hibernated), then attempt to boot into Ubuntu. Get it now?
So in the end, unfortunately, I don't think it's feasible. Your solution would be to uninstall Ubuntu/Wubi, and install Ubuntu from scratch on a separate partition. This solution will uninstall Ubuntu/Wubi and will delete everything in your Ubuntu, so make sure you backup the files you need.
Another possible solution is to convert (migrate) your Wubi Ubuntu into a full, normal Ubuntu installation (put in on a separate partition). This way, it will copy over all your content, and you should find all your files the way they were (**although it is always advisable to backup your files whenever playing around with OSs). The steps to do this solution are detailed here: How to convert Wubi install into regular install? Here is a brief description of what you'll be doing:
- Boot into your Wubi Ubuntu.
- Using
gparted, create an empty partition big enough to house your Wubi Ubuntu (just make a partition as big as your H: partition, or as big as the "Ubuntu" folder). Chooseext4as the filesystem type for the new partition. - Download the script from that question, and run
sudo bash wubi-move.sh /dev/sdaX, wheresdaXis your new partition you created in step 1 ("X" is a number, e.g.sda6. You can see the number of that new partition ingpartednext to the partition).
Again, this is a brief description. Visit the question I linked and read the whole thing.
Having said all of this, my advised solution would be to:
- Backup everything you want from your Ubuntu.
- Completely remove Ubuntu Wubi (How do I uninstall Wubi)
- Install Ubuntu from scratch.
If your H partition was only meant for Ubuntu, then you can use that whole partition to install the new Ubuntu.
I am answering the part of the question that deals with the issue "I can't even resume Windows". I was also having this problem... in a system with dual-boot installation of Windows 7 and Ubuntu (actually Linux Mint 17 64-bit!), I have a modern system (Gigabyte motherboard with UEFI bios) and can selectively boot the Windows boot manager, the GRUB loader, etc.
When I hibernate my W7 session, no matter what I do, I cannot resume it. I always get
"Your computer cannot come out of hibernation"
and the error shown is code 0xC000009a. It doesn't matter if I choose the Windows boot loader from the BIOS boot menu, or use GRUB and select the Windows boot option; the end result is the same: I am forced to destroy the information from the suspended (hibernated) W7 session and boot "fresh" into Windows.
Researching this a bit, especially by searching for that error message and the specific code, I found this solution, credit where it is due: http://www.sevenforums.com/general-discussion/307622-serious-error-0xc000009a.html and http://answers.microsoft.com/en-us/windows/forum/windows_7-system/windows-boot-manager-your-computer-cant-come-out/a3170a6f-2962-45ac-8005-bde7abb35831
Apparently, the error code indicates an error relating to registry information in Windows. But, it appears there also may be some problem with the hiberfil.sys file that Windows uses to store the hibernated information.
SO, the fixes suggested by both of these websites is as follows:
Find your Start -> All Programs -> Accessories -> Command Prompt item on the menu, right click it, and select Run As Administrator. Then, type the following command:
powercfg -h off
Reboot your system (do NOT hibernate)...
when you are back in Windows again, repeat the running of Command Prompt with Administrator privilege as above (kinda like "sudo"), then type:
powercfg -h on
test your fix by hibernating W7, then waking the machine up and (if you enter the GRUB loader due to your setup) choose to boot Windows 7. It should say "Resuming Windows"
This sequence of steps apparently clears up any corrupted hiberfil.sys AND any Registry "misapprehensions" about how your hibernation is set up. I don't have more technical detail as to why it works, but it does! I can now hibernate freely, and boot back into Windows 7 after hibernating, even using GRUB as the boot manager (but of course, selecting Windows boot).
I changed my GRUB default to boot Windows after the timeout, so that restoring my hibernated sessions of W7 would be the most convenient for me. I use W7 more than Linux, but with the dual boot setup, I have the best of both worlds!
Thanks to every person out there who has brought us this wonderful free software called GNU/Linux!
- 101