Recently I tried to setup up dual-boot between Windows 10 and Kali linux 2016.2 on my Dell XPS 13. I failed on my first attempt right at the beginning because I didn’t enable “legacy boot” in the UEFI firmware. I didn’t want to enable “legacy boot” and accepted the challenge to explore dual booting Windows 10 and Kali Linux the UEFI way.
First I learned that Kali Linux and many other Linux distributions do not support UEFI right out of the box. Second I am not the first one experiencing this. I found a couple of guides explaining how to get this UEFI-Linux-Dual-Booting-Beast tamed. I would like to mention the following two as they provided valuable hints:
- Kali Linux 2016.1 on UEFI (Dual Boot with Windows 10)
- Dual-boot Kali Linux Rolling 2016.2, Windows 10 on a PC with UEFI firmware
However none of the both worked and got the dual-boot working, I encountered one or multiple of the following issues:
- The Kali bootable USB stick was not recognized as UEFI device
- Kali didn’t integrate with UEFI boot partition from Windows and created a MBR
- WiFi Drivers not found –> no WiFi, no ethernet port therefore no connectivity
- Kali repositories were not configured due to the broken WiFi setup
In the following chapters I will explain the preparation and post-implementation steps which are required to successfully install Kali Linux beside Windows 10 in a dual-boot setup.
Step 1 – Adjust the BIOS Settings
Storage Mode: AHCI
I normally reinstall Windows when I receive a preinstall on a system. Before I do this I check the BIOS settings. On the Dell XPS 13 I changed the storage mode from Raid to AHCI.
Note: Setting the XPS13 BIOS to default will configure the storage mode to AHCI as well.
Secure Boot: Off
Note: Secure boot might be a good idea but most Linux distribution do not come with a signed kernel and then secure boot will stop them from booting.
Step 2 – Correct EFI partition type
- Start diskprt (requires elevated user rights)
- Identify the EFI partition created by Windows – it is the system partition with approx. 100MB
- Select it as shown below and then set the type with the diskpart command
Note: At one point during the Kali installation, the disk needs to be partitioned. The first blog post mentioned above presented this as shown below (hopefully they don’t mind that I borrowed their screen shot):
What I noted was, that the flags and partition type as outlined were different, actually blank, for the EFI partition
I was sure that this needs to look as shown above and found the post here describing how to do it. Please be careful with the tool diskpart and modification on the partitions as you can easily erase the disk or render the content useless.
Step 3 – Get the Linux WiFi drivers
Note: Somehow when the kali image is written with Rufus in the ISO mode the WiFi libraries are left out and the network setup will fail. Having these drivers library at hand is required to fix the network setup after the installation.
Step 4 – Create Installation Medium from Windows
Build your bootable USB flashdrive from Windows with Rufus (get if rom here) using the ISO option – this creates a FAT32 boot medium which works with UEFI. I recommend to follow the first of the guides mentioned above with copying the EFI files as well.
When the USB flashdrive has been created (formatted with FAT32) add the following directory (keep the capital letters):
Note: Some guides recommend to use Win32DiskImager. This tool creates a functional USB stick, but not formatted as FAT32 and therfore it will not be recognized by the UEFI firmware. Including the EFI directory on the stick is a must please follow the steps described in in this guide: Kali Linux 2016.1 on UEFI (Dual Boot with Windows 10)
Install Kali Linux
Installation is actually straight forward (explained in detail in the guides listed above):
- Boot from the Kali flashdrive (it should show up in the UEFI boot options)
- In the Kali boot loader (GRUB2) select the grapical or textual installation option
- Run the installation following the given instructions
Note: I recommend to use guided disk partitioning and ignore issues regarding the missing WiFi driver and mirror sources – will be fixed in Post-Installation.
Reboot into Kali. Here you might experience some magic and the WiFi workes without any further intervention – in this case you can jump directly to Step 2. In all other cases move on with Step 1.
Step 1 – Fixing the Kali WiFi driver if required
If the Wifi is not functioning submit the following command in Kali terminal/bourne shell:
sudo dpkg -i linux-firmware_1.157.5_all.deb
Reboot, verify that the WiFi is now working and connect to your network.
Step 2 – Fixing the Kali repository sources
Open the repository configuration file (I prefer nano but you can use any other editor e.g. gedit):
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak sudo nano /etc/apt/sources.list
and add the follwing entries after you checked that they are not already there
deb http://http.kali.org/kali kali main non-free contrib deb http://security.kali.org/kali-security kali/updates main contrib non-free
finally update the installation with:
sudo apt-get update sudo apt-get upgrade
When all updates are applied the Kali installation should be fine.
Step 3 – Configure GRUB2 (from Kali)
If you want not Kali but Windows to start by default you need to update the GRUB configuration (I prefer nano but you can use any other editor e.g. gedit):
sudo nano /etc/default/grub
Look for the entry:
Replace the zero with the entry you would like to boot by default – in my case Windows was on 3. Hint the position in the boot list directly corresponds with the number.
Save the file and activate the change with:
Reboot and verify that the changes are working correctly. If you would like to others additional GRUB modification e.g. change wall paper have a look here
Now your system should be properly dual boot Windows 10 and Kali with UEFI and without “Legacy Boot”.