Skip to main content

How to Daily Drive Kali without Daily Driving Kali

·1575 words·8 mins·
Table of Contents

Preamble
#

As I began studying for the eJPT using TryHackMe rooms, I realized I didn’t need the GUI for kali linux as it made me more inefficient since i would have to start the virtual machine then login and then wait for the desktop environment to load and then navigate using the mouse to the tool i want use or to just open the terminal so i began to think about creating a way to get access to the kali terminal on my host machine i pondered about using serial for communication ,using nc to practically code inject into my own machine but then suddenly it dawned on me SSH that would solve my efficiency woes and wouldn’t be that hard to setup. so this guide will teach You how!

Requirements
#

  • USB Drive at least 8GB
  • Computer

How to
#

Creating a bootable USB Drive
#

Download your Bootable USB Creators of choice If you are on windows I suggest using rufus on any other OS I suggest balenaEtcher if you will be distro hopping you can’t go wrong with Ventoy Then Download your Distro of choice ISO whilst fedora is my go-to , i suggest beginners use a Debian based distro like Linux Mint or any other Debian / Ubuntu based Distro the thing that matters most when choosing your Distro; isn’t the distro itself but what DE(Desktop Environment) you prefer as these will decide the look, feel and how you do most of the things in linux if you are a windows user and like the windows navigation i suggest KDE / Cinnamon but if you prefer the MacOS way of doing things I suggest Gnome now to get off this quick tangent let’s get back to the tutorial after the download is finished run rufus or balenaEtcher and burn that iso into your Drive

Make sure that what the drive you’re burning is your usb and not another drive as it will wipe whatever is in that drive

Rufus Setup
#

After you enter the rufus website scroll to download and then download the edition for you want i suggest downloading the portable application instead of the installer after you download/install the application run it and this will be the interface in front of you

rufus UI
first select your USB drive in the device selector after that click on the SELECT to the right of yo

Windows Setup
#

you can skip the guessing of what F-key opens the bios by holding shift whilst hitting the restart button in the start menu

a Windows Start Menu cropped to only the bottom left corner with a red border on the power button
this will open the Windows Advanced startup menu
screenshot: in Windows Advanced startup menu
in the windows recovery menu click on troubleshoot after that
screenshot: in Windows TroubleShooting Menu
Click on Advanced Options
screenshot: in Windows Advanced Options Menu
in the Advanced Options Menu Click on the UEFI Firmware button and that should take you to your bios
screenshot: in Windows UEFI Firmware

Secure boot is an important security Feature don’t forget to reenable it after you are done with the installation process
this will place you in the bios first you should disable secure boot as sometimes it doesn’t like the usb drive after that check for VT-D or VT-x settings it may also be called SVM and enable it also if you see IOMMU you should also enable that or just enable anything that says virtualization Motherboard manufacturers hate consistency then after doing that boot into your flash drive

Booting into linux
#

First check to see what button gets you into the boot menu of your computer F9 is usually what i’ve seen How to Check:

  • Look at the booting process and see if it mentions a key to either pause or change boot devices (Usually on the corners of the screen)
  • Google your Laptops model followed by “boot loader key” and it should be near the top After you enter the boot menu choose your USB drive to boot into if you used ventoy you should get the ventoy GUI otherwise you would be booted directly into your installer/Live Environment The Rest is Easy if you’ve ever installed any operating system

now to go into the slightly complex bit

Linux Setup
#

In this Tutorial anything in a command that is preceded by a “$” is something you have to fill in
Now that you are in linux or if you already had linux installed we will begin by checking if the your CPU supports Virtualization or if the Virtualization bios settings are disabled

egrep -c '(vmx|svm)' /proc/cpuinfo

if the output is 0 that means your CPU either doesn’t support Virtualization or the settings wasn’t enabled in the bios if the output is 1 or more that means you can continue with the tutorial after that i suggest downloading the qemu Pre-built Virtual Machines from kali and extract it into a VM directory either through the gui or the cli

mkdir ~/VMs \
cd ~/VMs \
7z x $ArchiveName

or you can use whatever is used in your desktop environment i use ARK With your Linux environment ready, the next step is setting up a virtual machine for Kali

Virtual Machine Setup
#

if you want a gui interface i suggest virt-manager install it using your Distros Package graphical package manager you should be able to find it if you search for virt-manager

These Steps May differ based on your distro so i suggest going to that distros page on how to setup virtualization and also these steps may not be needed if you use your graphical package manager
if you are in fedora there is an easy way to do it through the CLI using this command

sudo dnf install @virtualization

then enable the service using this command

sudo systemctl start libvirtd \
sudo systemctl enable libvirtd

in virt-manager click on Create a new Virtual Machine

Screenshot: In Virtual Machine Manager, click ‘Create a new Virtual Machine’ (arrow indicates the button).
and then Import and Existing Disk image
Screenshot: In Virtual Machine Manager, click “import existing disk image” radio selector (arrow indicates the correct choice)

and then select under choose the operating system you are installing “debian testing” and then click on browse

Screenshot: In Virtual Machine Manager, click  and fill in operating system input box then click browse button
and then browse local
Screenshot: In Virtual Machine Manager, with an arrow pointing to browse local button
yours should look different as you haven’t added the VMs directory we made whilst i already had done that so now that you are on browse local you can either input the path directly and press enter or navigate to your VMs Directory it should be in your home folder and you should find in the directory your qcow2 file select it and press open in the top right of your screen if you are in a LTR Theme of your DE
Screenshot: In Virtual Machine Manager ; popup file browser, with 2 arrows one pointed to the navbar/input box and the other to the done button

Tip: You can always adjust the RAM and CPU allocation for your virtual machine via Virtual Machine Manager. This flexibility is great for handling more intensive workloads.
after that you just setup the ram and cpu of the VM it depends on what workloads you run , for me i allocate 6 Cores and 4Gb of ram
Screenshot: In Virtual Machine Manager, at the Setup screen where you can set ram and cpu

and lastly you just name your VM

Screenshot: In Virtual Machine Manager, Summary containing a input box for naming the created VM
With the virtual machine set up, let’s now configure SSH for efficient remote access

SSH Setup
#

then after setting up your virtual machine on virt-manager go on the gui of it enable ssh server on your kali VM and make note of the ip

sudo systemctl start ssh \
sudo systemctl enable ssh \
sudo systemctl status ssh \
ip a

Then Switch to your host and see if you are able to connect using the VM’s IP

ssh kali@kalivmip

you should now see a password prompt

the default password is “kali”
but we are doing this for efficiency and is it efficient to type in our password every time hell no so we setup key pair based authentication so let’s logout of our ssh session using Ctrl+A+D and run these commands to get some ssh keys

ssh-keygen -t ed25519 -C "KaliVM"

and then to copy the public key to our VM

ssh-copy-id -i ~/.ssh/$KeyFile.pub kali@kalivmip

now we get back to our VM and change the sshd config a bit

PasswordAuthentication yes
PubkeyAuthentication no

we’ll change these 2 to be switched so

PasswordAuthentication no
PubkeyAuthentication yes

now let’s go back to our hosts and connect to our VM using ssh

ssh -i ~/.ssh/$PrivateKeyFile kali@$kalivmip

if you connect that’s good if you don’t retrace your steps and try again “well that’s a long command which isn’t very efficient mister Askar” Well Listen Here my man there is this magic file called a ssh client config which you can create using this commands

touch ~/.ssh/config

now that you have created the file use whatever text editor you prefer i prefer nano but you could use vi or vs code and copy this and edit it to your preference

Host $VM-Shortcut
    HostName $VMIP
    User Kali
    IdentityFile ~/.ssh/$PrivateKeyFile

then you can access your VM using this command

ssh $VM-Shortcut

much simpler and if you want to start your VM from the CLI you can do that using the virsh command

sudo virsh list --all

and then you’ll see the name you setup for the VM to start it you just use this command

sudo virsh start $VMName

Troubleshooting Tips
#

  • Problem: SSH connection is refused.
    • Solution: Verify the IP address of the VM with ip a and ensure the SSH service is running with sudo systemctl status ssh.
  • Problem: Unable to enable virtualization in BIOS.
    • Solution: Consult your motherboard’s manual or look up the model-specific steps online.

Conclusion
#

By following this guide, you can efficiently daily-drive Kali Linux using SSH and virtualization, all while leveraging the power of your preferred Linux distro. With this setup, you’ll save time, improve workflow efficiency, and enjoy a more streamlined experience.

Abdulaziz Askar
Author
Abdulaziz Askar
Hi, I’m Abdulaziz! I’m a computer science student with a passion for cybersecurity and homelabbing. I spend my time experimenting with tools, breaking things(and sometimes fixing them), and sharing what I’ve learned along the way. When I’m not geeking out over tech, you’ll probably find me stuck in a CTF rabbit hole or questioning why I decided to ‘just try one more project.’ This blog is where I document the chaos and (hopefully) help others learn from it too