Results 1 to 5 of 5

Thread: Fix for Live USB boot in EFI mode (64 bits)

  1. #1
    Join Date
    2014-Jan
    Posts
    15

    Fix for Live USB boot in EFI mode (64 bits)

    hi.
    So here is what I have used to sucessfully boot in EFI mode the Live USB key I have made. (The original boot did not worked at all. I had to boot in legacy BIOS mode)

    Summary: We replace the broken syslinux boot with a grub EFI boot

    TL;DR
    Download and burn/use the efi patched kali iso

    Step by step walkthrough to change Live USB

    On the USB key, you have a second partition (ESP). Mount it if it is not already done
    For example:
    Code:
    # mount /dev/sdc2 /mnt/kali
    then
    Code:
    # cd /mnt/kali/EFI/BOOT
    # rm -f *
    We don't need any of the already existing file

    then copy into that directory the following file BOOTX64.EFI

    For the one not trusting that file, they can recreate it like I did on my Ubuntu 15.04 with this command:
    Code:
    # grub-mkstandalone -d /usr/lib/grub/x86_64-efi/ -O x86_64-efi --modules="part_gpt part_msdos iso9660 all_video efi_gop efi_uga video_bochs video_cirrus gfxterm gettext font" --fonts="unicode" --themes="" -o /mnt/kali/EFI/BOOT/BOOTX64.EFI --compress=gz "boot/grub/grub.cfg=/root/kali.cfg"
    where the config file kali.cfg is the following:
    Code:
    # Config file for GRUB2 - The GNU GRand Unified Bootloader
    
    set menu_color_normal=white/black
    set menu_color_highlight=black/white
    
    function load_video {
        if [ x$feature_all_video_module = xy ]; then
            insmod all_video
        else
            insmod efi_gop
            insmod efi_uga
            insmod video_bochs
            insmod video_cirrus
        fi
    }
    
    load_video
    set gfxmode=auto
    set gfxpayload=800x600
    
    insmod font
    font=unicode
    loadfont $font
    
    insmod gfxterm
    insmod gettext
    
    # Timeout for menu
    set timeout=5
    
    # Set default boot entry as Entry 0
    set default=0
    set color_normal=white/black
    
    function find_root {
        insmod part_gpt
        insmod part_msdos
        insmod iso9660
        search --no-floppy --fs-uuid --set=root 2015-03-12-17-52-45-00
    }
    
    menuentry "Live (amd64)" {
        find_root
        linux /live/vmlinuz boot=live noconfig=sudo username=root hostname=kali
        initrd /live/initrd.img
    }
    
    menuentry "Live (amd64 failsafe)" {
        find_root
        linux /live/vmlinuz boot=live config memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal
        initrd /live/initrd.img
    }
    
    menuentry "Live USB Persistence              (check kali.org/prst)" {
        find_root
        linux /live/vmlinuz boot=live noconfig=sudo username=root hostname=kali persistence
        initrd /live/initrd.img
    }
    
    menuentry "Live USB Encrypted Persistence    (check kali.org/prst)" {
        find_root
        linux /live/vmlinuz boot=live persistent=cryptsetup persistence-encryption=luks noconfig=sudo username=root hostname=kali persistence
        initrd /live/initrd.img
    }
    
    menuentry "Live (forensic mode)" {
        find_root
        linux /live/vmlinuz boot=live noconfig=sudo username=root hostname=kali noswap noautomount
        initrd /live/initrd.img
    }
    #####
    menuentry "Install" {
        find_root
        linux /install/vmlinuz vga=788 -- quiet
        initrd /install/initrd.gz
    }
    
    menuentry "Graphical Install" {
        find_root
        linux /install/gtk/vmlinuz video=vesa:ywrap,mtrr vga=788 -- quiet
        initrd /install/gtk/initrd.gz
    }
    
    menuentry "Install with speech synthesis" {
        find_root
        linux /install/gtk/vmlinuz video=vesa:ywrap,mtrr vga=788 speakup.synth=soft -- quiet
        initrd /install/gtk/initrd.gz
    }
    this file is an adaptation fo the boot file used by the original syslinux kali. If you don't use Ubuntu 15.04, you may have to make some adjustement to the grub-mkstandalone command above

    Then
    Code:
    # umount /mnt/kali
    And reboot!

    TODO: Use a graphical background with the original splash.png
    Last edited by zebul666; 2015-06-09 at 16:32. Reason: Add link to iso

  2. #2
    Join Date
    2014-Jan
    Posts
    15
    For your convenience, I have made a modified iso of kali 1.1.0a amd64 (md5sum: 5ecb2f838b675597ba918c6475d5c91e) that include the fix discussed above.

    Only the ESP partition on the iso has been changed. I have touched nothing on the kali partition. You can check that for yourself.

    Explanation:
    Basically what I have done is not even regenerate a new iso but modify it ! Yes, I didn't think it was possible but it is after all.

    Run
    Code:
    kpartx -a kali-linux-1.1.0a-amd64.iso
    Then you should have 2 loop0p? under /dev/mapper. Mount the second one which is the ESP.
    Code:
    mount /dev/mapper/loop0p2 /mnt/loop
    cd /mnt/loop/EFI/BOOT
    rm -f *
    and add the BOOTX64.EFI above.
    Code:
    cp /somewhere/BOOTX64.EFI BOOTX64.EFI
    cd -
    umount /mnt/loop
    kpartx -d kali-linux-1.1.0a-amd64.iso
    and you can burn the iso...
    Last edited by zebul666; 2015-06-09 at 16:46.

  3. #3
    Join Date
    2013-Jul
    Location
    United States
    Posts
    520
    Quote Originally Posted by zebul666 View Post
    For your convenience, I have made a modified iso of kali 1.1.0a amd64 (md5sum: 5ecb2f838b675597ba918c6475d5c91e) that include the fix discussed above.

    Only the ESP partition on the iso has been changed. I have touched nothing on the kali partition. You can check that for yourself.

    Explanation:
    Basically what I have done is not even regenerate a new iso but modify it ! Yes, I didn't think it was possible but it is after all.

    Run
    Code:
    kpartx -a kali-linux-1.1.0a-amd64.iso
    Then you should have 2 loop0p? under /dev/mapper. Mount the second one which is the ESP.
    Code:
    mount /dev/mapper/loop0p2 /mnt/loop
    cd /mnt/loop/EFI/BOOT
    rm -f *
    and add the BOOTX64.EFI above.
    Code:
    cp /somewhere/BOOTX64.EFI BOOTX64.EFI
    cd -
    umount /mnt/loop
    kpartx -d kali-linux-1.1.0a-amd64.iso
    and you can burn the iso...
    I'm trying this right now. I just bought the 2015 Retina MacBook Pro with the dedicated graphics card (I specifically bought this model to use with oclHashcat) and I've been trying for almost 7 hours to get Kali to install. I've tried 1.0.9a, 1.1.0a, and I've tried about 1,000 different ways to install. Hopefully this works, and I presume it will because the errors I was receiving pertained to legacy booting.

    So anyways, thanks in advance!

    UPDATE: This didn't work for me unfortunately. I believe it is a problem with refind because i tried the exact same method on my 2012 MacBook Pro and it worked fine.
    Last edited by soxrok2212; 2015-07-18 at 03:37.

  4. #4
    Join Date
    2015-Aug
    Posts
    1
    I tried simply creating the USB using the above ISO, and it did not work for me, but if I'm not mistaken this is due to there not being a /EFI/BOOT directory for the *.efi ? I'd really like to revive this thread as I've been trying my damnedest to get kali to boot on this uefi only machine (no legacy boot option) and just cannot do it. The closest I've gotten is a grub terminal...

    Asus X205TA (Baytrail)

  5. #5
    Join Date
    2016-Nov
    Posts
    1
    Quote Originally Posted by zebul666 View Post
    For your convenience, I have made a modified iso of kali 1.1.0a amd64 (md5sum: 5ecb2f838b675597ba918c6475d5c91e) that include the fix discussed above.

    Only the ESP partition on the iso has been changed. I have touched nothing on the kali partition. You can check that for yourself.

    Explanation:
    Basically what I have done is not even regenerate a new iso but modify it ! Yes, I didn't think it was possible but it is after all.

    Run
    Code:
    kpartx -a kali-linux-1.1.0a-amd64.iso
    Then you should have 2 loop0p? under /dev/mapper. Mount the second one which is the ESP.
    Code:
    mount /dev/mapper/loop0p2 /mnt/loop
    cd /mnt/loop/EFI/BOOT
    rm -f *
    and add the BOOTX64.EFI above.
    Code:
    cp /somewhere/BOOTX64.EFI BOOTX64.EFI
    cd -
    umount /mnt/loop
    kpartx -d kali-linux-1.1.0a-amd64.iso
    and you can burn the iso...
    I am trying to Install Kali on my USB having the same problems.. Do I do these steps on terminal mac?

Similar Threads

  1. Replies: 0
    Last Post: 2022-03-14, 13:39
  2. Kali live 2.0 boot USB persistence mode on MacBook Pro 2011
    By matheusnno in forum Installing Archive
    Replies: 2
    Last Post: 2017-03-03, 13:57
  3. Can't boot into persistent mode live USB only forensic.
    By perception in forum Installing Archive
    Replies: 1
    Last Post: 2013-11-27, 22:51

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •