DEV Community

Cover image for Installing & Configuring Kali Linux on Hyper-v hosted on Windows 11
Soumyajyoti Biswas
Soumyajyoti Biswas

Posted on • Updated on

Installing & Configuring Kali Linux on Hyper-v hosted on Windows 11

Setting up Hyper-V on the host

  • Open a PowerShell window in admin mode

  • Run the following command

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Enter fullscreen mode Exit fullscreen mode
  • Restart the computer.

Download the Kali linux iso & create a VM in HyperV

  • Download the kali linux ISO from here.

  • Open up the Hyper-V console on your host machine.

  • Under Action click on NewVirtual Machine. Follow through the steps to create a VM, and in the Installation Options dialog box, choose Install and operating system from an ISO/DVD and point it to the location of your ISO. Once the VM is created, before starting it, turn off the secure boot.

  • The ISO for Kali linux will boot you in. Select a GUI install and follow through the steps.

  • Once Kali linux is installed, you still have to install the Hyper-V guest tools. This will help you use the enhanced session mode in Hyper-V. The enhanced session mode provides a full screen experience for the guest OS over XRDP.

  • To install the enhanced session mode, run the following command in a terminal inside the Kali OS

$ kali-tweaks
#opens up a GUI dialog box
Enter fullscreen mode Exit fullscreen mode
  • Select Virtulizationconfigure. Once the installation is complete reboot your Kali OS.

  • On your Hyper-V host make go to ActionHyper-V settingsEnhanced Session Mode PolicyAllow enhanced session mode. Make sure the checkbox is ticked.

  • While keeping your VM in shutdown mode, reboot your host OS.

  • Once the host OS is up, start the guest Kali OS. Connect to it and you should be presented with a dialog box that allows you to go full screen.

Configuring Kali Linux

Install Ms-Edge

## Setup
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-beta.list'
sudo rm microsoft.gpg
## Install
sudo apt update
## Install the stable update
sudo apt install microsoft-edge-stable
Enter fullscreen mode Exit fullscreen mode

Install Homebrew and Github CLI

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Once this is installed follow the onscreen instructions to add brew to your current and shell profile.
Enter fullscreen mode Exit fullscreen mode
# Once brew is installed, you can install gh using the following code in the terminal
brew install gh
Enter fullscreen mode Exit fullscreen mode

Install VsCode

# Once you download the .deb file from the above link use the following command to install VsCode
sudo apt install ./<file>.deb
Enter fullscreen mode Exit fullscreen mode

[Optional] Common extensions I use

$ code --list-extensions
amazonwebservices.aws-toolkit-vscode
christian-kohler.path-intellisense
CoenraadS.bracket-pair-colorizer
DavidAnson.vscode-markdownlint
eamodio.gitlens
esbenp.prettier-vscode
GitHub.vscode-pull-request-github
ms-python.python
ms-python.vscode-pylance
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap
ms-toolsai.jupyter-renderers
VisualStudioExptTeam.vscodeintellicode
zhuangtongfa.material-theme
Enter fullscreen mode Exit fullscreen mode

[Optional] Turning off telemetry in VsCode

{
    "telemetry.enableTelemetry": false,
    "telemetry.enableCrashReporter": false,
    "aws.telemetry": false,
    "telemetry.telemetryLevel": "off"
}
Enter fullscreen mode Exit fullscreen mode

Discussion (0)