Linux and Windows Dual-boot Quirks
I've been operating both Linux and Windows in a "dual-boot" configuration for the last ten years or so. With GRUB there is little overhead to switching between and managing various installations of Linux and Windows, allowing you to enjoy the best of both worlds.
However over the years I have encountered some funny quirks that come with this setup.
Time Keeping
The first issue I found after using both operating systems together is a discrepency in their system time. When running Linux the time would be correct but after rebooting into Windows, the time would be an hour ahead.
You could go into the settings for the clock and manually adjust the time, but as soon as you rebooted back into Linux and then back to Windows it would return the same discrepency in time.
After doing some research, this issue stems with how both systems interact with the computer's hardware clock (located on the motherboard). This component which is responsible for keeping time during a power off state on the computer. When the computer is powered the operating system then read the time from this hardware clock and use it to set the system time.
What the system does next is how Windows and Linux differ:
Windows: due to a design choice going back to the earliest versions, Windows reads and sets the hardware clock to the local time of the machine.
Linux: on the other hand Linux and its various distributions prefer to set the hardware clock to UTC (coordinated universal time) and then calculate the correct local time based on the timezone set for that computer.
The difference in how these operating systems interact with and manipulate the hardware clock results in the discrepency. For example booting into Linux first then the hardware clock will be updated to a UTC time value. Then switching to Windows it will interpret this UTC value as a local time value, which coupled with a timezone difference will adjust the system time forward or back. In my case being (GMT +1) it would set the system time for example to 9:00pm, when the correct time was 8pm (8pm +1).
The fix for this in the end proved to be quite straightforward, there are two approaches:
Configuring Windows to Use UTC: This involves editing the Windows Registry to create or modify the RealTimeIsUniversal
DWORD value under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation
and setting it to 1
. This change instructs Windows to interpret the hardware clock as UTC, aligning its behavior with that of Linux.
Configuring Linux to Use Local Time: For users who prefer to adjust Linux settings, the process involves telling the system to interpret the hardware clock as being in local time. This can be achieved with distribution-specific configurations, such as using the timedatectl
command (timedatectl set-local-rtc 1
) on systemd-based distributions.
Bluetooth Ache
A frustrating issue as a user of bluetooth headphone has been the necessity to re-pair the device every time I switch between Linux and Windows.
Due to the way Bluetooth devices securely connect to each other, they generate and exchange a unique set of keys. This is defined in the Bluetooth spec as a "Link key", and is a 16 byte long value, which presented as a hexadecimal presentation would look something like this.
8D:9F:3B:4D:5E:6A:7B:8C:9D:AE:BF:C0:D1:E2:F3:04
Note: this representation would be stored as binary format in the module of a Bluetooth device e.g. headphones, mouse, controller.
These keys are then used to ensure that devices can only communicate with other trusted devices. If a Link key is not present then a pairing request is refused until authentication has been started and has succeeded.
The issue with this pairing arises because both operating systems do not store their keys in similar fashion. Linux stores Bluetooth keys in its filesystem, generally in /var/lin/bluetooth
. However Windows uses its registry to store link keys. As a result both systems are unaware of the pre-existing keys created by each other.
There were multiple fixes in the end for this solution:
The first solution I tried was to install another Bluetooth controller. Buying an inexpensive USB adapter online, you can then set one of those modules to be enabled on Linux and another to be enabled on Windows. This effectively makes the same computer two different computers in the eyes of any Bluetooth device.
The only downside to this seamless approach is if you are limited with USB slots.
The second solution and my permanent one so far is to copy the Bluetooth link key from the Windows registry and add it to the Linux list of keys.
In my case I did the following:
sudo apt-get install chntpw
- Mount your Windows system drive in read-write mode
- To find the drive use
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
. Depending on how your dual boot is setup its usually the firstntfs
partition on the drive with/boot/efi
. Note theNAME
. sudo mkdir /mnt/c
sudo mount --read-only /dev/<NAME> /mnt/c
- To safely unmount the drive
sudo umount /mnt/c
- If you need to try a different drive or when finished all these instructions
- To find the drive use
cd /[WindowsSystemDrive]/Windows/System32/config
- on Windows 10 the root folder is "Windows", on Windows 7 it is "WINDOWS"
chntpw -e SYSTEM
opens a console- Make a note of which Bluetooth device MAC address matches which pairing key. The Mint/Ubuntu one won't need the spaces in-between. Ignore the
:00000
. - Finally, restart the Bluetooth service on your Linux system to apply the changes. This can usually be done with a command like
sudo systemctl restart bluetooth
.
(More info and source from the link below)
This solution has been working well so far, although one warning would be to make sure you don't accidentally repair your device on Windows, otherwise you will have to redo the process above again!
Worthy Mentions
Here are some other issues I have seen or experienced.
- Boot Loader Problems: Installing two OSes might lead to boot loader issues, where the system directly boots into one OS, bypassing the boot menu. This often happens due to the overwriting of one OS's boot loader by the other's. Fixing it typically involves repairing the boot loader using tools like GRUB for Linux. GRUB Repair Guide
- Partitioning Errors: Incorrect partitioning can lead to loss of data or an unbootable system. It's essential to plan your partition scheme carefully before installation. Tools like GParted can help resize and manage partitions safely. Partitioning Guide
- Power Management Problems: Dual-boot systems, especially on laptops, may experience issues with power management, such as hibernation or sleep. These issues are often due to differences in how each OS handles power states and can sometimes be resolved by adjusting power settings in the BIOS or UEFI. Power Management Tips
- System Updates Overwriting the Boot Loader: System updates, especially major Windows updates, can overwrite the Linux boot loader (GRUB) with Windows Boot Manager, making it difficult to boot into Linux. This can be fixed by reinstalling GRUB from a live Linux USB. Reinstall GRUB
All in all, if you are dual booting Windows and Linux then it can be assumed you have a base level of technical knowledge which can aid you in fixing these issues listed and many others I have not experienced. Google is your friend!