Installing & Configuring Kali Linux on Hyper-v hosted on Windows 11
Tags: linux, tutorial, windows11, powershell
Published: 2022-01-16 05:39:24

## Setting up Hyper-V on the host

- Open a PowerShell window in admin mode

- Run the following command

```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
```

- Restart the computer.

## Download the Kali linux iso & create a VM in HyperV

- Download the kali linux ISO from [here](https://www.kali.org/).

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

- Under **Action** click on **New** &rarr; **Virtual 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

```bash
$ kali-tweaks
#opens up a GUI dialog box
```

- Select **Virtulization** &rarr; **configure**. Once the installation is complete reboot your Kali OS.

- On your Hyper-V host make go to **Action** &rarr; **Hyper-V settings** &rarr; **Enhanced Session Mode Policy** &rarr; **Allow 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

- Go to link: [Configuring Ms-Edge](https://www.microsoftedgeinsider.com/en-us/download?platform=linux-deb)

```bash
## 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
```

### Install Homebrew and Github CLI

- Go to link: [Install homebrew](https://brew.sh/)

```bash
/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.
```

```bash
# Once brew is installed, you can install gh using the following code in the terminal
brew install gh
```

### Install VsCode

- Go to Link: [Install VsCode on Linux](https://code.visualstudio.com/docs/setup/linux)

```bash
# Once you download the .deb file from the above link use the following command to install VsCode
sudo apt install ./<file>.deb
```

#### [Optional] Common extensions I use

```bash
$ 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
```

#### [Optional] Turning off telemetry in VsCode

```json
{
    "telemetry.enableTelemetry": false,
    "telemetry.enableCrashReporter": false,
    "aws.telemetry": false,
    "telemetry.telemetryLevel": "off"
}
```