Install Windows after Ubuntu Linux in Dual Boot Mode

Windows over Ubuntu Dual Boot Repair

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:

Multiple Partitions in Ubuntu

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:

Disks Application in Ubuntu

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:

Disks Application in Ubuntu Steps A

Disks Application in Ubuntu next Steps

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

Free Disk Space after Resizing Secondary partition Ubuntu

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:

Try Ubuntu

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 in Ubuntu Live Session

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:

GParted Partition and Resize Button in Ubuntu

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:

Initial Slider Gparted Ubuntu

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:

Dragged Slider Gparted Ubuntu

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:

Unallocated space and Apply button Gparted Ubuntu

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:

Freee Disk Space after Resizing Primary partition in Ubuntu

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.

i dont have a product key windows

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.

Partitions in Windows setup

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:

Partition for Windows installation

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:

Recommended Repair button in Boot Repair Application

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:

Windows and Ubuntu Dual Boot GRUB Boot Loader

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.


64 Comments

  1. 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 ?

  2. 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.

  3. 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?

  4. 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.

  5. 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?

  6. 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 🙂

  7. 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?

  8. Will this work on MacBook pro (2011)? I replaced the MacOS with Ubuntu, which is working great. I am trying to have access to windows. I followed your steps including creating a bootable windows USB. when I try to start the Mac with the windows bootable (hold Option button), I only get the option of starting from the harddrive (Linux). when I use the same method with the bootable Linux, I get both options (Harddrive, USB). The Windows bootable USB seems to have been created properly. If that method does not work for mac, any idea what’s the best option for Linux/win or just win on this kind of system?

  9. Thank you for the information on this site. You are the first one that shows me what happens after the crash of my W10. I had to copy an image and re-activate it. Now I have the 2 WIndows boot on sda1 (W7) and sda4 (W10). No W10 nor Linux forum knows this! Thought I was the only one in the world. But on a computer—–>you never are!

  10. TechSolvePrac, I have a few questions. *Would this work with other Linux operating systems? I mean provided an Ubuntu live USB is used with the yannubuntu package, could I fix entries for say Debian, Arch? *What about if a system has an encrypted LVM (i.e. unencrypted /boot, encrypted LVM with / , /home , swap) ?

  11. Hi. This guide has been an absolute godsend! I had a few issues on the way with being unable to install windows as my HD was the wrong format, but once I used Gdisk to change it and then rebuilt the bootloader it was all fine. Thank you so so much for writing this, hugely appreciated!

  12. This practical example was a life saver..
    could you please inform us at the beginning of the tutorial that we need two bootable media because it’s quite a process when having only one usb drive

    • Ok. I will mention that one can install Windows over Ubuntu in dual boot mode using one flash drive, however, it will be convenient if user has two pen drives and they can create windows Bootable as well as ubuntu Bootable beforehand.

  13. Worked perfectly from beginning to end! Thank you so much for writing this. I made the mistake of only having one flash drive nearby so creating the bootable media three times was a pain lol.

    Keep up the good work!

    • Yes, you will need bootable USBs of both Unbuntu and Windows. If you have 2 USBs then you can make both bootable or you may use the same USB alternately. Data on usb will be lost. Data in existing Ubuntu will be preserved. However, it is always advisable to take back of your important files before proceeding because there is a chance of lossing data in case of some interruption during installation process.

  14. Hi! Can I somehow make Win10 the fist or default option? I use W10 mostly and I hate this loared expiring time and need to reboot. Please help!

  15. Maybe there should be a warning in “Boot from Windows Flash Drive” to use UEFI boot mode, I was stuck, getting an error about being unable to install on the GPT drive.

  16. How much free space should be allocated for the new partition? I am confused on this matter. I am planning to use Windows 10 for Adobe photoshop/illustrator/prelude and other windows-only software, whereas my Linux distro is currently being used for deep learning. I have one 2TB SSD. Will partitioning 1TB take away from either of the two OS uses?

  17. I think that this:” If you have a single partition then follow option ‘a’ below. Else if you have multiple partitions then follow option ‘b’ below”
    Should read this:”It is possible that you may have single or multiple partition 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

  18. after I follow every step, I got this error: “we couldn’t create a new partition or locate an existing one” when I want to install windows to drive 0 partition

      • Hi, thanks for your prompt reply, what do you mean that create empty space and delete existing partition? I resize the partition following by option ‘b’, and then select the un-allocated space and click ‘New’ to create a New Partition from this un-allocated Space, then I got the above error

          • Hi TechSolvePrac,
            I am also receiving this same error as stated above. I have 150Gb reserved as unallocated space at the rightmost end of my drive for the windows installation. Do you have any idea what could be causing this?
            Thank you for this blog post!

            • Press Shift + F10. Type “diskpart” command. Then, “list disk”. Then, “select disk [disk number of free space]”. Then “clean”. This should solve your problem.

              • Hi, thanks for the prompt reply! I don’t want to clear the entire disk since it also contains my ubuntu installation. Will ‘clean’ remove everything from the disk?

  19. Here is the error I am getting while installing the windows after following every step carefully.. “Windows cant be installed on drive 0 partition 3. The selected disk has an MBR partition table. On EFI systems, windows can only be installed to GPT disks.”

      • I will suggest not to create a partition before installing windows. Just free up space by deleting partition. During installation select this unallocated free space, then windows will automatically create a small partition for placing boot files on MBR, rest space it will use for installing windows.

4 Trackbacks / Pingbacks

  1. install windows 10 after ubuntu Of 2021 | Bnr.Co
  2. install windows over ubuntu Of 2021 | Bnr.Co
  3. Https after ubuntu update cannot login Portal Guide Instructions Help - centtip.com
  4. Https after clean boot cant login Portal Guide Instructions Help - centtip.com

Leave a Reply (if you any question or feedback for us)