Dual-booting Windows 10 and Ubuntu 16.04 in UEFI Mode
I haven’t looked at any Linux distros in a while, so I thought I’d see how Ubuntu was running these days. First let me say that I think Ubuntu is pretty sweet for a free OS and the installation process is generally very smooth. However, in this particular instance I ran into some issues.
I downloaded the latest Ubuntu desktop LTS (16.04) and created a bootable USB drive to run it “live.” Once I booted it up I noticed that the refresh rate wasn’t very good; my mouse cursor sort of jerked around the screen. I’m guessing the default open-source driver for my nVidia video card didn’t work so well at ultrawide 3440×1440 resolution. I went into the settings to choose the proprietary nVidia driver, but that didn’t have any effect. OK, maybe I need to restart.
Crap, the “live” USB drive doesn’t save any settings. A quick Google search informed me that I could create a version of the live USB drive that will save settings (up to 4GB of saved data apparently). I tried creating that version of the drive but when I booted I just got some weird kernel error message.
Ah, tinkering with PCs.
This is starting to seem like more trouble than it’s worth, but I’m gonna keep going for a bit.
At this point I figured I might as well set up a dual-boot with Windows 10 and Ubuntu to get the “full” experience. It can’t be that hard, right? I’ve done it before with Windows 7 and an older version of Ubuntu.
I knew I needed a separate partition for Ubuntu, and I wanted to give it about 100GB from my primary SSD boot drive. I opened Windows Disk Management to shrink the volume of my Windows partition, but it was only saying I could shrink it by 33GB. That can’t be right, I have over 300GB of free space.
Back to Google.
OK, so by checking for a certain event ID in Event Viewer I saw that my paging file was the “unmovable file” that was keeping my shrink size to 33GB. I when ahead with the nuclear option suggested by that link and disabled the paging file (i.e. virtual memory), system restore, and ran disk cleanup, then rebooted. Now I was able to free up 100GB for Ubuntu.
Phew, where was I?
Oh yeah, so I created the normal “live” USB drive again, booted it up, and ran the installer. Then the installer warned me that it was going to be installing with UEFI support but I currently had an OS that was using legacy (a.k.a. CSM) BIOS support. The implication seemed to be that if I installed Ubuntu, I might not be able to boot into Windows 10 again.
That seems weird, because I reinstalled a fresh copy of Windows 10 not too long ago and I know I have a UEFI motherboard. Why would Windows 10 be installed in “legacy” mode? After some more Googling I found out that yup, I had Windows 10 installed in Legacy BIOS mode. Dammit Microsoft, why did you let me do that?
OK. Maybe I should have paid more attention. This is the price you pay to build your own PC, after all.
Now I’m hoping there is some way to convert a Windows 10 installation to UEFI mode. After all, I converted my SATA drive from IDE mode to AHCI mode way back in the day. Honestly, this feels a lot like that did; there’s some new “mode” of doing things that’s “better” but I didn’t really know much about it and therefore didn’t know how to take advantage of it.
My initial search wasn’t promising. A lot of advice was to just reinstall Windows. But I just reinstalled Windows and got all of my programs back up and running the way I like them a few months ago. I did not want to repeat the process again so soon.
It turns out there is a way to convert to UEFI, but it’s not something officially supported (nor is it all that easy). I wound up following these instructions and they worked just fine for me (but seriously, don’t skip any steps; make a backup and a system recovery disc or whatever you need in case of disaster). I had to finagle my partitions the way the instructions said they needed to be first, but otherwise had no trouble.
Next time I rebooted I went into the BIOS settings and disabled all the legacy BIOS support stuff. That should keep this from happening again.
I also noticed that after POST completes I don’t see the Windows logo with the loading spinner. I see my motherboard’s logo with the loading spinner. Apparently that’s a feature of UEFI mode with Windows 10 so OEMs can customize the boot experience. Huh.
So, Windows 10 is booting in UEFI mode and there doesn’t seem to be any problems. Now what was I trying to do again? Oh yeah, install Ubuntu. I booted from my USB drive again and went through installing Ubuntu with pretty much all of the default options. This time I didn’t run into any warning messages, great!
On my next restart I noticed that my keyboard wasn’t working during POST or when the GRUB bootloader was waiting for me to choose my OS. After a few minutes of switching USB inputs for my keyboard and restarting each time I finally gave up and shut off my PC. A couple hours later I turned my PC back on and my keyboard just worked (in its original USB input, no less). So apparently I needed to actually power off the PC after installing Ubuntu (until then I had just been doing restarts) to get the keyboard working again. So weird.
With a functioning keyboard, I was able to boot into Windows again. Unfortunately I noticed that the clock was wrong. After restarting and going into my BIOS I confirmed that the hardware clock was in fact reading the wrong time.
As it turns out, Ubuntu expects the system clock to be in UTC time, so when it boots up and checks the internet for the current time, it sets the hardware clock to UTC time and internally converts that to the local time before displaying it in the OS. As a result, the next time Windows boots it reads the hardware clock and expects that to be the local time, and therefore displays UTC time as if it were the local time. Of course, Windows will eventually check the current time on the internet and reset itself and the hardware clock back to local time.
However, I didn’t want this tug-of-war between OSes every time I switched, so I found a solution. I ended up configuring Ubuntu to expect the hardware clock to be in local time because it seemed like it could handle that change better than trying to tell Windows that the hardware clock was in UTC time. Also, Windows is still my primary OS and I’d rather cater to it’s preferences than Ubuntu’s.
As a last tweak, I set GRUB to boot to Windows by default following these instructions. This way my primary OS will boot without my explicit intervention.
So, after overcoming a video driver issue, a weird kernel error, a stubborn partitioning problem, a UEFI vs. legacy BIOS battle, a mysterious keyboard input failure, dualing OS clock philosophies, and a quick GRUB configuration, I finally have a Ubuntu/Windows 10 dual-boot setup that is working just fine (so far).