Computer

How to install Windows after Ubuntu in dual boot

How to install Windows after Ubuntu in dual boot

If we talk about virtualization solutions, today we are truly spoiled for choice. Windows 10 and Windows 11 even include the Windows Subsystem for Linux (WSL) which allows you to run Linux in Windows, in a window and with the possibility of calling up the penguin applications from the Start menu of the Microsoft operating system. The traditional approach to have installed systems boot directly on top of the physical hardware is to use dual boot. This is a practice that allows you to decide, when starting the machine, whether to run Windows or a Linux distribution.

How to install Windows after Ubuntu

Suppose you have already installed, on your system, Ubuntu. How can I add Windows in dual boot?

In the indications that we propose below, and which we invite you to read in their entirety before applying any changes, we refer to a modern system based on UEFI BIOS, with a GPT partitioning.

The first step is to create a complete backup of the system contents for precautionary purposes. As a second step, you must equip yourself with a Bootable USB media containing the Windows installation files. To create it, you can use the Media Creation Tool provided by Microsoft for Windows 10 (click on Download the tool now) and for Windows 11 (click Download now in the section Creating Windows 11 installation media).

For this purpose, you can use a functioning Windows PC to prepare the bootable media or create a bootable USB stick with Ventoy on Linux: storing the ISO file of the Windows installation media in the Ventoy partitionyou can boot.

Create bootable installation media with Ubuntu

In addition to the bootable media for installing Windows, you need to prepare a second one USB pendrive with the Ubuntu ISO image, distribution already installed on the system.

To do this, just start the Boot disk creator integrated into Ubuntu: just open the applications menu of the known distro and then perform a search with the appropriate bar. In the Disk image box of the utility, you must specify the ISO file of the Ubuntu image that can be downloaded from the official website.

Also in this case, the drive identification letter corresponding to the USB stick to be used as destination must be indicated.

Boot the system from the USB stick with Ubuntu and make room for Windows

Why did we create a USB stick with the Ubuntu image? Because by booting the machine from this medium, you can access a convenient utility for disk partitioning which helps make room for the Windows installation.

Specifically, after setting the correct boot sequence in the BIOS (first USB drives then hard disks and SSDs), you must click on the button Try it for free to start the version live of distribution.

Dual boot Windows dopo Ubuntu

By launching the application Discs, you must take care to select the main disk drive already containing the Ubuntu installation. In the partition diagram, just click on the largest Ubuntu partition then use the small gear button to choose Resize.

Resize Ubuntu partition

On the screen of partition resizing, you can make some space for the next Windows installation. However, the advice is to keep sufficiently far away from it Minimum size, to then avoid having space problems with Ubuntu. The block available for Windows will subsequently be highlighted as “free space“.

Free space Windows on Ubuntu Linux system

Install Windows in free space

The next step is to reboot your machine using, this time, the bootable stick containing the files for installing Windows.

After choosing the language, time zone and keyboard layout, you can start installing the Microsoft operating system, but be careful to select thecustom installation. Once you accept the license conditions, you must choose “Custom: Install Windows only (advanced option)“.

Custom Windows installation

On the screen Where to install Windows?, you have to choose it unallocated space previously freed by resizing the main Ubuntu partition.

At the end of the installation, after restarting the machine, the system will reboot directly into Windows 10 or Windows 11 completely ignoring the presence of Ubuntu.

How to restore GRUB to boot both Windows and Linux

GRUBacronym for GRand Unified Bootloader, is a very popular bootloader used mainly with GNU/Linux operating systems. The memory-loaded bootloader provides a user interface through which this is possible select which operating system boot, if there are more than one installed on your system. This is especially useful in dual boot setups, when you have more than one system installed on the same computer.

Additionally, GRUB provides advanced features such as support for loading kernels and configuration files, as well as the ability to boot the system in different modes, such as recovery mode or debug mode.

By accessing the UEFI BIOS of the PC in use again, it is necessary to intervene on the boot sequence and specify that the system must load Ubuntu first and then the Windows Boot Manager (if the latter were the first choice, Windows would always boot directly).

Once back in Ubuntu, you should open a terminal window and type the following to update the GRUB configuration:

sudo update-grub

By doing so, GRUB should recognize the presence of Windows (or rather, of Windows Boot Manager) adding an entry among those directly supported for booting the system.

If the detection does not occur, we suggest opening the file /etc/default/grub and add the following line:

GRUB_DISABLE_OS_PROBER=false

At this point, after saving the change, the GRUB bootloader should finally allow both Windows and Ubuntu to boot.

Opening image credit: Copilot Designer.

Leave a Reply

Your email address will not be published. Required fields are marked *