Results 1 to 13 of 13

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

Threaded View

Previous Post Previous Post   Next Post Next Post
  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.

Similar Threads

  1. Replies: 3
    Last Post: 2023-01-27, 16:41
  2. Replies: 0
    Last Post: 2020-11-24, 11:54
  3. Replies: 5
    Last Post: 2014-09-16, 10:15
  4. 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
  5. 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
  •