I’ve been using WSL for running Linux-only software and it works really well, but there are cases (especially when graphical output is needed) where a native Linux system is required. Lately I’ve taken advantage of the low SSD prices to upgrade my desktop PC from a single 1 TB SATA SSD and 4 TB HDD to two 2 TB Nvme SSDs and a 4 TB SATA SSD. This has freed the 1 TB SSD, the former Windows system disk, for installation of Linux.
Choosing a distribution
Despite all the criticism and ridicule this advertisement caused back in 2004, there is a slight point to it:
I used to be a devoted SuSE/OpenSuSE user, starting with SuSE 6.1 back in 1999. SuSE was probably the #1 distribution in Germany at the time. On my laptop, I used Mandrake, another RPM-based distribution. But on the Sun UltraSPARC 10 that I used as student assistant, Debian was the only option. Debian had and still has a reputation of being for power users only, but it worked just fine and the beauty of a simple apt-get update && apt-get upgrade on the command line was unmatched by the RPM-based distributions.
These days, the closest thing to a mainstream or default distribution is Ubuntu. Most software packages and research projects provide installation instructions for Ubuntu, and I use it on WSL and my VMs as well. It is Debian-based and hence offers the same ease of installing and updating software with apt. I’m however not a big fan of the Gnome desktop since I’ve been a KDE user from the very beginning. So this time I chose Kubuntu, which is Ubuntu with the KDE desktop, in version 23.04.
Installation
I downloaded the Kubuntu ISO using Bittorrent and wrote it to a USB stick using balenaEtcher. The one thing you need to think about before installing Linux is where to install it. It is possible to shrink existing Windows partitions (assuming there’s space available), but you can make life easier for yourself by using a dedicated drive. As written above I had a 1 TB SATA SSD available and chose this as installation target. This also means that the GRUB bootloader will be written to this disk. There are then two options to boot either Windows or Linux:
- By using the BIOS boot options to choose either the Windows or Linux drive (F8 on my Asus mainboard) – this is the option I took, with the Windows drive being the default, as Windows is what I want most of the time.
- By choosing the Linux drive as default in the BIOS, and then using GRUB for choosing Linux or Windows. You can set either as default.
During the installation, you get the option to install proprietary drivers (which is required to get e.g. the official Nvidia drivers) and choose between a minimum and full installation. Since this will be a system for data science and machine learning, I chose the minimum installation since I don’t need any office or multimedia software. The installation went quickly, and the ease of installation is a far cry from the old days of manual drive partitioning and fiddling with drivers.
Once the installation is competed and you are logged in, a sudo apt update and sudo apt upgrade will make sure that everything is updated.
Further setup steps
The first thing that you might notice is that Linux changes the system time. By default, Linux runs the hardware clock on UTC whereas Windows uses local time. It’s probably easiest to tell Linux to also use local time, which is achieved with sudo timedatectl set-local-rtc 1
Windows cannot access Linux drives, but Linux has no problem with accessing NTFS. So if you want to set up a drive for data exchange between Windows and Linux, it should be NTFS. You can mount them either manually through the file manager or automatically during boot, as explained here.
If you want to access the Linux drives and possible other drives on this computer over the network, you need to install and configure Samba. This is also explained in the Ubuntu help.
I had issues with slow download speeds – which I could not verify in the web browser, but with the command line tool speedtest. I managed to solve this by installing a new driver. I also had to use the Power Management settings to prevent the system from being put to sleep after 15 minutes of inactivity, as this computer often processes data while unattended.
I always use Remote Desktop to access this PC from my laptop, so I wanted to be able to also do this when in runs Linux. This is possible by installing xrdp. Behaviour is different from Windows though: In Windows, there’s only one desktop session that can be accessed either locally or remotely. Linux on the other hand is a true multi-user operating system, but xrdp has some limitations out of the box. It’s not possible to log in remotely while there’s an active local session. The remote session is also separate from the local session, so even if you log out locally, you’ll end up in a different session. There seem to be workarounds, at least when running Gnome, but I haven’t found one yet for KDE. At least when you disconnect and reconnect through Remote Desktop, you are back in the same session.
One thought on “Setting up Windows/Linux dual boot”