IoT 7: Dual-boot Windows and Ubuntu on One Computer
Last Updated on January 10, 2021
In holidays, I set to dual-boot Windows and Ubuntu, a Linux distro on my computer. On my home recording, GUI applications run on Linux, such as Audacity and QjackCtl, are needed. WSL (Windows Subsystem for Linux) is useful, but it's not for these GUI applications. Here are methods on the procedure. In the procedure, I assume that Windows has been installed in advance before Ubuntu. I made the installation media on Windows.
0. The procedure as below makes possible removing Windows and your data. First of all, you backup your data to other media. If possible, clone all, including Windows, in your internal media to another one, e.g., a SSD.
1. Download Ubuntu Desktop. I recommend that you use a long term support (LTS).
2. Make an installation media, such as a 16GB USB flash drive, etc. I used balenaEtcher to make the media.
3. Boot your computer with the media. You need to change the setting on BIOS to boot with the media, but not your ordinal boot media such as SSDs or HDDs.
4. Ubuntu Installer starts. Ubuntu automatically detects pre-installed OS, i.e., Windows, and prompts how to install Ubuntu. Don't remove Windows anyway. Select an option (it's first one as of today) to keep Windows and make partitioning for Ubuntu automatically
5. After the completion of the installation, your computer shows Grub menu when you power on the one. You can select Windows or Ubuntu to boot.
6. If you want to start Windows on default, you need to change the setting for Grub. You note the number for Windows (in my case, "Windows 10") in the list of Grub.
sudo vi /etc/default/grub
# Replace the number for "GRUB_DEFAULT=" from 0 (first one in the list, i.e., Ubuntu)
# to the number for Windows minus 1, then save.
7. When you boot Windows, you may face the strange clock. This because of Linux system stores Coordinated Universal Time (UTC, equaling to Greenwich Mean Time [GMT]) that is fetched from a NTP server to the real time clock (RTC) in your computer on booting. Whereas, Windows uses the local time for RTC. To hide this glitch, you turn off updating RTC in Ubuntu. Note that RTC is a clock which is shown on BIOS menu and is driven by an internal button cell.
# Let Ubuntu recognize RTC as the local time of the area you selected.
timedatectl set-local-rtc 1 --adjust-system-clock
# Turn off updating RTC using a NTP server on booting.
timedatectl set-ntp 0
# Verify conditions. "NTP service: inactive" and "RTC in local TZ: yes".
# "System clock synchronized" status becomes from "yes" to "no" after restarting.
# Then in Windows, adjust clock.
To adjust clock in Windows 10, right click time and date in the taskbar and left click "Adjust date/time". Then click "Sync now" in "Date & Time" menu. If you can't see the button, turn off "Set time automatically" and turn on again. "Date & Time" menu can be displayed by Windows button > Settings icon > Time & Language.
1/0 on each command as above seems to be substituted by true/false and on/off.
8. On exchanging files between Windows and Ubuntu, you'll see timestamps on files are offset on each OS. FAT32, a file system, is compatible between Windows and Linux system, but FAT32 doesn't store UTC+- conditions in timestamps and recognizes timestamps only as the local time. Whereas, Linux system store UTC+- conditions in timestamps and recognizes timestamps of files imported from FAT32 as UTC+-0. For example in Ubuntu, if you stay in the UTC+5 zone, the modified time of files imported from a media formatted by FAT32 are added 5 hours from the time you actually modified in Windows. Linux system timestamps on UTC+-0 basis, and the time for files are subtracted 5 hours from actual modified time on your local area. In my experience, this difference is fixed by the method No. 7 as above.
9. On ejecting a USB flash drive in Ubuntu, you need to click the unmount button on the media icon in "Files", and wait for displaying the message to eject safely ("... Device can be removed"). Otherwise, a dirty bit is flagged in the USB flash drive, and Windows detects an error on the USB flash drive.
* In fact, I want Raspberry Pi 4 as a Linux machine. However, after I saw Its founder's letter and Amiga on Raspberry Pi, I decided to wait to buy it. Basically, I think, it's a great tutor for wide-ranged code learners. I think UK should sell its rock music or any other software/system. By the way, Amiga is a great gaming machine and the leader of 80's to 90 's Otaku culture in Akihabara. Amiga's advanced technology for graphics makes Otaku people become pioneers of Anime on computers. Even though almost Japanese selected domestic machines, Otaku people utilized Amiga to surpass the technology for "common" people.
10. To become Otaku people, the first step is to utilize Japanese language. Left click upper right corner to show a menu, and select "Settings". Then on "Region & Language", push "Manage Installed Languages" which shows "Language Support" menu. On the menu, push "Install / Remove Languages", check Japanese in the list of "Installed Languages" menu, and push "Apply". After authentication, wait for the installation of the language. If you confirm the completion of the installation, close "Language Support" menu and restart Ubuntu. Back to "Region & Language" menu, and push "+" button at "Input Sources". On "Add an Input Source" menu, select Japanese, and select "Japanese (Mozc)" in the shown list. You can change the input method by the language icon on the upper left side. Windows/Super key + Space key also changes the input method. 半角／全角 key in Japanese keyboard (or Alt key + ~ key in American keyboard) toggles modes, kana (Hiragana) or direct (Latin "Alphabet") input. Note that Ubuntu Wayland (20.04) doesn't show the language icon to select methods and modes.
11. Applications I described for Raspberry Pi OS can be used because both Ubuntu and Raspberry Pi OS are based on Debian. Ubuntu can command "snap" that is a new application packaging system that is no need of dependencies. However, "snap" is now for few applications, and you can check its available list by commanding "snap list" in the terminal. Basically, you use "apt/apt-get" in the terminal or GUI tools for the installation in Ubuntu.