Saturday, April 9, 2016

Dual boot for Windows 8 with Bitlocker and Ubuntu 14.01 LTS, UEFI version

  • Make sure you are booting in UEFI, not legacy mode. Seriously, check that shit.
  • Turn off secure boot.
  • Windows 8 goes first. For good measure, make sure the drive is GPT, not MBR. This can be done even in the install by clicking the "repair" and clicking your way to a commandline (tons of how-to's on teh interwebs)
  • If you need to make a UEFI-capable install USB flash, simply use diskpart to: 1) clean the drive 2) convert to GPT 3) create a primary partition DO NOT mark it active!!! 4) format it to FAT32 5) assign a letter. Close Diskpart, if you have a ISO somehow extract it (W8 and later can mount ISOs as a virtual drive; winzip can open it like an archive), dump the contents straight to the flash.
  • Create a patition for windows, make sure you leave enough space for Ubuntu, 10GB seems to be the recomended minimum. Windows installer should tell you that it's going to create additional pratitions, there should be a total of 4 including the one you made.
  • After the install and initial config, set up Bitlocker, save the keyfile outside the encryped drive, encrypt drive. Take ownership of the TPM. Reboot and make sure it works.
  • Disable fast boot, otherwise stuff WILL BREAK. There's little difference having it on for SSDs, magnetic drives are a different story though. The checkbox can be found in power management ->buttons setup ->the top "change what you can't now..." checkbox -> allow fast boot (uncheck).
  • Install Ubuntu. Bootable USB the same way as for windows. I chose 14.01 LTS, but I see no reason the newer versions would not work. Run the setup in "install alongside windows" mode. Partitions can be shrunk later. Make sure you note down all the passwords and pass phrases you set up. Test Ubuntu boot.
  • Test Windows boot. Most likely it will require you to input the key that you should have saved outside the encrypted drive. If you didn't, you're a dumbass and now have locked yourself out. Best start over.
  • boot Ubuntu, Change UEFI boot order via efibootmgr - in terminal type sudo efibootmgr -v  to see whats going on (you'll see quite a few  things with 4-digit numbers, and the boot order), then type sudo efibootmgr -o with the altered boot order. You'll most likely be switching the 2nd for the first. This is not fuck-up-resistant! You screw up - no worky worky!
  • If windows boot works, reboot again. If it keeps requesting you input the key every time you boot, you have to take ownership of the TPM again. If the greedy bastard keeps insisting you input the key over and over again despite you taking ownership of the TPM, something's fucked up and you have a long Google session ahead of you.
  • You will most likely not see any mention of Ubuntu during boot anymore, but fret not, try mashing whatever key brings up the boot menu before it starts booting, you should see "windows...something" and "ubuntu". This will be the way for choosing. Should also work for additional UEFI installs, the names seem to match the directories in the \EFI  
  • Turn secure boot back on
  • Install drivers and crucial software for both systems, make a disk image. Seriously, do that, the time you save when reinstalling is makes this worth it. Save the keys, passwords and passphrases with the image, as it's useless without them.
  • Enjoy your dual-boot.

This was done on a Lenovo x230 running an aftermarket SSD, Windows 8.1 and Ubuntu 14.01 LTS, all from UEFI-capable bootable USB flash drives. Both OSs run in secure mode with no bitching.
The boot menu is slow to load (10s for me), but that seems to be feature, not a bug.
Your results may vary, as i uderstand UEFI implementation is not perfectly the same for all PCs.

No comments:

Post a Comment