Dual Boot - Using Linux with Windows
Dual booting Linux with Windows is one of the most convenient way of enjoying the two operating systems on the same computer. You have both OS installed on the disk, on real hardware and when you power on your system, you can choose which operating system to use.
Last update: 2022-06-04
Table of Content
Installation#
Below guide can be applied for any common Linux distro.
Download an ISO image#
Download the latest Ubuntu Desktop version from https://ubuntu.com/download/desktop, or visit https://old-releases.ubuntu.com/releases/ see the list of prebuilt images for older versions.
Create bootable USB#
USB boot is created using Rufus.
Boot from live Ubuntu USB#
Press F2
or F12
or any special key mentioned in BIOS guide to change the boot device.
Start installing Ubuntu#
The first few steps are simple as it guides to choose the language and keyboard layout.
Installation Mode
There are two installation modes:
-
Normal mode
All pre-built and packed things will be installed. This mode has smallest installation time
-
Minimal mode
All pre-built and packed things will be installed, but many extra packages (office, tools, etc.) will be uninstalled (using apt) to create a lightweight version. Due the un-installation, this mode takes long time to complete
No need to download updates or install third-party software just yet.
Select destination partition#
Most of the time, Ubuntu will automatically detect the pre-installed Windows and offer an option Install Ubuntu alongside Windows Boot Manager.
Using this mode, Ubuntu will do everything automatically, for example, it will create one partition then have /root
with /home
and a swap file of 2 GB in size under /root
itself.
One other option which is more advanced is Something else. In this mode, user has to create and assign mount points manually.
Change default boot order#
When booting up, Ubuntu will show a Grub boot menu for user to select the target OS. By default, Ubuntu will be listed on the top with index = 0
. Windows boot entry is located at the index = 2
:
Edit the grub by running:
sudo nano /etc/default/grub
Then change the default OS entry at GRUB_DEFAULT=2
to select Windows.
To reduce the waiting time to 2 seconds, edit GRUB_TIMEOUT=2
.
Update grub to apply the configuration changes:
sudo update-grub
Grub Customizer
This GUI tool is an easy-to-use application which can be installed by:
sudo apt install -y grub-customizer
Settings#
Fix Date time settings#
When using dual boot, after switching from and to an OS, the system time will not be the same. Sometimes, Linux shows correct time, but Windows does not.
This strange behavior is because of using internet with auto-update date time function.
A computer has two main clocks: a system clock and a hardware clock:
-
A hardware clock which is also called RTC or CMOS/BIOS clock. This clock is outside the operating system, on your computer’s motherboard. It keeps on running even after your system is powered off.
-
The system clock is what is shown inside your operating system.
When a computer is powered on, the hardware clock is read and used to set the system clock. Afterwards, the system clock is used for tracking time. If the operating system makes any changes to system clock, like changing time zone etc., it tries to sync this information to the hardware clock.
By default, Linux assumes that the time stored in the hardware clock is in UTC, not the local time. On the other hand, Windows thinks that the time stored on the hardware clock is local time. That’s where the trouble starts.
There are two ways you can go about handling this issue:
- Make Windows use UTC time for the hardware clock
- Make Linux use local time for the hardware clock
It is easier to make the changes in Linux:
timedatectl set-local-rtc 1
That’s simple as it is.