Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

added networking files and /dev/pts for ubuntu linux #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions kali-chroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ ! -x /bin/vmware-mount ]; then
fi

# variables
kali_vmdk="/home/doomguy/VMs/Kali-Linux-2.0.0-vm-amd64/Kali-Linux-2.0.0-vm-amd64.vmdk"
kali_vmdk="/media/ubuntu/316e1560-2591-4978-aaea-842189cb1dd2/kali-linux-2024.1-vmware-amd64.vmwarevm/kali-linux-2024.1-vmware-amd64.vmdk"
mnt_path="/mnt/kali"

if [ ! -x $mnt_path ]; then
Expand All @@ -43,6 +43,12 @@ if [ "$1" = "start" ]; then
[ -z "$(mount | grep $mnt_path/proc)" ] && /bin/mount -t proc proc $mnt_path/proc/
[ -z "$(mount | grep $mnt_path/sys)" ] && /bin/mount -t sysfs sys $mnt_path/sys/
[ -z "$(mount | grep $mnt_path/dev)" ] && /bin/mount -o bind /dev $mnt_path/dev/
#this line fixes pts error uncomment if you encounter it
#[ -z "$(mount | grep $mnt_path/dev/pts)" ] && /bin/mount -o bind /dev/pts/ $mnt_path/dev/pts
cp /etc/resolv.conf $mnt_path/etc/resolv.conf # copy nameservers
cp /etc/hosts $mnt_path/etc/hosts # copy hosts file



# change to new root
chroot $mnt_path
Expand All @@ -55,8 +61,9 @@ if [ "$1" = "stop" ]; then
echo "Stopping Kali chroot.."
/bin/umount $mnt_path/proc/
/bin/umount $mnt_path/sys/
#/bin/umount $mnt_path/dev/pts
/bin/umount $mnt_path/dev/
/bin/vmware-mount -x

echo "all done!"
fi
fi