jsciamms
Posts: 44
Joined: Wed Jul 01, 2020 2:11 am

RPI4 Kali 2020 USB Boot

Wed Jul 08, 2020 1:23 am

====== UPDATE 08Jul2020 ==========

I missed a very important step. You need to copy the *.dat and *.elf files from the most recent raspberry pi firmware on github https://github.com/raspberrypi/firmware ... aster/boot.

I have added the appropriate step.

================================

I have successfully gotten Kali to boot on the pi4 4GB using USB only. To get it working, what you need to do is:

1) Download most recent Kali linux for RPI4 at https://www.offensive-security.com/kali ... rm-images/

2) Flash the image to a usb drive (USB SSD is nice, but any usb drive compatible with the RPI4 will work)

3) Copy the *.elf and *.dat files from the raspberry pi github page to use the most recent firmware.

https://github.com/raspberrypi/firmware ... aster/boot

(Also note that you must have already updated the eeprom on the raspberry pi 4 to at least the most current stable release. The beta is not necessary, but the critical release will not work. If you do not know how to do this see https://www.raspberrypi.org/documentati ... teeprom.md)

4) Modify the cmdline.txt to be as follows:

Code: Select all

dwc_otg.fiq_fix_enable=2 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/sda2 rootfstype=ext3 rootwait rootflags=noload net.ifnames=0
5) You must mount the root file system on a computer. If someone can find a better way of doing this, or a better process overall, please post it. You need to edit the fstab file to change the mounting points of the root directory and boot partition.

Once the file system has been mounted on your computer (ie the larger partition of the usb drive that you just imaged), open the etc/fstab file, and edit it to look like this:

Code: Select all

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults          0       0
/dev/sda1  /boot           vfat    defaults          0       2
/dev/sda2  /               ext3    defaults,noatime  0       1
6) Format an SD card, and leave it with an empty ext3 partition. Insert this SD card into the raspberry pi for the initial boot. If you do not do this you will get an error stating that MMC0 timed out.

7) Boot up, and let it run its course. Once you get to the login, the default user is kali and the password is also kali.

8) Update the system, and shutdown. Now you can remove the SD card, and you are good to go with Kali booting off just USB.

For whatever reason, and I am sure someone smarter than me will know, or can figure it out, but Kali on the RPI4 is looking for an SD card on the initial boot. I vaguely remember that USB booting on the RPI3b+ also required you to have an SD card present.

Please enjoy :D

If someone finds something that breaks this, please let me know. So far, I am several hours running and 2 updates, as well as several application installs, and there are no issues. It doesn't run as fast as I was hoping it would, but hey, its booting off USB 3, so I'll take it.
Last edited by jsciamms on Wed Jul 08, 2020 2:09 pm, edited 1 time in total.

kealanspud
Posts: 1
Joined: Mon Jul 06, 2020 12:30 pm

Re: RPI4 Kali 2020 USB Boot

Wed Jul 08, 2020 11:22 am

Hey,

I was wondering if you could help me on my project on GitHub: https://github.com/kealanspud/linux-mint-arm64
What is happening is that the boot sequence does not work with the modified init script. Please help and also :P good post.

jsciamms
Posts: 44
Joined: Wed Jul 01, 2020 2:11 am

Re: RPI4 Kali 2020 USB Boot

Wed Jul 08, 2020 1:38 pm

I’ll check it out after work today.

jsciamms
Posts: 44
Joined: Wed Jul 01, 2020 2:11 am

Re: RPI4 Kali 2020 USB Boot

Thu Jul 09, 2020 3:09 am

kealanspud wrote:
Wed Jul 08, 2020 11:22 am
Hey,

I was wondering if you could help me on my project on GitHub: https://github.com/kealanspud/linux-mint-arm64
What is happening is that the boot sequence does not work with the modified init script. Please help and also :P good post.
I'm not much of a Linux Mint user, but how did you create this setup? Have you had a working boot prior to now? Do you have an image of the previously working system?

Sn0wCr45h
Posts: 8
Joined: Sat May 16, 2020 7:37 pm

Re: RPI4 Kali 2020 USB Boot

Fri Aug 21, 2020 2:26 am

Thanks for this guide!

Was looking for something to help get Kali running on an SSD.

I've run into a few problems and was wondering if you had experience anything similar.

If I flash the Kali image onto an SSD, make the config changes you listed and boot with an empty SD formatted to EXT3 I get so far through the Kali loading process and then end up hanging on a flashing cursor. No apparent error message.

If I get a working Kali image from an install on an SD card and image it onto the SSD, then make the config changes you list I can get it to boot but I get some disk checking errors during the boot process and then a complaint about SDHCI register dump, then waiting for hardware command interrupt, hit escape and it carries on booting... It does get into the OS though and feels super smooth once it's there, but there's defiantly some errors and I think it purely because it wasn't installed directly onto the SSD.

Running this on a Pi 4 8GB & the SATA to USB chipset is known to be supported.

daemons
Posts: 2
Joined: Thu Oct 15, 2020 11:23 pm

Re: RPI4 Kali 2020 USB Boot

Sun Oct 25, 2020 4:55 am

Does anyone have the steps to do this from the Kali GUI or command line? I'm new to all of this and it sounds very technical. I was able to USB boot my Twister OS but I don't know how to do it for Kali, I figured I would need to find a way to get raspi-config?

lmarre
Posts: 1
Joined: Fri Oct 30, 2020 2:02 am

Re: RPI4 Kali 2020 USB Boot

Fri Oct 30, 2020 2:14 am

hey Jsciamms

good tutorial but i get confused when you get to mount the root file to the computer.I a newbie i did not get that .could you please explain better or type what i will need to do? thanks any help will be appreciated.

Phoenixbyrd
Posts: 102
Joined: Wed Jun 19, 2019 4:12 pm

Re: RPI4 Kali 2020 USB Boot

Fri Oct 30, 2020 2:17 am

Kali should not be used as a daily driver anyways. You can boot kali up within Twister OS using vdesktop. It runs just the same as if it were booted directly on the pi.
Check outTwister OS: https://twisteros.com/
Join the Twister OS Discord Server: https://discord.gg/Fh8sjmu

lewix
Posts: 1
Joined: Wed Jun 05, 2019 1:11 pm

Re: RPI4 Kali 2020 USB Boot

Sun Nov 08, 2020 8:51 am

Yes it works!
Thanks :)

kevin.shumaker
Posts: 14
Joined: Fri Sep 14, 2018 3:46 pm

Re: RPI4 Kali 2020 USB Boot

Tue Dec 22, 2020 7:29 pm

It would be nice if someone could update the image for at least the Pi4. I get the error 'need newer software', which is common, I just manually update the .elf & .dat files, but it indicates it hasn't been updated in quite a while.

fruitoftheloom
Posts: 27225
Joined: Tue Mar 25, 2014 12:40 pm

Re: RPI4 Kali 2020 USB Boot

Tue Dec 22, 2020 7:40 pm

kevin.shumaker wrote:
Tue Dec 22, 2020 7:29 pm
It would be nice if someone could update the image for at least the Pi4. I get the error 'need newer software', which is common, I just manually update the .elf & .dat files, but it indicates it hasn't been updated in quite a while.

You need to ask Kali, they have a support forum:

https://forums.kali.org/
Take what I advise as advice not the utopian holy grail, and it is gratis !!

noxferatu
Posts: 1
Joined: Thu Dec 31, 2020 7:41 am

Re: RPI4 Kali 2020 USB Boot

Thu Dec 31, 2020 7:54 am

I am unable to boot to Kali on a USB drive after following the instructions in this post. I’ve confirmed booting to the drive works with the official Raspberry PI OS.

When I attempt to boot, the process gets to “random:crng init done” and proceeds no further.

Any tips would be greatly appreciated.

CouruDavance
Posts: 2
Joined: Sat Feb 06, 2021 1:00 am

Re: RPI4 Kali 2020 USB Boot

Sat Feb 06, 2021 1:20 am

To solve errors like “random:crng init done” or if hang on boot or whatever.
You must grab the .dat and .elf files from a May 22, 2020 commit on the raspberrypi/firmware GitHub repo.
--> The latest firmware does not work. <-
This is the right commit :
:arrow: https://github.com/raspberrypi/firmware ... 2f1b33f642

Optionally to complete this tutorial
Use the new syntax (like in the latest raspbian os) In cmdline.txt replace root=/dev/sda2 by root=PARTUUID=nnnnnnnn-02
You will find the nnnnnnnn with the command 'blkid /dev/sdx' (/dev/sdx your usb pendrive)
In the /etc/fstab replace /dev/sdx(1|2) by PARTUUID=nnnnnnnn-0(1|2)

CouruDavance
Posts: 2
Joined: Sat Feb 06, 2021 1:00 am

Re: RPI4 Kali 2020 USB Boot

Sat Feb 06, 2021 9:23 am

To solve errors like “random:crng init done” or if hang on boot or whatsover.
You must grab the .dat and .elf files from a May 22, 2020 commit on the raspberrypi/firmware GitHub repo.
--> The latest firmware does not work. <-
This is the right commit :
:arrow: https://github.com/raspberrypi/firmware ... 2f1b33f642

Optionally to complete this tutorial
Use the new syntax (like in the latest raspbian os) In cmdline.txt replace root=/dev/sda2 by root=PARTUUID=nnnnnnnn-02
You will find the nnnnnnnn with the command 'blkid /dev/sdx' (/dev/sdx your usb pendrive)
In the /etc/fstab replace /dev/sdx(1|2) by PARTUUID=nnnnnnnn-0(1|2)

Return to “Other”