Over the past couple of days I’ve managed to install Linux Mint onto my Windows 10 computer. The last straw for Windows was when it advertised some story about how great Wetherspoons is to me when all I wanted to do was open some software. My computer also is prohibited by Microsoft from upgrading to Windows 11 (it is old…but runs Windows 10 just fine) so at some point in the possibly distant future I imagine that could have caused me a problem. I’d also like to move more and more towards open source software, at least for my personal computing.

Below is what I did. It didn’t go as smoothly as I’d hoped to be honest. I probably made it more difficult than I needed to for myself to be fair, and Windows played tricks on me too. But in the end it seems to be working well I’m writing it here in case I need to do it again or someone else encounters the same obstacles.

So there are various ways you can install Linux Mint on a computer that currently has Windows on it. That includes starting afresh, deleting everything you already have, Windows and all, and going 100% Linux. You can also use Linux Mint inside Windows using a virtual machine without having to do anything to Windows - it acts just like another piece of software you install in Windows, but has the obvious memory and processing overhead of having to run Windows and Linux simultaneously. You can also use it entirely from a USB drive. But I chose to go with probably the trickiest of options dual-booting.

The idea here is that in the end what should happen is that each time my computer turns on it gives me a menu letting me choose whether I want to use Windows or Linux. I thus can choose between Windows and Linux each run and they’ll act independently of each other. The natural cost is that you need to dedicate a certain amount of disk space to both operating systems and any files you want to use in them - but it’s better than having to buy a whole new computer. It’s also proved more tricky to set up than I imagine the other options would have been, although I do lay some of the blame at Windows' feet whilst sucking up a decent chunk of it as being down to my own ignorance.

Get and validate the Linux Mint install software

Step 1 was to download the ISO file containing the Linux Mint image I wanted to install. I went with the “Cinnamon 64bit” version. Also get the sha256sum.txt and sha256sum.txt.gpg files from relevant Linux Mint download page (this was the edition I used) which lets us verify the integrity of the ISO file later.

Once downloaded, verify the file by comparing hashes. I only had access to Windows so per these instructions I downloaded GnuPG - the “Simple installer for the current Gnu PG” from here.

Then to check the integrity if the ISO:

Open a command prompt (PowerShell) in the folder I downloaded those to and ran CertUtil -hashfile linuxmint-21.2-cinnamon-64bit.iso SHA256

Check that the results matched the sha256sum.txt file.

To check authenticity:

Run gpg --keyserver hkps://keyserver.ubuntu.com:443 --recv-key 27DEB15644C6B3CF3BD7D291300F846BA25BAE09

Then: gpg --verify sha256sum.txt.gpg sha256sum.txt

And check that the output says “Good signature from “Linux Mint ISO Signing Key root@linuxmint.com” and the primary key fingerprint at the bottom matches the 27DE…. code from the first gpg output. Don’t worry about the warning about the key not being certified.

Make a bootable Linux USB stick

Now we need to to make a bootable USB stick from the ISO image. First find a USB disk you don’t mind emptying out as this will remove any existing files on it. After that, here are the instructions. For Windows they suggest you install Etcher. I downloaded Etcher for Windows Portable Edition but presumably any should work.

In Etcher, choose to “Flash from file” and select the ISO image you downloaded in the first step. Then “Select Target” to choose your USB drive (after plugging it in, and remembering that you’ll lose any data on it). Then select to flash the drive and wait a few minutes until it’s finished.

Prepare disk space for Linux to install to

Next up we’ll need to create a partition for Linux Mint to install to. Probably your disk is already partitioned 100% for Windows. I needed to reduce the size of the Windows partition and create a new one with space from Linux.

Although the instructions for Linux Mint read to me like you can do this during the Linux Mint install process, most of the info I read on the internet suggested to do it first in Windows, with the Windows specific tool, given you’re messing around with a Windows partition. This is “fiddling around with hard disks” type stuff, so everyone recommends that you back up anything important before doing it just in case either you or Windows does it wrong and lose it all.

Then I did the below:

  • Open the built-in app “Disk Management” in Windows - one way to get to this is open the Start Menu and start typing “Disk Management” until the option to “Create and format hard disk partitions” comes up.
  • Right click the disk you want to “shrink” in order to make a Linux partition. For me this was the one labelled “C:”.
  • Choose “Shrink volume”
  • It asks you to input the “amount of space to shrink” in MB. I decided to give Linux 100GB to use for now so typed in 100000 and clicked “Shrink”.
  • A while later the Disk Management screen updated to show a 97.66GB unallocated space. Seems like I should have remembered that 100000 MB doesn’t necessarily equal 100 GB if I wanted rounder numbers. But this will do for now.
  • Note that of course whatever you “unallocate” here won’t be accessible to Windows. So you need to have a decent amount of free disk space to go this dual boot way.

Reboot from your USB drive

Now it’s time to boot up the bootable USB we created and install Linux into this free space.

First I checked the BIOS to make sure my computer could boot from a USB. For my old Sony laptop this meant turning it off and then holding down the special button marked “ASSIST” and choosing “Start from media”. For most less weirdly proprietary computers I think that’s usually case of looking at your BIOS settings to make sure your computer is set to boot from USB drive before your hard disk and then rebooting it.

Start it up again with the USB drive you prepared earlier plugged in. If you set the boot options correctly you will get a menu. I chose ‘Start Linux Mint 21.2 Cinnamon 64-bit’’'.

Start the Linux Mint installation wizard

After a few minutes and some slightly scary looking error messages I ignored it loaded up to a Linux Mint desktop. I double clicked the Install Linux Mint icon.

In the subsequent wizards, select your language, keyboard. I chose the option to ‘Install multimedia codecs’ which meant I had to configure secure boot by choosing a password as I apparently have UEFI secure boot enabled.

I think this stage later gave me problems. I’m not 100% sure this is why but I read somewhere that your keyboard will effectively be in US mode at the time of needing this password. So if you have a non-US keyboard then you might want to make the password pretty simple and not full of special characters. Letters and numbers worked for me. Note that you only need to use this password once.

Next up in the install wizard, I chose “Install Linux mint alongside windows boot manager”. A message popped up explaining what changes it was going to make. It wasn’t all that helpful. But I think it did everything OK. There is a “Something else” option if you prefer to try and manually figure out / exert some control your partitions. Most internet guides seem to recommend that, but I must admit I did the “install alongside” option.

Next up I chose my time zone, and chose a username, password, computer name and chose to encrypt my home folder. This password is the one you’ll use to log onto Linux Mint every time so make sure you can remember it. The system then started to install.

I then let it restart the computer, removing the USB when it told me too.

Manage your MOKs (?)

A blue “MOK management” screen appeared. I had no idea what this meant. I think what I should have done was to choose the “Enroll MOK” which was the second option I was presented with, view the key and choose to “Enroll key”. The password is the first password we recorded above, the one to do with the multimedia codecs.

However I had little idea what any of this meant so by the time I got to it it had timed out and automatically picked the first option which was to continue the normal boot process. This loaded up Linux Mint but I’m led to believe this meant the multimedia codecs and maybe some other stuff wouldn’t work. You really want to enroll the MOK.

But it’s a one time prompt - reboot and you’ll not get a chance to enroll the MOK key again. Oh no! But there is a way to reset this and get the MOK key prompt to come back.

Getting the MOK enrollment screen to come back if like me you did it wrong the first time

Thank you to Philip from the 11th post here who documented that if you load up to Linux and type this into the command prompt:

sudo mokutil --import /var/lib/shim-signed/mok/MOK.der

Then the next time you restart you’ll get that option to Enroll MOK again. Running the above will ask perhaps for your “root” password which is the second one you selected above and then for you to define a new password. That’s the equivalent of the one-use first password we encountered above with the multimedia codecs. So probably make it fairly simple. It won’t affect the password you log onto your computer with. But it’s this one-use password you use to enroll your MOK.

If feeling particularly committed, this page describes a bit more about what these keys and commands are for. If your computer isn’t “blessed” with SecureBoot then you may not see any of this.

After that, all seemed well. Whenever I turned my computer on I could choose between Linux and Windows just like I wanted.

Connecting to the internet

At first the wifi didn’t work, but once I went into the built-in Driver Manager in Linux Mint and inserted my install USB key when prompted. It scanned, found my wireless card, and when I selected the only option it gave me other than “don’t use it” that all started working well.

When Windows forcibly takes over again

I was glowing with success only for a few minutes until Windows turned nasty….The first time I chose to load Windows it appeared to overwrite the startup menu where you choose between Linux and Windows. Apparently this is pretty normal. I guess Windows just can’t believe that you don’t want to 100% use it and its extremely undesirable Start Menu.

So whilst I’d successfully installed Linux Mint, after the first time I’d loaded up Windows I wasn’t given the option to actually use Linux ever again. Aaargh.

The internet has a vast array of frustrated users and posts with helpful suggestions about what lengthy thing you should type in to where to hopefully sort this problem out. But not a single one of the ones I saw quite worked for me. However they did provide enough clues that I think I eventually got to the bottom of it.

I can’t say I fully understand everything I did here, and it’s probably not very risk free for anyone with no backup, but here’s what worked for me in case I ever need it again. Honestly though, unless you understand it better than me I wouldn’t run it without having a great backup, a bit more research or an expert friend.

First up, you’ll need to get back into Linux however you can (remember you can most likely boot from your install USB if you’ve no other way). Then open the command prompt (aka terminal) and run:

efibootmgr -v

I got a list showing the partitions that could boot and thee order that they’d apparently do so in. One row for Windows and a couple for “Ubuntu”. One of these rows was my main Linux Mint install. The other is “grub” which is the menu system that lets you choose which OS to start when you turn your computer. Windows kept insisting on enabling itself and acting like it was first on the list no matter what I did whereas I needed the grub one to take precedence. The intuitive thing of “change the boot order to the order you want it to be in” did not help.

So I noted down the filenames each of these entries were associated withl- the parts starting: /File(\EFI\....

The Windows one in my case was the file: \EFI\Microsoft\Boot\bootmgfw.efi

The “grub” one was: \EFI\ubuntu\grubx64.efi

The Linux Mint one was: \EFI\ubuntu\shimx64.efi

Then, shutdown Linux, turn your computer off.

Reboot this time loading Windows (which is probably what will happen anyway given the issue we’re trying to solve here).

Open the Windows command prompt in administrator mode (which means to hold Shift and right click it and choose “Run as administrator” rather than simply double-clicking it) and type this mystical incantation into it:

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

Presumably if you saw something other than \EFI\ubuntu\grubx64.efi when you ran efibootmgr in the previous step then you should put what you saw relating to grub at the end of the bcdedit command rather than copying me exactly.

That said it completed successfully. And since then every time I restarted my computer it’s offered me the choice of which operating system to run exactly as it did before Windows greedily overwrote whatever I’d done in the first place.

If you decide you did want Windows to just load every time without prompting you could undo the above command by just specifying the Windows bootloader instead of the grub one I think:

bcdedit /set {bootmgr} path \EFI\ubuntu\bootmgfw.efi in my case.