Results 1 to 13 of 13

Thread: EFI-Install Kali Linux w/o USB stick or network access - MacBook Pro (Dual-Boot)

  1. #1
    Join Date
    2013-Nov
    Location
    London
    Posts
    4

    EFI-Install Kali Linux w/o USB stick or network access - MacBook Pro (Dual-Boot)

    I have recently fooled around with GPT fdisk and as a result the whole hard drive has been marked as an empty space. I recovered my data, installed newest OS X and decided not to install BackTrack, but instead to try out Kali. Since it worked like a charm, when booted from DVD (it takes a lot of work to get some of the functions to work properly on Mac running BT5), so I've decided to install it to HDD. That was a "bad" idea - GRUB wouldn't get installed, nor would LILO. I initially thought I had a corrupted ISO copy, so downloaded and burned another one, but since it never helped, I did some research. Instructions from this thread didn't work for me, either, because 1) my network card wouldn't connect to the network whith installer launched (it connected succesfully in live mode, so I believe it is some sort of a system bug) and manual set-up did't solve the issue 2) OS on the pendrive wouldn't boot anyway. But, at least they guided me somewhere. It took a lot of trial and error to get my Kali install up and running, so I've decided to open separate thread, so this step-by-step "tutorial" would be easy to find. Maybe my solution will work for someone else (or at least give some idea about how to work around installation trouble) and save precious time.
    To the point;

    Computer I used: MacBook Pro 7.1 running OS X 10.9.1

    What you will use:

    - Disk Utility
    - text editor of your liking
    - rEFInd (extremely convenient, since prior to installing Kali you're going to be switching between OS's a lot - but not necessary, I believe)
    - files downloaded from here (except for fonts, BOOTX64.efi and grub.cfg)
    - Kali ISO, burned onto DVD
    - parted
    - GParted

    Steps to take in OS X

    1. Download aforementioned files and save them to e.g. your Desktop (or any directory that will be easy to remember) or, if you wish, back them up to a pendrive - although it is not a must, since you will most likely be able to obtain those files from your OS X partition.

    2. Open Terminal (Applications/Utilities) and type in
    Code:
    defaults write com.apple.DiskUtility DUDebugMenuEnabled 1
    to enable Debug Menu in Disk Utility. Although it is not required, of course, I strongly reccomend doing so. This will allow you to see all of the partitions listed in Disk Utility sidebar and you will have better idea about what you're doing.

    3. Launch Disk Utility - you really want to use Disk Utility to partition your drive this time, so your OS X is safe. Click 'Debug' and tick 'Show every partition' and 'Force update on disk list' on. To create partition for your Kali, choose your hard drive (not partition!) from the left-hand side menu and then click 'Partition' from it's menu. The scheme showing your disk partitions will appear. Click on your OS X partition and a plus sign underneath will highlight - click on it to add a new partition. Now, that partition [your OS X partition name] 2 appeared, you can edit it's size. IMPORTANT - add just ONE partition and ensure it's file system is "Free space" - even if you want separate partition to be used as a swap space. You'll get to it later. Once you set up a partition of a desired size, hit 'Apply' and wait for the program to confirm operation's done. Your computer might slow down significantly or even freeze for and while, so my advice is to not do anything on yourt. computer while partitioning process is running.

    4. (Optional) Get rEFInd from SourceForge. To install it, unpack the package and launch Terminal once again. Open unpacked folder and find install.sh file - drag&drop it to the Terminal window and just hit Enter. Type in your administrator password, when prompted and you're done.

    I strongly reccomend getting rEFInd instead of quite popular rEFIt - the reason I do is that rEFIt is no longer supported (since 2010, I guess) and it most likely won't work on a computer with OS X 10.8/10.9 firmware. But what you choose is up to you, of course.

    5. Pop in your Kali DVD and restart your computer, holdng 'C' whilst rebooting (with rEFInd installed, just hit Esc to refresh and navigate to CD drive). When Kali's boot menu is launched, choose live mode.

    6. Open terminal and type in 'parted'. Be sure to change units, using
    Code:
    unit MB
    , so when creating new partition, you can be much more precise. Execute 'print', so you know exactly where your partition should starting and ending points should be (starting point should be preferably at the beginning of empty space). 300-400MB is more than enough. Then, type the following commands;
    Code:
    mkpart fat32 [starting point w/o unit] [ending point w/o unit]
    quit
    . The reason you set up this partition with parted is that Mac probalby won't allow you to create a partition of size smaller than 1.07GB and if you choose to create and "empty-space partition" AND MS-DOS partition, it'll most likely create just one big partition with fat32 filesystem.

    7. Launch Kali Installer. When you are asked to choose partition for fresh Kali install, chose 'Manual' and then choose the largest free space to create Kali partition/s out of it. Do not automatically partition free space, also do not add bootable flag to root partition (or any other). Be sure to check if the small partition created using parted is marked 'do not use' and bootable flag is off. Change the name of it, if you want. Go on with installation and if installer asks you about network or GRUB, just skip those steps and install Kali without a bootloader. Don't reboot just yet.

    8. Mount parted-created partition and create an folder in it, named EFI - then open it up and create another folder, called 'Boot'. Remember the files you downloaded in step no. 1? Move them to 'Boot' folder you just created.

    9. Launch GParted and any text editor you like. Create a new document and paste in the following code;
    Code:
    # Config file for GRUB2 - The GNU GRand Unified Bootloader
    # /boot/grub/grub.cfg
    
    # DEVICE NAME CONVERSIONS
    #
    # Linux Grub
    # -------------------------
    # /dev/fd0 (fd0)
    # /dev/sda (hd0)
    # /dev/sda1 (hd0,1)
    # /dev/sda2 (hd0,2)
    # /dev/sda3 (hd0,3)
    # /dev/sda4 (hd0,4)
    # /dev/sda5 (hd0,5)
    # /dev/sda6 (hd0,6)
    # /dev/sdb1 (hd1,1)
    # /dev/sdb2 (hd1,2)
    #
    # root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx persistent
    
    set menu_color_normal=white/blue
    set menu_color_highlight=black/white
    
    function load_video {
    insmod efi_gop
    insmod efi_uga
    insmod video_bochs
    insmod video_cirrus
    insmod all_video
    }
    
    load_video
    set gfxpayload=keep
    
    # Timeout for menu
    set timeout=5
    
    set default="1"
    set timeout=30
    
    set menu_color_normal=white/blue
    set menu_color_highlight=blue/white
    
    function load_video {
      insmod efi_gop
      insmod efi_uga
      insmod video_bochs
      insmod video_cirrus
      insmod all_video
    }
    
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_gpt
    insmod ext2
    
    menuentry "Kali Linux" --class debian --class gnu-linux --class gnu --class os {
      set root='(hd0,5)'
      search --fs-uuid --no-floppy --set=root xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
      echo 'Loading Kali Linux...'
      linuxefi /boot/vmlinuz-3.7-trunk-amd64 root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ro quiet
      initrdefi /boot/initrd.img-3.7-trunk-amd64
    }
    Replace all of the xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx's with the UUID of the partition you installed your Kali to - to get it, in GParted right-click that partition to choose 'properties' - UUID will be shown. If your Mac has just OS X and Kali installed (and Kali has all files in single partition), you most likely won't have to change the device for GRUB to root into - 1st partition will be EFI, second is OS X, Recovery HD is the third, the one with EFI/Boot catalogue on the fourth and so Kali is on the fifth partition. If it's not the case for you, change the number in 'set root='(hd0,5)'' line to applicable one, using the guide at the top of the code. It is also good idea to mount your Kali Linux partition and ensure vmlinuz and initrd.img names are correct. Save the file as 'grub.cfg' and move it to 'Boot' folder on the EFI/Boot partition. Reboot.

    10. If you don't have rEFInd installed, remember to hold Alt/Option key when restarting. You will now have option to boot your Mac, Receovery HD and grubx64.efi. Chose the latter. If everything went well, GRUB menu will appear and after choosing Kali Linux your freshly installed system will boot succesfully. Enjoy!
    Last edited by KMLK; 2013-11-16 at 07:26. Reason: Typos.

  2. #2
    Join Date
    2013-Nov
    Location
    London
    Posts
    4
    Additional steps to take

    After no-networking installation some crucial repositories are not added to etc/apt/resources.list and you need to edit the file. Just open it in text editor, erase everything and paste the following;
    Code:
    deb http://http.kali.org/kali kali main non-free contrib
    deb http://security.kali.org/kali-security kali/updates main contrib non-free
    deb-src http://http.kali.org/kali kali main non-free contrib
    deb-src http://security.kali.org/kali-security kali/updates main contrib non-free
    If you don't want some programs/functions to malfuntion at some point, you should install GRUB to your Kali Linux partition. It still won't be visible, though (so you still need that small partition with GRUB files on it), but at some point it might just be useful. It is not adviseble to install GRUB to your whole drive. To install grub, just execute the following commands;
    Code:
    apt-get update
    apt-get install grub-efi
    grub-install /dev/partition with Kali
    update-grub2
    If you want your GRUB to be able to recognise other systems you have installed, navigate to /boot/grub and copy the grub.cfg file. Replace the old one on EFI/Boot partition with the one you just copied.

    If my instructions were useful - let me know! If something went wrong - post it and I will try my best to help. Good luck and thanks to bofh28 and blackbird for providing help in other threads - this tutorial was somewhat based on what they've written.

  3. #3
    Join Date
    2014-Jul
    Location
    The Great Lonestar State of Texas!
    Posts
    18

    Quote Originally Posted by KMLK View Post
    Additional steps to take

    After no-networking installation some crucial repositories are not added to etc/apt/resources.list and you need to edit the file. Just open it in text editor, erase everything and paste the following;
    Code:
    deb http://http.kali.org/kali kali main non-free contrib
    deb http://security.kali.org/kali-security kali/updates main contrib non-free
    deb-src http://http.kali.org/kali kali main non-free contrib
    deb-src http://security.kali.org/kali-security kali/updates main contrib non-free
    .......

    If my instructions were useful - let me know! If something went wrong - post it and I will try my best to help. Good luck and thanks to bofh28 and blackbird for providing help in other threads - this tutorial was somewhat based on what they've written.
    First of all, I wish to thank you so very much for all of the time and effort you had to have put into this project! I know from personal experience just what it takes to write such a piece.

    You seem to have hit the nail on the head when you created an "EFI workaround" for a Kali installation -- I have been having the same issue on my MacBook Pro 5.5 (mid 2009). In my case, though, I do not wish to retain OSX at all. Rather, I prefer a stand alone install of Kali on the MacBook. I decided this after NUMEROUS attempts at getting it to work as a dual boot. I must have put over 80 hours into trying to make it work -- documenting every step, every time, and comparing notes from each installation. I had no difficulty getting Ubuntu 14.04 LTS up and running with all drivers, etc., but I haven't been able to get Kali working to save my life.

    So, after installing and re-installing countless times (and attempting every trick in the book without success), I used Drive Genius to re-initialize the drive which gave me back my original GPT Disk configuration with its EFI partition and reinstalled firmware for the Startup Disk selection, etc.

    Now, I have a pristine GPT disk (without the MBR section embedded into the partition), an EFI partition and the rest is freespace.
    With that setup, I am up here cruzing the forums. I see a whole lot of Questions and very few answers...

    Anyway, my questions to you are:
    Kali has released a new version since you wrote this article.
    Will the above workaround still work as it is layed out above? Or, have the changes necessitated other methods to be used?

    If we could start an ongoing dialog I would really appreciate it. My own goal was that once I found the solution I would do as you have done and create a step-by-step for others to follow that found themselves banging their head on the table as I have done trying to get Kali to work on such a proprietary system.

    Please contact me at your earliest convenience through email at: roadrunner.caffiene@gmail.com
    I would love to hear any updates that you have before I begin my next phase of testing....
    Anxiously awaiting your reply; either here or through email.

    Many Warn Regards,
    RoadRunner TX

  4. #4
    Since the release of 1.0.8, Kali now has EFI support out of the box!
    For more information: http://www.kali.org/news/kali-1-0-8-...-boot-support/
    This is a Kali-Linux support forum - not general IT/infosec help.

    Useful Commands: OS, Networking, Hardware, Wi-Fi
    Troubleshooting: Kali-Linux Installation, Repository, Wi-Fi Cards (Official Docs)
    Hardware: Recommended 802.11 Wireless Cards

    Documentation: http://docs.kali.org/ (Offline PDF version)
    Bugs Reporting & Tool Requests: https://bugs.kali.org/
    Kali Tool List, Versions & Man Pages: https://tools.kali.org/

  5. #5
    Join Date
    2013-Nov
    Location
    London
    Posts
    4
    roadrunnerTX Sorry for late reply and thanks for kind words. I've honestly got no idea, I seriously hope g0tmi1l's right and Kali will work out of the box (it saves a lot of trouble!), but if not, I will experiment and play around with aforementioned workaround. I'm going to post the results here, in case they'd be of any use to anyone else, since I'm going to attempt and install at the beginning of the new week (id est on Monday). :-)

  6. #6
    Join Date
    2014-Jul
    Location
    The Great Lonestar State of Texas!
    Posts
    18
    Well, I got 1.0.8 dual booted on my Macbook Pro 5.5 using rEFInd. It actually wen't pretty smooth following your procedures.
    A few things of note:
    When it came time for installing grub, I just left the field blank and clicked continue.
    Next, I copied over the grub.cfg file, that Kali placed in the root (under /boot) over to the kaliefi partition I had created earlier. After seeing the set=root(hd0,gpt4) in their grub.cfg, I modified the grub.cfg file I had created from here. I also needed to add xdriver=nvidia to the execution line.
    Since I had created both a / and a /home partition, my / partition was gpt4
    Thus, my grub.cfg file wound up looking like this:
    ----------------------------------------------------------------------------------
    # Config file for GRUB2 - The GNU GRand Unified Bootloader
    # /boot/grub/grub.cfg

    # DEVICE NAME CONVERSIONS
    #
    # Linux Grub
    # -------------------------
    # /dev/fd0 (fd0)
    # /dev/sda (hd0)
    # /dev/sda1 (hd0,1)
    # /dev/sda2 (hd0,2)
    # /dev/sda3 (hd0,3)
    # /dev/sda4 (hd0,4)
    # /dev/sda5 (hd0,5)
    # /dev/sda6 (hd0,6)
    # /dev/sdb1 (hd1,1)
    # /dev/sdb2 (hd1,2)
    #
    # root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx persistent

    set menu_color_normal=white/blue
    set menu_color_highlight=black/white

    function load_video {
    insmod efi_gop
    insmod efi_uga
    insmod video_bochs
    insmod video_cirrus
    insmod all_video
    }

    load_video
    set gfxpayload=keep

    # Timeout for menu
    set timeout=5

    set default="1"
    set timeout=30

    set menu_color_normal=white/blue
    set menu_color_highlight=blue/white

    function load_video {
    insmod efi_gop
    insmod efi_uga
    insmod video_bochs
    insmod video_cirrus
    insmod all_video
    }

    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_gpt
    insmod ext2

    menuentry "Kali Linux" --class debian --class gnu-linux --class gnu --class os {
    set root='(hd0,gpt4)'
    search --fs-uuid --no-floppy --set=root fa53e71c-adc5-4db1-a782-f6f91cff74ca
    echo 'Loading Kali Linux...'
    linuxefi /boot/vmlinuz-3.14-kali1-amd64 root=UUID=fa53e71c-adc5-4db1-a782-f6f91cff74ca xdriver=nvidia ro quiet
    initrdefi /boot/initrd.img-3.14-kali1-amd64
    }
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    The last thing I did (maybe not necessary) was to copy over the device.map file from the /boot directory on the root partition.

    Works like a charm now!

    RoadrunnerTX

  7. #7
    Join Date
    2014-Jul
    Location
    The Great Lonestar State of Texas!
    Posts
    18

    1.0.8 does have EFI support, but ...

    Yes, 1.0.8 does have EFI support right out of the box but you can only boot to the non-efi version via DVD on a Macbook Pro 5.5 (mid 2009).

    Last night I saw this sticky: https://forums.kali.org/showthread.p...amp-Kali-Linux

    So, in essence, not much has changed for us. However, using this article by KLMK works fine with a few caveat's; which I outlined as a comment on the sticky.

    I am working on a solution to create a single, bootable USB (and a guide) that will allow someone with a screwed up "SuperDrive" to still get Kali installed as either a standalone or a dual-boot. Once the project is finished, all one will have to do is download the USB, boot from it and follow the guide on the USB itself.

    Wish me luck! When you have a MacBook Pro with 'premature eject-ulation' issues, getting through an installation is pure ****! lol

    Quote Originally Posted by g0tmi1k View Post
    Since the release of 1.0.8, Kali now has EFI support out of the box!
    For more information: http://www.kali.org/news/kali-1-0-8-...-boot-support/

  8. #8
    Join Date
    2013-Nov
    Location
    London
    Posts
    4
    Okay, so a little update. Even though Kali 1.0.8 is meant to come with EFI support, I still have to use the instructions above. Kali Installer has still got the issue with my network card (it doesn't connect to the Internet, although it does succesfully connect when Kali Live is booted) and without networking GRUB won't install and the partition with Kali won't be even visible. To make it work on MacBook Pro 7.1, I followed the same procedure I have described in this post, just changing the names of the kernel files. So, my advice for the owners of MacBooks would still be to try what works well for me, if their situation is similar to mine (i.e. if they don't wish to use networking whilst installing or their network card isn't recognized by installer).

  9. #9
    Join Date
    2014-Nov
    Posts
    6
    you know what i am losing my faith ,but i still believe there is always a way

  10. #10
    Join Date
    2014-Nov
    Posts
    6
    if you can see plz email me .
    3031174498@qq.com

  11. #11
    Join Date
    2014-Jul
    Location
    The Great Lonestar State of Texas!
    Posts
    18

    Installing on a Mac is NOT easy

    Quote Originally Posted by default.txt View Post
    if you can see plz email me .
    3031174498@qq.com
    I spent a LOT of time trying to get Kali installed on the one MacBook Pro that I have.
    I pulled my hair out! Each Mac is different and what I did non mine may not work on yours...

    I did several videos on YouTube. If that does not work for you then I am afraid that I don't know what else to tell you.
    Here is the link:
    *REMOVED*
    Last edited by g0tmi1k; 2014-12-09 at 14:41. Reason: No youtube
    RoadRunnerTX
    "If you are gonna break it -- the least you can do is 'break it like a pro!'

  12. #12
    Join Date
    2015-Feb
    Posts
    1
    Hi, will this work for retina?

  13. #13
    Join Date
    2014-Jul
    Location
    The Great Lonestar State of Texas!
    Posts
    18
    Quote Originally Posted by Maxain View Post
    Hi, will this work for retina?
    I'm sorry but I don't know...
    RoadRunnerTX
    "If you are gonna break it -- the least you can do is 'break it like a pro!'

Similar Threads

  1. Replies: 5
    Last Post: 2014-09-16, 10:15
  2. Dual boot OSX 10.9.1 & Kali linux on Macbook pro 7.1
    By Crix75ita in forum Installing Archive
    Replies: 2
    Last Post: 2014-07-21, 22:09
  3. Replies: 4
    Last Post: 2013-07-05, 18:43

Tags for this Thread

Posting Permissions

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