Install Windows after Ubuntu Linux in Dual Boot Mode

In this article we will see how to install Windows in dual boot mode on a computer on which Ubuntu is already installed. We will install Windows over Ubuntu. Then repair GRUB boot loader to access Windows as well as Ubuntu in dual boot mode. It is a common practice to install multiple operating system on a computer. Generally, users install Windows and Linux Operating Systems in dual boot mode on their computers.

In this article we are taking Ubuntu flavor of Linux Operating System. Each of these Operating Systems will act as a Host Machine. The system can load one of the operating system at a time. That means you can either load Windows or Ubuntu Linux at a time. We will install each of the operating system on a different disk partition. Generally, a user installs Windows first and then installs Ubuntu Linux after Windows. On successful installation, the user gets an option to choose one of the dual boot operating systems. User may choose either Windows or Linux from the boot menu to load the operating system. The user can also switch between Linux and Windows as per his requirement. He can restart the operating system he is using, select another operating system from boot menu and load it.

Normally, when a user installs Ubuntu Linux over Windows, things go fine. Whereas, if the user installs Windows over existing Ubuntu Linux, there are two problems:

The Ubuntu Linux is lost ! The boot loader menu is also lost !

The system is only left with Windows without any trace of Ubuntu. So, what to do if you want to install Windows over existing Ubuntu Linux? Or is it that we have to always go the other way around only? The answer is No. You can go either way. That means, either you can install Ubuntu first or you may install Windows first.

But what goes wrong when we install Ubuntu first and then Windows? The answer is that Windows Boot Loader overwrites the Linux boot loader. Since, the option to load Linux is lost in absence of Linux boot loader. Thus, the user is not able to load Ubuntu. So, we need to perform an extra step. The step is to repair Linux (GRUB) boot loader after installing Windows over Ubuntu Linux.

Let us see how to install Windows over Ubuntu in dual boot mode using boot repair in following simple steps:

Note : Ensure that you have backup your data saved on your system with existing Ubuntu Linux as it may be lost in case some error occurs during installation process.

Step 1: Free up some space from your hard disk for installing Windows after Ubuntu

It is possible that you may have single or multiple partitions on your computer. If you have a single partition then follow option ‘b’ below. Else, if you have multiple partitions then follow option ‘a’ below:

Option ‘a’ (Multiple Partitions):

If you have multiple partitions, let’s say you have two partitions. Then Partition 1 will contain Ubuntu Operating System and Partition 2 may contain some other user data. You can see the same in image below as an illustration:

You can shrink the partition containing data to free up space for Windows. But you cannot resize the partition containing Ubuntu system files. To resize second partition, open “Disks” application from Ubuntu application menu as shown in below image:

Follow below mentioned steps to resize the partition on which Ubuntu is not installed:

A. Select Partition 2

B. Unmount partition 2

C. Click settings icon

D. Select Resize option

E. Drag resize slider to free up appropriate space

F. Click ‘Resize’ button

The above steps are shown in below image as an illustration:

As a result of above steps, free space will appear after Partition 2 as shown below in green box:

Close the ‘Disks’ application on successful resizing and un-allocation of disk space for Windows OS.

Watch above process in Video: How to resize secondary partition and un-allocate space in Ubuntu

Option ‘b’ (Single Partition):

The method mentioned above will not work if your system has single partition. In case of single partition, the Ubuntu system files will exist on this single partition. While you are operating Ubuntu, the system files will be in use. Thus, the Disk volume will be busy. A busy disk volume cannot be unmounted. The system cannot resize a mounted or busy disk.

Thus, we need some external factor to boot from and resize the single partition on which Ubuntu Operating System exists. For the purpose, we will boot the computer from bootable Ubuntu Flash Drive and use ‘GParted’ utility.

If required, check out one of the following ways on how to create a bootable Ubuntu Flash Drive:

  1. On existing Ubuntu system using Startup Disk Creator
  2. On Windows system:
Boot from Ubuntu Flash Drive:

Once you are ready with bootable Ubuntu Flash Drive, insert it in the computer and restart the system. While the system is rebooting press F10 (or Del or F9 or F12 or Esc) to enter BIOS Setup. You may try other keys as per Make and Model of your machine to enter BIOS setup. Select USB Storage Boot as Booting Device from boot options. Save and Exit. The system will reboot again. While the system is rebooting press F9 (or Del or F10 or F12 or Esc) to display Boot Menu. You may try other keys as per Make and Model of your machine to display boot menu.

Select Flash Drive as Boot Device from the Boot Menu List and Hit Enter. Ubuntu setup will load from the Flash Drive. Click on ‘Try Ubuntu’ option from Ubuntu setup as shown in below image as an illustration:

Live Session of Ubuntu Linux will load from Flash Drive.

Run GParted application:

Open ‘GParted’ application in this live session from application menu. The GParted icon will be as shown in below image:

GParted will detect and display the Hard Disk with its capacity and the existing partition on it. Click on the partition to select it. Then, click on the ‘resize’ button as shown in below image:

Click on the ‘Resize’ button. A dialog box will open with options for resizing partition. You can resize the partition by entering either free space size or New size of partition in Megabytes. Alternatively, you may also use the slider to change the size of the partition as shown in below image:

Drag the slider to shrink the partition and free space as un-allocated space as per your requirement. Satisfy yourself with new size of partition and new un-allocated space freed from the partition. Then click on ‘Resize/ Move’ button as shown in below image:

The un-allocated space will be shown in grey color. We will use this un-allocated space to install Windows 10 on it. Click on ‘Apply’ button to save the resizing changes. The un-allocated space and ‘Apply’ button are highlighted in below image:

Click on ‘Apply’ to save the changes in the popped-up dialog box to save the resized configuration of the partition. Wait till all resizing operations are successfully completed. Then close the Gparted Application. Reboot the system. Remove Ubuntu Flash Drive from the Computer when Ubuntu live session prompts for it before system reboot.

Reboot computer to check disk changes:

The system will then boot from computer hard disk and load existing Ubuntu Linux system. You may login to Ubuntu system and check disk partitions. The above must have shrink the Linux partition. Also, it must have create an un-allocated space. The same is shown in below image in green box as an illustration:

Watch above process in Video: How to resize primary partition and un-allocate space in Ubuntu

The First step should be successful by now. You will be ready with an un-allocated space on your hard disk. We will use this space to install Windows 10 on it as a dual boot host system.

Step 2: Install Windows after Ubuntu on free un-allocated space

Boot from Windows Flash Drive:

Insert Windows bootable Flash Drive. Restart the system. Boot the system from Windows Flash Drive. Press F9 (or Del or F10 or F12 or Esc) to display Boot Menu. Select Flash Drive as Boot Device from the Boot Menu list and Hit Enter.

Note: Check out methods to create windows bootable Flash Drive on existing Windows. You may also check how to create windows bootable Flash Drive on existing Ubuntu Linux.

Windows 10 installation setup will Load from Flash Drive. On the Windows installer welcome screen select basic information such as Language, Time, Currency Format and Keyboard or Input Method. If you do not have any particular choice, proceed with default values and click on ‘next’ to continue.

Click on ‘Install Now’ button to begin installation process. The installation process will prompt to Activate the copy of Windows operating system.

It may be noted that Windows is not a Free Operating System. You will need to purchase a License to use it. The license can be purchased and activated later with Product Key provided during purchase. As of now, click on ‘I don’t have a product key’ to continue windows installation.

Special Note: Always buy Windows or any other software from authentic source only. You can always buy Microsoft Windows DVD online from Amazon directly from Microsoft account. If you wish, you may checkout available options for Microsoft Windows DVD online at Amazon.

Select the Edition of Windows you wish to use, ‘Windows 10 Pro’ is best suited for professionals. Accept the License terms and click on ‘Next’ to continue. Accept the Windows license by clicking the check box with label ‘I accept the license terms’. Then click on ‘next’ to continue.

Windows installer will inquire you about the type of installation you want? Since this will be a fresh installation, select ‘Custom Installation’ instead of ‘Upgrade’ from the installation type options.

Now, the most crucial step. Windows installer will ask you, where to install Windows?

Select Partition to install Windows:

As you can see in below image, the first partition i.e. Partition 1 on Drive 0 is primary partition with Ubuntu installed on it. Also, an un-allocated space (of 500 GB in this example) is available for use.

Select the un-allocated space and click ‘New’ to create a New Partition from this un-allocated Space for Windows installation. When prompted, click on ‘Apply’ and then ‘OK’ to create a new partition. Windows setup will create a system partition (approximately ~500 MB) and a user partition (Balance Space). The same is shown in below image:

Select the newly created Partition other than system partition and click on ‘Next’ to proceed for installation. The installation process will start. Wait till Windows setup files are copied and copied setup files gets ready for installation. The installer will install Windows features from setup files. If your system is connected to internet Windows may install Updates as well. Wait till installation process is complete.

Note: The Computer may automatically restart few times during the installation process. Keep the Flash Drive inserted in the computer. Do not press any key during system restart. Doing so may boot the system from Flash Drive again and fresh installation will start.

Configure Windows after installation:

After installation, the setup will continue to start services and ready the devices. The system may restart multiple times during configuration. When setup prompts, select your region, select the keyboard layout and add secondary keyboard layout. Else proceed with default options if there is no particular requirement. You may setup Windows for personal use and may add organizational details at a later stage, if required. If you have a Microsoft account ID you can provide it. Else proceed with offline account and create online account later. You may select one of the Microsoft group’s account for login. Else, click ‘No’ if no Microsoft Group’s account is available, you can add such accounts later.

Type your Name and click ‘Next’ to continue. Create a strong password followed by secret questions. Click on ‘Accept’ to designate Cortana as your Digital Assistant while you use Windows Operating System. Choose Privacy settings, else proceed with default options, if no particular choice.

Your Windows 10 Operating System will be ready for Use. Open File explorer to check disk partition. You will see C: Partition with available capacity. Also, open Disk Management in Computer Management to check Disk Partitions. All disk partitions will be visible here. But Linux system partition will not be visible in Windows File Explorer. Close Computer Management. Restart Windows. You will notice that Windows OS has loaded without showing any option to switch between Ubuntu and Windows. This happens because Windows Boot Loader overwrites existing Linux Boot Loader. Let’s follow step 3 to repair the GRUB boot loader and restore Ubuntu operating system.

Step 3: Repair Ubuntu Grub Boot Loader

Re-insert Ubuntu Flash Drive and restart windows. Boot from Ubuntu Flash Drive by selecting option from boot menu. Press F9 (or Del or F10 or F12 or Esc) to display Boot Menu. You may try other keys as well as per make and model of your computer. Ubuntu setup will load from flash drive. Click ‘Try Ubuntu’. Ubuntu Live Session will load from Flash Drive. Open Terminal in Live session of Ubuntu.

Add repository of ‘Boot-Repair’ application and update package database by typing the following commands in terminal:

sudo add-apt-repository ppa:yannubuntu/boot-repair

sudo apt update

After updating the package database, type following command to install ‘Boot-Repair’ application:

sudo apt install boot-repair

Enter root password and press ‘Y’ or ‘Enter’ key when prompted. After installing ‘Boot-Repair’ application, run ‘Boot-Repair’ application by typing following command:

boot-repair

The boot repair application will open from terminal prompt. Click on ‘Recommended repair’ button as shown in below image:

Wait for the boot repairing process to complete. You may click on ‘No’ when prompted to upload the boot-info to paste bin. If there is some error during the process. You may click ‘yes’ to save and share the error messages occurred during the process. Boot Repair application will display Boot Info Summary after successful repairing of GRUB boot loader. Close the summary report and exit Boot-Repair application.

Reboot your computer:

Remove Ubuntu Flash Drive from the computer when prompted and hit ‘Enter’. Wait for the system to restart. Upon restart, the system will display the Boot Loader to choose between Ubuntu and Windows operating system. The same is shown in below image as an illustration:

As shown in above image, first option is for loading Ubuntu whereas last two options are for Windows. Select first option and hit ‘Enter’ to load Ubuntu Operating System. Existing Ubuntu Operating System will successfully load from the hard disk. Reboot the system. The GRUB boot loader will load again. Select one of the options as shown in image above to load Windows operating system.

Watch the practical demonstration of the above the above process in below video:

Note: The above video also shows how to share files between your Windows and Ubuntu system existing in dual boot mode on a computer.


We hope the above information was useful for you. Alas! Information keeps on updating. Follow us on social media, subscribe to our blog or subscribe our YouTube Channel to receive latest updates.


Share

View Comments

  • Love the guide!! Many thanks. Only thing I had to figure out at the end was to reorder booting priorities in BIOS for Ubuntu being the first one, otherwise the Win was still auto-booting. Now GRUB is working nicely.

    I would have couple of exploration questions if you don't mind.
    Story:
    A year ago I bought a new laptop with Win on it. Immediately reinstalled to Ubuntu without thinking about partitioning or dual-boot (first time linux user). Now I decided for dual boot and followed your guide. Looking into Disks I found out that I have partition P0 with 500MB, "Mounted at /boot/efi" and partition type EFI System. Next to it was partition P1 with Ubuntu.
    Also, I kinda screwed up during Win install as I selected un-allocated space and went ahead without creating partition manually first. I realized that after couple of seconds and cancelled the installation and started again. However, Win installer already created partition in the first run so I got partition P2 with 17MB of type "Microsoft reserved (No Automount)" and P3 with full Win OS after second install run.
    Thus now I have 2 normal partitions P1 (Ubuntu) & P3 (Win) and 2 weird ones P0 & P2.

    Questions:
    1. Do I understand correctly that P0 and P2 are leftover artifacts after reinstalls?
    2. If yes, can I safely dissolve/downsize P0 and P2 and merge their space to P1/P3 ? Or is P0 necessary space and service for UEFI boot? (if yes, why then 500MB ?)
    3. In Ubuntu I can see and fully access Win partition P3. Is that normal that for dual boot, one OS can use file system of the other OS ?

  • Hi. I went through the whole process, and everything went fine until boot-repair. Got an error msg:
    Error code 32
    mount -r /dev/nvme01np4 /mnt/boot-sav/nvme0n1p4
    mount -r /dev/nvme01np4 : Error code 32
    3 times in a row in that text file.
    When I restart the, GNU Grub boot menu looks different than on your tutorial. Ubuntu is first choice, and i can select Windows boot manager, but then I have to enter Windows Bitlocker code every time i restart windows.
    I have tried doing the boot repair twice now, but same result.
    Im trying this with windows 11. Im not sure if that should be any different than with Win 10.

    • Bitlocker is used for encrypting windows partition. Did you encrypt your windows partition? Try decrypting it with bitlocker key then try again.

  • Hi, Thank you for this great guide. I installed windows successfully and the problem is that when windows tries to restart after installation, system boots from Ubuntu. I also removed usb before first system restart as you mentioned in a similar comment but it didn't work for me. Any advice?

  • Thanks a lot, it worked like a charm. Although I got error after the boot repair, I just ignored the message. I guess it was not major. I had Ubuntu 20.4 LTS on SSD and had some free space on HDD which I formatted as NTFS and installed Windows 10 on that. The boot-repair worked well.

  • Hi.. Ive done the dual boot setup and repair the grub boot loader.. But after that i reboot the system and it only boot to ubuntu.. There is no option to boot to Windows.. So what do i do wrong?

  • Thank you so much. I’ve accepted that Dual booting is too tough for me, but thanks to this I can now dual-boot!! Thank you thank you 🙂

  • Hi, thank you very much for this post!

    I was able to install Windows succesfully, but my problem is that when the computer restarts with the USB it starts again the installation process, and if I remove it, it doesn’t launch Windows but Ubuntu instead, so I can’t go on with the next steps.

    Any idea of how to solve this?

    • Start the installation process with usb. Then remove usb when windows will restart for first time during installation to continue setup.

    • It don't take much time. Try restarting the process. Ensure that you have taken backup of important data.

This website uses cookies.

Privacy Policy