|
|
| Line 1: |
Line 1: |
| =Dual Boot Kali on OS X= | | =Dual Boot Kali on OS X= |
|
| |
|
| Following this guide: http://docs.kali.org/installation/kali-linux-dual-boot-on-mac-hardware
| | I had a bit of a hairy experience doing this, with some installation errors and a broken network connection, but everything ended up OK in the end. This page has the full details of the installation procedure: [[Dual Boot Kali on OS X]] |
| | |
| I'm running on a mid-2010 MacBook Pro (Model 7,1). | |
| | |
| First things first: download the image, and make a bootable USB.
| |
| | |
| ==Bootable USB Drive==
| |
| | |
| Following instructions here:
| |
| | |
| http://docs.kali.org/downloading/kali-linux-live-usb-install
| |
| | |
| After downloading the iso, check to make sure it's legit:
| |
| | |
| <pre>
| |
| $ cat kali-linux-1.1.0a-amd64.txt.sha1sum && openssl sha1 kali-linux-1.1.0a-amd64.iso
| |
| 2b8d2db20e2709c5e9e0f9f9bbd8606c9b9e729f kali-linux-1.1.0a-amd64.iso
| |
| SHA1(kali-linux-1.1.0a-amd64.iso)= 2b8d2db20e2709c5e9e0f9f9bbd8606c9b9e729f
| |
| </pre>
| |
| | |
| I ran this command once without the USB drive plugged in, and once with the USB plugged in:
| |
| | |
| <pre>
| |
| $ diskutil list
| |
| </pre>
| |
| | |
| I found my disk at /dev/disk2. I unmounted it with
| |
| | |
| <pre>
| |
| $ diskutil unmountDisk /dev/disk2
| |
| </pre>
| |
| | |
| Then I formatted the USB drive with:
| |
| | |
| <pre>
| |
| $ sudo dd if=kali-linux-1.1.0a-amd64.iso of=/dev/disk2 bs=1m
| |
| </pre>
| |
| | |
| Give it a good 20 minutes or so...
| |
| | |
| <pre>
| |
| 2921+1 records in
| |
| 2921+1 records out
| |
| 3063349248 bytes transferred in 762.810003 secs (4015875 bytes/sec)
| |
| </pre>
| |
| | |
| And that's all folks, now the USB drive is bootable.
| |
| | |
| ==Installing rEFInd==
| |
| | |
| Back to this guide: http://docs.kali.org/installation/kali-linux-dual-boot-on-mac-hardware
| |
| | |
| To install rEFInd, the boot loader for OS X, I ran:
| |
| | |
| <pre>
| |
| $ curl -s -L http://sourceforge.net/projects/refind/files/0.8.3/refind-bin-0.8.3.zip -o refind.zip
| |
| $ unzip refind.zip
| |
| $ cd refind-bin*
| |
| </pre>
| |
| | |
| and finally,
| |
| | |
| <pre>
| |
| $ sudo bash install.sh
| |
| Installing rEFInd on OS X....
| |
| Installing rEFInd to the partition mounted at //
| |
| Copied rEFInd binary files
| |
| | |
| Copying sample configuration file as refind.conf; edit this file to configure
| |
| rEFInd.
| |
| | |
| | |
| WARNING: If you have an Advanced Format disk, *DO NOT* attempt to check the
| |
| bless status with 'bless --info', since this is known to cause disk corruption
| |
| on some systems!!
| |
| | |
| | |
| Installation has completed successfully.
| |
| </pre>
| |
| | |
| | |
| ==Booting Into Kali==
| |
| | |
| Now that we have installed rEFInd, we can insert our USB key and hold down the option key when rebooting to get the first boot menu:
| |
| | |
| [[Image:Boot1.jpg|500px]]
| |
| | |
| |When we do that we get the Mac menu. We can select the EFI drive, which is our Mac hard drive. Now we will see the rEFInd menu:
| |
| | |
| [[Image:Boot2.jpg|500px]]
| |
| | |
| If we pick the boot from legacy OS FAT 32 option, it will boot Kali Linux from the USB drive:
| |
| | |
| [[Image:Boot3.jpg|500px]]
| |
| | |
| This will allow us to boot into Kali Linux Live mode and install Kali Linux from there. When we pick the black and white windows flag it will boot into Kali live mode. | |
| | |
| ==Install Kali==
| |
| | |
| To install Kali, pick the installation option from the Kali boot menu.
| |
| | |
| [[Image:Boot4.jpg|500px]] | |
| | |
| Now you'll go through the installation process with Kali Linux, and it will be pretty straightforward:
| |
| | |
| [[Image:Boot5.jpg|500px]]
| |
| | |
| You'll have to partition your disk space:
| |
| | |
| [[Image:Boot6.jpg|500px]]
| |
| | |
| And keep rolling on through the installation process:
| |
| | |
| [[Image:Boot7.jpg|500px]]
| |
| | |
| ===If You Run Into Errors===
| |
| | |
| I ran into the error below while installing Kali. I had to restart the installation process, but the second time around it went okay. So if you run into an error like this, just give it another go!
| |
| | |
| [[Image:Boot8error.jpg|500px]]
| |
| | |
| ==Fixing Grub==
| |
| | |
| Once I finished with the installation, I restarted the computer, and held down the option key. I picked boot into legacy OS on FAT system again, and booted into the Kali Linux live mode again. From there, I needed to convert the master boot record to a hybrid boot record, to make it possible to boot from grub on the Kali Linux partition. (If we skip this step, the Kali partition is not bootable.)
| |
| | |
| After logging into the Live mode Kali LInux, run the following commands as root:
| |
| | |
| <pre>
| |
| root@kali:~# gdisk /dev/sda
| |
| | |
| Partition table scan:
| |
| MBR: protective
| |
| BSD: not present
| |
| APM: not present
| |
| GPT: present
| |
| | |
| Found valid GPT with protective MBR; using GPT.
| |
| | |
| Command (? for help): p
| |
| Disk /dev/sda: 976773168 sectors, 465.8 GiB
| |
| Logical sector size: 512 bytes
| |
| Disk identifier (GUID): 1B3DB3D4-ECFD-47A1-9435-F2FF318C2F55
| |
| Partition table holds up to 128 entries
| |
| First usable sector is 34, last usable sector is 976773134
| |
| Partitions will be aligned on 8-sector boundaries
| |
| Total free space is 245 sectors (122.5 KiB)
| |
| | |
| Number Start (sector) End (sector) Size Code Name
| |
| 1 40 409639 200.0 MiB EF00 EFI System Partition
| |
| 2 409640 548413439 261.3 GiB AF00 Macintosh
| |
| 3 975503592 976773127 619.9 MiB AB00 Recovery HD
| |
| 4 548413440 548415487 1024.0 KiB EF02
| |
| 5 548415488 958138367 195.4 GiB 0700
| |
| 6 958138368 975503359 8.3 GiB 8200
| |
| | |
| Command (? for help): r
| |
| | |
| Recovery/transformation command (? for help): h
| |
| | |
| WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
| |
| just hit the Enter key at the below prompt and your MBR partition table will
| |
| be untouched.
| |
| | |
| Type from one to three GPT partition numbers, separated by spaces, to be
| |
| added to the hybrid MBR, in sequence: 5
| |
| Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): y
| |
| | |
| Creating entry for GPT partition #5 (MBR partition #2)
| |
| Enter an MBR hex code (default 07): 83
| |
| Set the bootable flag? (Y/N): y
| |
| | |
| Unused partition space(s) found. Use one to protect more partitions? (Y/N): n
| |
| | |
| Recovery/transformation command (? for help): w
| |
| | |
| Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
| |
| PARTITIONS!!
| |
| | |
| Do you want to proceed? (Y/N): y
| |
| OK; writing new GUID partition table (GPT) to /dev/sda.
| |
| The operation has completed successfully.
| |
| root@kali:~#
| |
| </pre>
| |
|
| |
|
| | See below for my network errors adventure. |
|
| |
|
| =Network Errors= | | =Network Errors= |
|
| |
|
| After booting into Kali, I had no ability to reach the internet.
| | For the full rundown of the errors that I experienced (basically, a broken network), the cause (stale information on the network router cache), and the solution (dropping the existing connection), see this page: [[Kali Network Debugging]] |
| | |
| <pre>
| |
| $ ping google.com
| |
| ping: unknown host: google.com
| |
| </pre>
| |
| | |
| I was sitting on a small network on a wireless router, with another installation of Kali Linux also on the network and able to get out to the internet. So, the problem was with the laptop running Kali Linux.
| |
| | |
| First thing to check is the IP address.
| |
| | |
| ==IP Address==
| |
| | |
| ===ifconfig===
| |
| | |
| I could see my ip address with
| |
| | |
| <pre>
| |
| $ ifconfig
| |
| </pre>
| |
| | |
| and I could type 10.0.0.1 into a browser and connect to my router. But I couldn't get past the router. I tried resetting the eth0 network interface:
| |
| | |
| <pre>
| |
| $ ifconfig eth0 down
| |
| $ ifconfig eth0 up
| |
| </pre>
| |
| | |
| No such luck. Still couldn't reach the outside.
| |
| | |
| <pre>
| |
| $ ping -c 4 google.com
| |
| ping: could not reach host: google.com
| |
| </pre>
| |
| | |
| ===network-manager===
| |
| | |
| Also tried restarting the network manager service:
| |
| | |
| <pre>
| |
| $ service network-manager restart
| |
| </pre>
| |
| | |
| But no luck there.
| |
| | |
| ===dhclient===
| |
| | |
| I tried using dhclient to obtain a new IP address for eth0:
| |
| | |
| <pre>
| |
| dhclient -v eth0
| |
| </pre>
| |
| | |
| but this simply acquired a new IP address from the router that was the same as the old IP address.
| |
| | |
| Still no luck.
| |
| | |
| ==Gateway==
| |
| | |
| The next thing to check was the gateway. Since I could reach my router, which is my gateway, I figured this was okay, but checked anyway.
| |
| | |
| ===route===
| |
| | |
| I used route to check the current routing path:
| |
| | |
| <pre>
| |
| $ route -n
| |
| </pre>
| |
| | |
| This showed that my gateway was 10.0.0.1, and my subnet was 255.255.255.0, as expected.
| |
| | |
| Nothing to see here.
| |
| | |
| ==DNS==
| |
| | |
| ===resolvconf===
| |
| | |
| I suspected that the problem with reaching the host had something to do with DNS. The resolvconf file, in <code>/etc/resolv.conf</code>, lists a couple of <code>nameserver</code> entries. If an IP address is listed as a nameserver, it means that server is providing you with DNS information. Because ping was returning "unknown host", I suspected this was due to a DNS error.
| |
| | |
| In the resolvconf file were some nameservers added automatically by the network manager:
| |
| | |
| <pre>
| |
| nameserver 75.75.75.75
| |
| nameserver 75.75.76.76
| |
| </pre>
| |
| | |
| Okay, these seem fine. But they don't work.
| |
| | |
| I tried a couple of other pairs:
| |
| | |
| OpenDNS: 208.67.222.222 and 208.67.220.220
| |
| | |
| Google: 8.8.8.8 and 8.8.4.4
| |
| | |
| None of these led to any changes.
| |
| | |
| ===hosts===
| |
| | |
| Just in case, I checked /etc/hosts for anything unusual, but all I saw were the loopback interfaces for 127.0.0.1/localhost.
| |
| | |
| ==Connection==
| |
| | |
| ===ping====
| |
| | |
| The next step, at this point in debugging, is to run ping to see if you can connect to anything. But that's exactly the problem...
| |
| | |
| If ping returns "unknown host" it indicates an issue with the DNS address.
| |
| | |
| If ping returns "destination host unreachable", you have a DNS route or gateway address issue.
| |
| | |
| So, at this point I was completely stumped.
| |
| | |
| ==Digging Deeper==
| |
| | |
| I really didn't want to have to spend another 2-3 hours reinstalling Kali just because of some dumb network configuration that I had screwed up, so I kept digging...
| |
| | |
| ===Using Router for DNS===
| |
| | |
| At this point, I knew I was dealing with a DNS issue - ping was returning "destination host unreachable," I couldn't reach Google.com, but I could reach any computer inside the network.
| |
| | |
| I also knew I was dealing with a DNS issue between my laptop and the router - since I knew that the DNS service worked fine for the other Kali Linux desktop running on the local network.
| |
| | |
| I started by forcing the DNS server to be the router itself:
| |
| | |
| <pre>
| |
| $ echo "nameserver 10.0.0.1" > /etc/resolv.conf
| |
| </pre>
| |
| | |
| Then I gave ping another try:
| |
| | |
| <pre>
| |
| $ ping linux.org
| |
| PING linux.org (107.170.40.56) 56(84) bytes of data.
| |
| | |
| </pre>
| |
| | |
| At this point, we had SOME success - the router worked as a DNS server, and we were able to successfully turn a domain name (linux.org) into an IP address. But we still had a problem: ping wasn't actually returning anything. Everything was being dropped.
| |
| | |
| ===Network Dropping Everything===
| |
| | |
| Okay, now the problem was that the network was dropping everything. I had no idea what was going on.
| |
| | |
| I rebooted into Mac OS X. I left the network cable plugged in. I got to the desktop, and opened a browser, and typed linux.org.
| |
| | |
| It said "Connecting to host..."
| |
| | |
| and nothing.
| |
| | |
| ===Wireless Network Not Dropping Everything===
| |
| | |
| I pulled out the network cable and hit refresh - and there it was! Linux.org!
| |
| | |
| Something very fishy was going on with the ethernet wire I was using.
| |
| | |
| ===Changing Wired Cable and Port===
| |
| | |
| At this point, I tried switching ethernet cables and ports with the Kali Linux desktop that I knew was working. This cable was guaranteed to work, this port was guaranteed to work.
| |
| | |
| I rebooted into Kali, and tried to ping google.com and linux.org.
| |
| | |
| Nothing.
| |
| | |
| ==The Clues==
| |
| | |
| Here are the clues we have:
| |
| * The problem is particular to the connection between my laptop and my router.
| |
| * (Wireless wasn't working in Kali.)
| |
| * Ethernet problems in Kali showed up in Mac, too (couldn't find a route to the host).
| |
| * Wireless works ok in Mac, so it isn't a problem with the laptop itself.
| |
| * Another computer on the network works, so it isn't a problem with the router itself.
| |
| | |
| With all of these clues, I determined that the problem was with THE MAC ADDRESS OF MY MAC LAPTOP'S WIRED PORT.
| |
| | |
| So anytime I tried to connect, FROM my laptop's wired network port, TO the router, using any cable or any port, the problem would arise.
| |
| | |
| ==The Solution==
| |
| | |
| I opened the router's configuration page in a browser at 10.0.0.1 and logged in.
| |
| | |
| I released the network address for my wired mac laptop connection (it was plugged into the network - remember, I could access 10.0.0.1 and the whole subnet just fine using the wired connection).
| |
| | |
| I refreshed the router configuration page.
| |
| | |
| I got a new IP address.
| |
| | |
| I opened a browser window and typed "Linux.org". Voila! Linux.org came up! The wired router connection now worked!
| |
| | |
| It just came down to some crud in the network cache.
| |
| | |
| | |
| | |
| | |
| | |
| | |
|
| |
|
|
| |
|
| [[Category:Kali]] | | [[Category:Kali]] |