Installing Ubuntu on a ThinkPad X230

Installing Ubuntu on a refurbished Windows-running PC can prove tricky. In this guide, I outline the steps I took to successfully install Ubuntu 18 on a Lenovo Thinkpad X230 running Windows 10. Hopefully, this guide helps you plan and troubleshoot your own installation, even if your hardware and software mix are different.

In my case, I had what had been a Windows 8 machine that had been upgraded to 10 by the refurbished ThinkPad vendor, so this added a few twists you might not encounter if you have a newer ThinkPad that was shipped with Windows 10.

1. Check BIOS Mode

First, you’ll want login to Windows to prepare your machine for Ubuntu installation.

The first task is to ascertain if your BIOS is legacy or UEFI.

BIOS (basic input/output system) is a factory-installed program for a PC’s CPU that gets the computer system started after you turn on the power. For our purposes, it is important because it manages initial data flow between the computer’s operating system and attached devices such as the hard disk and USB drives. BIOS is what helps load the actual operating system, and so we want to be able to divert the typical flow of BIOS into Windows to allow us to install Ubuntu.

As it turns out, there are different flavors of booting software on Windows PCs. There is the aforementioned BIOS, as well as its planned replacement, which is named Unified Extensible Firmware Interface (UEFI). You can read more about BIOS here.

To find out how your machine is setup, press Win + R to call up the Run Box. Type msinfo32 and then hit Enter.

Look for BIOS Mode entry in the system information window. There you will see information and an entry about the BIOS MODE and you are looking for Legacy or UEFI.

Depending on the mode you have, you’ll take different steps to get Ubuntu properly installed.

My ThinkPad came with a Legacy BIOS, and so I had to adjust the instructions I found scattered throughout the internet, many of which assume UEFI, to conform to this constraint.

2. Disable Fast Boot

Windows 10 has a featured called Fast Startup. Its intent is to speed up the booting process through a more sophisticated hibernation approach. Unfortunately, this feature does not play nice with dual-booting and some of the other things we have to do to get Ubuntu going (you can read more about that here).

Fast Startup was one of the obstacles during my installation attempt, so if you have a similar hardware/software setup as mine, you should strongly consider disabling it from the start while you are still in Windows after checking your BIOS mode.

Here’s how you disable Fast Startup.

Go to Control Panel > Hardware and Sound > Power Options.

In the Power Options window, click Choose what the power buttons do. Then you will see a new set of power-related system settings.

You’ll need click Change settings that are currently unavailable to make the Fast Startup option available in order to edit it.

Now uncheck the Turn on fast startup box, and then click on Save changes.

That click will disable Fast Startup.

3. Prepare partition

Now we are going to make a dedicated space on the machine’s disk for Ubuntu, as well as the application and files we will be using/creating with it.

According to the Ubuntu requirements page, you need 25GB of hard-drive space at a minimum. I was looking to make my ThinkPad an almost fully Ubuntu-focused personal computer, so I actually wanted to dedicate as much as possible to the Ubuntu partition.

To create the partition, start by pressing Win + R and then enter diskmgmt.msc to open the Disk Management utility.

How you proceed depends on how your disk drive is currently organized. In all likelihood you have a C: drive, though you might also have a D: or even E: drive depending on what you’ve been up to on your machine. Common advice found in Ubuntu dual-boot install guides is to shrink the last partition you created so as to avoid tinkering with whatever the OEM shipped (e.g. the C: drive). The general idea is that we want to shrink existing partitions to make space for your Ubuntu environment.

Now, my X230 had a C: drive representing a 320 GB hard disk.

To make these changes, right-click on C: and then select Shrink Volume to resize the partition and create free space for your Ubuntu environment.

Enter the amount in MB and then click Shrink to begin the shrinking operation. So, To get a 25GB free disk space on a 100GB partition, you would need to enter 25000 and then click Shrink.

The change might take a few minutes. Eventually you’ll see an entry on your drive’s row with an Unallocated Space label. This space is freed-up as a result of the shrinking process. The cell created by the shrinking eventually lost the Unallocated Space label once I installed Ubuntu, but whenever you go back to Windows you can tell by visually scanning for the cell with the GB partition size you submitted.

After your new space is created, you will need to check the partition style of your drive. This will come in handy for creating the bootable USB stick, as well as certain kinds of trouble-shooting for some of the remaining steps.

Right-click on the disk cell (Disk 0 for my C:) to bring up the disk properties menu and then select the Properties option.

Once in the Properties view, click on the Volumes tab to find the Partition Style. My X230 has a Master Boot Record partition style. Make note of your style as you will need it later.

One last thing before we move on from creating your partition: the actual size of the space available on your drive.

When I kept adding up the GBs reported, I was disappointed by the shrink space available that the Disk Management utility communicated. I assumed that the 320 GB drive would have nearly that amount of space free for either Windows or other uses. In my simplistic view, I expected disk space to add up to the drive’s marketed capacity Well, it turns out that Windows needs a lot more space than what is being transparently kept on the drive. Read more about this here.

Depending on your needs, you might not be interested in squeezing every last GB of disk space. Since I was creating an Ubuntu-focused laptop that I would be frequently using for development tasks, I did want to make sure to get every GB I reasonable could. However, after understanding a bit more about Windows, I decided to skip tinkering since the 150GB for Ubuntu seemed good enough for the tasks I would be undertaking. If you are interested in additional details because you are curious or want to see if you can free up more space, you can read a bit more about Windows Disk Management here.

4. Prepare bootable USB Stick

To install Ubuntu, we have to boot up the X230 with a USB Stick containing the version you want to install. You can check the official tutorial on how to create a bootable USB disk from Windows or follow the summary I provide below.

Start by getting an ISO File of the Ubuntu version you want to install, which in my case was 18.04. In case you are wondering, the name ISO comes from the name of the file system used by optical media: ISO 9660. An ISO is an archive file that contains an identical copy (or image) of data found on an optical disc, like a CD or DVD.

You can download the Ubuntu 18.04 desktop image from the Ubuntu desktop download website. Choose the current LTS (Long Term Support) release. Also download Rufus.

Once you have both of these downloaded, you are ready to write your bootable USB stick. Follow these steps:

  1. Launch Rufus

  2. Insert USB

  3. In Rufus, select the USB you want to be the bootable stick.

  4. Select FreeDOS as the Boot selection option

  5. Select your partition scheme. Mine was MBR.

  6. Select the Target System. My X230’s BIOS Mode was Legacy, so I choose BIOS

  7. Click the SELECT button and navigate the file system to find your downloaded Ubuntu ISO file.

  1. Click START to write the bootable USB stick. This will take a few minutes.

  2. Once the Status section flashes a green READY block, you are done.

Your write process might have some bumps. Check the official tutorial for some troubleshooting tips.

5. Clean up messy disk data

After repeated attempts at following the normal installation process, I kept hitting a wall because the stick-booted Ubuntu installer environment would not show the disk’s partitions that were present in Windows, making it unclear with how to complete the installation.

After much exploration of Ubuntu forums, it seems there was some cruft on the drive that confuses the installer, potentially as the result of its MBR partition style.

MBR (Master Boot Record) and GPT (GUID Partition Table) are two different ways of storing the partitioning information on a drive. This information includes where partitions start and begin, so your operating system knows which sectors belong to each partition and which partition is bootable. This is why you have to choose MBR or GPT before creating partitions on a drive. GPT is the new standard and is gradually replacing MBR.

You can read more about MBR and GPT here.

The eventual solution to the partition cruft came from the following recommendation. Here are the steps:

  1. Boot with your USB stick

  2. In the terminal while type sudo gdisk /dev/sda (change “/dev/sda” to whatever is appropriate to access your hard disk).

  3. gdisk should indicate it’s found both MBR and GPT data, and will ask which to use. I selected MBR.

  4. At the Command prompt, type x to enter the experts menu.

  5. Once at the Expert command prompt, type z to zap/destroy the GPT data.

  6. Type “y” to confirmation GPT data destruction.

  7. VERY IMPORTANT: Type “n” so as to skip MBR destruction. If you answer “y”, you’ll destroy your Windows partition. DO NOT DO THAT.

Once the partition cruft is removed, you can proceed with a normal installation.

6. Proceed with normal installation

Restart your X230 and press Enter to select the USB as the boot device.

When presented with the option to Try or Install Ubuntu, you should choose Install.

You will then be presented with an additional menu. You can choose a Normal Installation If you select this option, you will get a graphical desktop environment with all regular software.

Or you can choose a Minimal Installation – If you select this option, you will get a basic desktop environment with a browser and core system administration utilities.

You can optionally choose to install system updates and third-party software during this initial OS installation. This activity requires an active internet connection.

After that choice, you will select an installation method, which is the risky part of the process.

Installation type is the most important step in the Ubuntu installation. Here, select Install Ubuntu alongside Windows Boot Manager to install Ubuntu 18.04 along with Windows 10.

Do not choose Erase disk and install Ubuntu as this delete your existing disk data and install Ubuntu, potentially a dangerous move.

After you select the installation type, you’ll be presented with other intuitive options to setup your X230.

You’ll pick a username and password (applicable for sudo as well) for your user account. Also, set a hostname for your system and then click on Continue to start the installation. Once the installation is complete, you’ll need to restart the computer and select Ubuntu (now the default OS) from a startup menu to launch the desktop Ubuntu environment.

And with that, you’ve got Ubuntu running on your X230.