Linux & Windows Dual-Booting: Essential GRUB and Time Settings

If you dual-boot Linux and Windows, I consider these two things to be essential to be done. I’ve been doing them for a while and decided it was worth posting on the blog as recommendations to others.

GRUB: Remember Last Used Option

First, I feel it is best to have GRUB remember the last chosen boot option. If you don’t agree, simply don’t do this and your system will always boot into the first option (0), which is going to be populated by whatever Linux OS you used to install GRUB onto the PC.

The biggest reason why I prefer to do this is because most Windows updates typically require reboots. Some actually end up performing multiple reboots as the updates are applied. When I run Windows updates, I almost always find something else to do to bide my time, as they’re rarely ever snappy, and if I have to manually select the Windows boot loader in GRUB during each of those reboots that might happen, things are delayed even further. I can’t say how many times I had to reboot out of Linux and back into Windows to finish updates because of this. So, this resolves that issue.

Typically, the GRUB configuration is at /etc/default/grub, and this must be edited with either root or super-user privileges. By default, the following setting is defined as:

GRUB_DEFAULT=0

You can edit that line as part of the following changes, but I typically just comment it out by placing an octothorpe symbol (#) in front of it, and then add my changes directly above before saving/exiting the file:

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
#GRUB_DEFAULT=0

Lastly, after you’ve saved your changes, update the GRUB configuration with:

sudo update-grub

Done.

Time Configuration: Use Local Time

I consider this one an essential for everyone. Other sites have done a much better job explaining why this happens than I can do. However, I will summarize and just say that Windows stores the local time into the hardware clock and pulls that time directly to show you on your desktop. Linux, instead, stores UTC time and then applies the offset to it dependent on what your local time-zone is. For me, it’s UTC-5, and so if I don’t do this, Windows ends up telling me the time is 5 hours into the future each time I boot into it after booting into Linux (until I go into Windows and tell it to update the time online). But then Linux shows me the time as 5 hours in the past until it’s been updated. The whole process repeats with each OS boot change.

From what I’ve gathered from searching online, this can be remedied by either making Windows use UTC time or making Linux use Local Time. Because I don’t care to edit Windows registry entries anymore than I have to (and it’s apparently the only way to change this in Windows), I chose to make the change in Linux, instead.

If you enter the following command, you’ll get the time/date settings and information on your Linux system:

timedatectl

If you’re ready to change Linux to using Local Time, you can do that and update the hardware clock all at once with the following command:

timedatectl set-local-rtc 1 --adjust-system-clock

Done. From here on out, Linux will store Local Time in the system hardware clock.

I hope this is of some use to others. This info is in numerous places online, but I felt the need to include it on my blog, especially together.