Dual Boot Fedora 20 Kali Linux UEFI

Dual Boot Fedora 20 Kali Linux UEFI

I have already got my Toshiba Ultra Book U840W-x0110 laptop running Fedora 20. This post is about getting the Kali Linux distro to dual boot with Fedora. I have created a Kali Live CD by downloading the ISO image from the official site.

The laptop hard disk size is 500GB. In my installation I had allocated 200GB for the Fedora installation. Hence the remaining approx. 300GB is free for Kali Linux.

The Toshiba Ultra Book U840W-x0110 laptop has UEFI boot enabled by default. The laptop could not directly boot Kali Linux live CD. This is because Kali Linux does not support UEFI boot. Hence to boot Kali Live CD we need to change the UEFI settings of the laptop. We need to make the laptop boot in the legacy BIOS interface (CSM Boot).

  1. Restart the laptop and hold the F12 key. In the Boot Menu navigate using the arrow keys to the <Enter Setup>. Under “Advanced” tab enter “System Configuration”. Here change the “Boot Mode” to “CSM Boot”. Press F10 to save and exit.
  2. Now the Kali Linux Live CD should boot with a loud annoying beep.  Trigger the installation by navigating to the “Install” option.
    IMG_2612
  3. Select the installation language, Location and the Keyboard in the subsequent windows.
  4. For the network interface I connected the internet via the Ethernet cable. Somehow the WiFi didn’t seem to work.
  5. Enter the host name of your choice.
  6. Enter a domain Name.
  7. Provide and verify the root password.
  8. Select the time zone.
  9. Select “Automatic Partition with the remaining free space” for installing Kali Linux in the remaining free space of the hard disk.
  10. Continue with the installation until the below window for GRUB boot loader appears. Do not install the GRUB loader. Press the escape key to do this.IMG_2613
  11. The below window should appear.
    IMG_2614
  12. Select “Continue without boot loader”. The below window should appear. Note down the partition. This is important for GRUB configuration. In my case it is sda4. Finish the installation.
    IMG_2615
  13. Now we need to boot into fedora again. For this we have to enable UEFI again. Follow step 1 but enable UEFI boot this time.
  14. Once in Fedora edit the 40_custom file. Run the below command in the terminal as root.
    gedit /etc/grub.d/40_custom
  15. Add a entry for the recently installed Kali Linux. The 40_custom file should look as below.  In my case I had installed Kali Linux on sda4. Hence the root is also set to (hd0,4).
    #!/bin/sh
    exec tail -n +3 $0
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    menuentry "Kali Linux" {
        set root=(hd0,4)
        linuxefi /boot/vmlinuz-3.14-kali1-amd64 root=/dev/sda4 ro quiet splash
        initrdefi /boot/initrd.img-3.14-kali1-amd64
    }
    
  16. Now run the below command to update the GRUB menu. During the next boot the GRUB menu should show an entry for Kali Linux.
    grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Win 8.1 upgrade removes Arch-Linux Grub menu

Win 8.1 upgrade removes Arch-Linux Grub menu

I have a Toshiba Ultra Book U840W-x0110. I have had this laptop dual-boot Windows 8.0 and Arch-Linux. Recently I was offered a free update to Windows 8.1. Since it was free it blocked the logic out of my thought process. I decided to go for this update and after some 2 hours the update to Windows 8.1 was complete. SInce I was working on Windows a restart was always on the cards.  During the restart I observed that there was no grub2 menu. The laptop was directly booting into Windows 8.1.

First I was under the impression that the Windows 8.1 update has overwritten the previous grub2 installation. So I booted up my laptop with the Arch Linux CD. But reinstalling grub2 did not change anything. So it is concluded that the update to Windows 8.1 did not affect grub2. The next step was to check for the boot order in the EFI boot Manager.

The EFI Boot Manager ( efibootmgr ) is a very powerful utility. It can make or break your laptop. There are cases where it has bricked the laptops. Hence exercise extreme caution and care when using these commands. Also my grub2 configuration has the entry to boot Windows 8. Hence for me the priority was to get the Grub2 menu during booting.

Run the below command in the console window:

efibootmgr

The output will have the boot order in the EFI.

BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0004,0003,2003,2001,2002
Boot0001* EFI Network 0 for IPv6 (08-9E-01-4B-BA-F1) 
Boot0002* EFI Network 0 for IPv4 (08-9E-01-4B-BA-F1) 
Boot0003* arch_grub
Boot0004* Windows Boot Manager
Boot0007* Intel Data_Volume
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network

In my case the arch_grub (0003) is after Windows Boot Manager (0004). Hence the Windows Boot Manager boots before without giving a chance for the Grub2 to run. So I changed the boot order so that arch_grub (0003) is before Windows Boot Manager (0004).

The command for my case to change the boot order is :

efibootmgr -o 0003,0004,2003,2001,2002

Now the output for the previous efibootmgr command is :

BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,0004,2003,2001,2002
Boot0001* EFI Network 0 for IPv6 (08-9E-01-4B-BA-F1) 
Boot0002* EFI Network 0 for IPv4 (08-9E-01-4B-BA-F1) 
Boot0003* arch_grub
Boot0004* Windows Boot Manager
Boot0007* Intel Data_Volume
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network

Check and recheck the output and restart the laptop, this time the grub2 menu should come up.