Install Windows over existing Kali Linux as Dual Boot

Windows over Kali Linux Dual Boot

Let us check out a process to install Windows over existing Kali Linux in dual boot mode. In dual boot mode, both the operating systems will be available on your PC as a host machine. However, only one operating system will load at an instance i.e. either Windows or Kali Linux.

You will need two USB drives to make them Kali Linux and Windows bootable. You may also use one flash drive but then you will have to alternatively make them Kali Linux and Windows bootable during the process. Using one USB drive will be time consuming, thus, it is recommended to arrange two USB drives before proceeding. The USB drive you plan to make bootable for Kali Linux should be of minimum 4 GB, whereas, for Window bootable, the USB drive should be of minimum 8 GB capacity.

Let us check out the steps involved in the process:

1. Download Kali Linux ISO file

Open a web browser and navigate to Kali Linux official website. Click on download button on home page. On available Kali platform page, click on Live Boot option. Then, select 64-bit or 32-bit option as per the architecture of your PC or laptop. Mostly modern computers are based on 64-bit architecture. Click on download button to start download. Save the downloading ISO file to your PC. Wait till the Kali Linux ISO file is being downloaded.

2. Download Windows ISO file

While the Kali Linux file is being downloaded, let us download Windows ISO file as well. Open Microsoft official website to download Windows ISO file on Linux PC. Scroll down the Download Windows Disc Image page and select the latest available version and click on confirm. Then, select the product language and confirm. Then, click on 64-bit download or 32-bit download as per architecture of your PC. Save Windows ISO file as well on your PC. Now wait until both of these ISO files (Kali Linux and Windows) are downloaded. Once downloaded, check the download location for availability of both files.

3. Flash Kali Linux ISO file to USB

Now insert 4 GB (or more) USB drive in your PC. Open a terminal and change the directory to Download location. Find out the path of USB using the following command:

lsblk -o PATH, LABEL

Note down the path of the USB drive. You can find out the USB drive from the list using its capacity or Label. The path should be like /dev/sdb or /dev/sdc, etc. Ignore any number 1 or 2 at the end of the USB drive path. For e.g. the following image shows that first USB drive path is /dev/sdb and second USB drive path is /dev/sdc.

USB Paths on Linux

Now (assuming that you are in the download folder), type the following command to flash Kali Linux ISO file to first USB drive:

sudo dd if=[ISO file path] of=[USB drive path] bs=4M status=progress oflag=sync

Note: replace [ISO file path] with name of Kali Linux ISO file e.g. kali-linux-2022.1-live-amd64.iso

Also, replace [USB drive path] with path of USB drive without any number at the end e.g. /dev/sdb

The example path is shown in following figure:

dd command example

Wait for the Kali Linux flashing to finish.

4. Flash Windows ISO file to USB

While making Kali Linux bootable pendrive is under process, let us make Windows bootable USB in parallel to save on time. Open another terminal. Now insert 8 GB (or more) USB drive in your PC. Open another terminal and change the directory to Download location.

Find out the path of second USB as well by using lsblk command as mentioned above. Now (assuming that you are in the download folder), type the dd command again to flash Windows Linux ISO file to second USB drive as mentioned above. However, replace [ISO file path] with name of Windows ISO file e.g. Win10_21H2_English_x64.iso

Also, replace [USB drive path] with path of second USB drive without any number at the end e.g. /dev/sdc

The example path is shown in following figure:

dd command example windows

Wait for the Windows flashing to finish. Once both ISO files are flashed to USB drives, close this terminals.

5. Boot from Kali Linux USB

Remove the Windows bootable USB and keep Kali Linux USB inserted in your PC. Reboot the PC and boot from Kali Linux USB. You will need to enable boot from USB option from UEFI/ BIOS setup of your PC. You will need to press some special key such as Del, F10, F9, etc. to enter BIOS setup immediately after the system is switched ON. The keys are different for various make and model to Enter Bios setup and change settings for enabling boot from USB. Save settings and restart PC again, select to boot from USB by displaying boot menu. The keys for displaying boot menu is also  different for different make and model. Select the USB and boot from it instead of booting from Hard Disk.

If you will boot from Kali Linux bootable USB, the Kali LInux Live Menu will display. Select the first option “Live System”  from the list to load Kali Linux live session.

kali live menu

Open GParted application from application menu. Select existing Linux partition (mostly ext4 type) and resize it to free up disk space. Right click on the partition and click Resize/Move.

gparted resize

Drag the slider to shrink Linux partition and create un-allocated space and click on Resize/Move. You will use this un-allocated space to install Windows on it.

gparted resize slider

Apply all operations.

gparted apply all operations

Wait for resizing to finish. Once resizing is complete, close GParted application and terminate Kali Linux Live session.

6. Boot from Windows USB and install Windows

Remove Kali Linux USB and insert Windows USB in your PC. Now, as mentioned above, boot from Windows USB to load Windows installer. Select installation language, time and currency format and keyboard or input method to proceed with Windows installation by clicking Next and then clicking on Install Now.

On the activate windows screen, provide the windows product key or continue by clicking “I don’t have a product key” for now. You can provide windows product key for activation later on you purchase windows.

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 an appropriate Windows operating system version such as Home, professional, etc. Tick the “I accept the license terms” checkbox and click on Next. Select Custom: Install Windows only (advanced) option to proceed. Select the un-allocated space and click on Next. Windows installer will automatically create and format partitions.

unallocated space for windows

Wait till the installation files are copied. The installation process will restart many times. During first restart, remove Windows USB and continue windows setup from hard disk. During the installation select various options such as language, keyboard, username, password, etc. till the setup is finished. The setup will install Windows on your PC, however, the existing Kali Linux will be lost. Your PC will boot and load Windows only. To fix this you need to install and update Grub boot loader on Kali Linux partition.

7. Install and update Grub boot loader

Re-insert Kali Linux bootable USB in your PC, boot from it, load Kali Linux live session and open terminal. Find out the Kali Linux partition using the following command:

sudo fdisk -l

You will be able to identify the Kali Linux partition based on the disk size and value under Type column. For example the below image shows that the Kali Linux partition is /dev/sda1.

kali linux partition fdisk

Mount the Kali Linux partition and bind other directories temporarily to /mnt path using the following commands in the below given sequence:

sudo mount /dev/sda1 /mnt
sudo mount –bind /dev /mnt/dev
sudo mount –bind /dev/pts /mnt/dev/pts
sudo mount –bind /proc /mnt/proc
sudo mount –bind /sys /mnt/sys

The following image illustrates the above commands for reference:

mount kali partitions

Now change root to /mnt directory using following command:

sudo chroot /mnt

Install, update and exit grub on the mounted Kali disk (ignore number at the end i.e. use /dev/sda only) using following commands:

grub-install /dev/sda
update-grub
exit

The following image illustrates the above commands for reference:

install update grub kali linux

Now, un-mount the directories that were mounted in previous step using following commands in the given sequence:

sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt

The following image illustrates the above commands for reference:

unmount kali linux partitions

Reboot the PC and remove Kali Linux bootable USB. Upon restart you will see that the Grub Boot loader is displaying options to choose and load either Kali Linux or Windows.

dual boot kali windows

You can now load either Kali Linux by selecting the first option or load Windows by selecting the third option.

You can watch the live demonstration of the above method in the following video:

Be the first to comment

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