Windows – Installing Windows 8 over Windows 7 with Ubuntu installed using wubi

Ubuntuwindows 8wubi

I have Ubuntu 12.04 installed using Wubi on my D:\ drive , while Windows 7 is installed in win C:\. Will installing Windows 8 over Windows 7 in C:\ render my Ubuntu installation unusable? If so: How do I install Windows 8 so that my Ubuntu installation is not affected?

Best Answer

I understand that by using Wubi you mean that it's installed in an image inside your D drive, instead of being installed in its own partition or partition set.

If that's the case you won't have any problem upgrading to Windows 8, because Ubuntu is booted from the Windows boot menu.

This would be the procedure to do it:

  1. Check that you do have the setup I described above, to do so follow these steps:
    1.1. Open an elevated command prompt in Windows.
    1.2. Execute bcdedit /enum, it'll output the boot menu configuration, look for something like this:

    Ubuntu boot entry

    That'd be the menu entry for Ubuntu, you can see the path to the boot code it uses, in this case it is C:\ubuntu\winboot\wubildr.mbr. If you don't see an entry similar to this one in the output of the previous command then Ubuntu is not installed "inside" Windows, it's then probably installed the usual way with partitions for its own; don't continue with the procedure.

  2. Within Windows, insert or mount the Windows 8 DVD or image your have and start the installation.

  3. When prompted to perform an upgrade or a custom installation select to perform an upgrade, the compatibility assistant will execute.
  4. If it clears you to upgrade to Windows 8 do so, the installation will begin and Windows will reboot a couple of times.
  5. In one of the reboots you'll be presented with a boot menu with 3 options (default case, there may be more). One to boot Windows 8, one to rollback the upgrade and another one for Ubunut. Here click Windows 8 as the installation is not yet finished. It will take its time (quite some time actually) and after that the installation is finished.
  6. After Windows is upgraded to Windows 8, Ubuntu will still show up in the boot menu and you will be able to boot it just as before; this is what you'll see:

    New boot menu

In the example Ubuntu was installed directly in the C partition, I suspect that if you have it installed in the D drive the boot code will be in D too (since everything related to the Ubuntu installation is inside a directory called "ubuntu" in the root of the drive), so you could even format C and perform a clean installation of Windows 8. Although if you do that there'll be no boot menu entry for Ubuntu after the installation so you'll have to add it using bcdedit so that it looks like the one that existed before (the "Real-mode Boot Sector" screenshot above).

As an example to create one like the screenshot above you'd have to do this:

  1. Create a new entry:

    bcdedit /create /d Ubuntu /application bootsector

  2. That will output an ID, which you'll need for the next steps.

  3. Set the device:

    bcdedit /set {id} device partition=C:

  4. Set the path:

    bcdedit /set {id} path \ubuntu\winboot\wubildr.mbr

  5. Add that entry to the boot menu:

    bcdedit /displayorder {id} /addlast

  6. Done, a bcdedit /enum will show you the newly created entry for Ubuntu.

Related Question