Dual Booting

I regularly use Windows and Linux to develop. It is my preference to use Windows as my host OS and then to just virtualize Linux. My laptop unfortuneatly is not powerful enough to do virtualization well. As a result, I have an interesting dual boot/virtualization setup. I have my systems set up such that I can boot into Windows or Linux. Pretty standard. But if I want, I can virtualize that same Linux installation from inside of Windows. Here’s how I set that up.

With this particular setup, it doesn’t matter whether you install Linux or Windows first. We will be using Windows’ bootloader to choose between Linux or Windows. I will not cover the installation of Linux, but I trust that you were able to get it and Windows installed side-by-side on your machine. If you followed the above guide for your Windows installation, you can even reuse your data partition.

At this point, depending on your installation order, you probably either have Linux installed and Windows booting or Linux and Windows installed and booting through Grub. In both cases, you’ll need to boot into Windows. Download, install, and launch EasyBCD. We are going to use this software to add Linux to the Windows 8 boot menu.

bcd

We need to add an entry into the menu for Linux. Click on “Add New Entry” on the left-hand side. Then choose the “Linux/BSD” tab under the “Operating Systems” group. Enter your specific configuration into the three fields. In my case, I was using Grub2 to load Ubuntu from the fourth partition on my disk. Once you’ve confirmed your settings, click “Add Entry”. This will not commit any changes yet, so don’t worry if you mess up.

bcd

To commit our changes to the disk, click “BCD Deployment” on the left-hand side. Makes sure you choose to install the Windows Vista/7 driver and not XP. Click “Write MBR” to write your changes.

bcd

At this point if you reboot, you should see Windows 8 and Linux on the boot menu!

MY SYSTEM WON’T BOOT!

Don’t worry. I screwed up my system in the process of writing this up. There is an easy fix.

When you boot your system, stop it in the Windows 8 startup menu. Navigate to the options menu and click “Choose other options”, “Troubleshoot”, “Advanced Options”, and finally “Command Prompt”. If you unable to enter the startup menu, you can get to these same setting from a bootable disk. Just choose your language and then click on repair.

Now that you have a command prompt, run: bootrec /rebuildbcd. This will scan for Windows installations and prompt you to add them into the BCD. Follow its on-screen instructions. After this completes, you will be able to boot back into Windows. You will need to go back through the previous steps in order to add Linux to your bootmenu.