Installing kali linux via sysutils/debootstrap fails

I recently installed security/metasploit, but there's an issue which currently prevents it from running on FreeBSD. I then read that it comes built-in to Kali Linux, and furthermore that Kali can be installed via sysutils/debootstrap. So, I installed sysutils/debootstrap. Based on the instructions on the "LinuxJails" page on the FreeBSD Wiki, and seeing that there's a kali script in /usr/local/share/debootstrap/scripts, I executed what I think to be the command to install Kali, but got an error:

Code:
# debootstrap kali /stuff/compat/kali/
I: Keyring file not available at /usr/local/share/keyrings/kali-archive-keyring.gpg; switching to https mirror https://deb.debian.org/debian
I: Retrieving InRelease
I: Retrieving Release
E: Failed getting release file https://deb.debian.org/debian/dists/kali/Release
#

Looking at the contents of https://deb.debian.org/debian/dists/ shows that there is no kali subdirectory, so that's the immediate explanation for the error, but it's not clear to me whether the subdirectory should be there or else if the script is just out of date, and in either case, what's to be done about it.

I saw that in /usr/local/share/debootstrap/scripts are also a few other kali-related things: kali-dev, kali-last-snapshot, and kali-rolling. However, these are just simlinks to kali.

I am unsure how to proceed. Does anyone have any ideas? Thanks.
 
the debootstrap script are in

Code:
/usr/local/share/debootstrap/scripts/

if you look in that directory you will see these 4 items

kali
kali-dev
kali-last-snaphot
kali-rolling

Code:
  -rw-r--r-- 1 root wheel  553 Apr 10  2024 kali
  lrwxr-xr-x 1 root wheel    4 Jul 13  2022 kali-dev -> kali
  lrwxr-xr-x 1 root wheel    4 Jul 13  2022 kali-last-snapshot -> kali
  lrwxr-xr-x 1 root wheel    4 Jul 13  2022 kali-rolling -> kali

these 3 are symlinks to kali
kali-dev
kali-last-snaphot
kali-rolling

and this is the contents of the kali debootstrap script

Code:
mirror_style release
download_style apt
finddebs_style from-indices
variants - buildd fakechroot minbase
keyring /usr/local/share/keyrings/kali-archive-keyring.gpg
default_mirror http://http.kali.org/kali

# include common settings
if [ -e "$DEBOOTSTRAP_DIR/scripts/debian-common" ]; then
 . "$DEBOOTSTRAP_DIR/scripts/debian-common"
elif [ -e /debootstrap/debian-common ]; then
 . /debootstrap/debian-common
elif [ -e "$DEBOOTSTRAP_DIR/debian-common" ]; then
 . "$DEBOOTSTRAP_DIR/debian-common"
else
 error 1 NOCOMMON "File not found: debian-common"
fi

the kali script uses the debian-common script

Code:
/usr/local/share/debootstrap/scripts/debian-common

i had issues with with debian and ubuntu scripts

Kali linux only has iso download which you cant extract into a jail

you need a tar.gz you can extract into a jail instead

what you can do is use the ubuntu-base-24.10-base-amd64.tar.gz
and extract that into a jail and then install metasploit

here how i create a ubuntu 24.10 jail using ubuntu-base-24.10-base-amd64.tar.gz


if you want to use a kali linux iso the only option is to create vm using bhyve
but if you want to use a gpu with the vm you would need to pass the gpu through to the vm

but you need 2 gpus to do that
1 for the freebsd host, and another one to pass through to the vm

the best option may be to create a ubuntu jail as i described
and then install metasploit on ubuntu

if you look in the kali script you will see this line

Code:
default_mirror http://http.kali.org/kali

i think you can add the kali mirrors to an ubuntu system


and then install metasploit

however the syntax for adding repositories in ubuntu has changed from previous version

so you will need to check the command to add the kali mirrors to ubuntu
 
Back
Top