Installing Kali Linux in Hyper-V in enhanced mode AND sound


cereberus

Well-known member
Pro User
VIP
Local time
1:51 AM
Posts
2,590
OS
Windows 10 Pro + others in VHDs
I have previously shown how to install Ubuntu in Hyper-V enhanced mode but I was googling how to do it for other distros, and came across how to do it for Kali Linux

I could not believe how simple it was compared to setting up Ubuntu. Basically one command in step 3 does all the hard work!

Edit: I have just discovered it has sound as well. I had to go through hoops and loops to get sound in Ubuntu!

Ubuntu - eat your heart out!!!


1) Download Kali iso

2) Install Kali in Hyper-V as a gen 2 pc in usual way (secure boot needs to be off), setting up an account name and password.
Loads of guides on web how to do this but pretty straight forward. Assume you have call Kali VM simply "Kali"

3) once logged into Kali, open up terminal and run

Code:
kali-tweaks

select "virtualisation" and then "Configure the system for Hyper-V enhanced session mode"

That installs XRDP.

4) close down Kali VM

5) Run following from admin Powershell

Code:
Set-VM "Kali" -EnhancedSessionTransportType HVSocket

(Change vm name in quotes if you used a different one in Step 2)


6) Reboot pc and restart hyper-v Kali vm.

It will come up with the standard Hyper-V enhanced mode pop up screen where you can choose resolution, Windows drives to share with Kali (must be set up as shared drives in Windows in usual way).

1654714529548.png

It will then come up with the xrdp login screen and you enter name and password

1654714765836.png

You can now see shared drives from Windows (if you have set up shares)

1654714859532.png

You can also cut and paste now between Windows and Kali.
 
Last edited:

My Computer

System One

  • OS
    Windows 10 Pro + others in VHDs
    Computer type
    Laptop
    Manufacturer/Model
    ASUS Vivobook 14
    CPU
    I7
    Motherboard
    Yep, Laptop has one.
    Memory
    16 GB
    Graphics Card(s)
    Integrated Intel Iris XE
    Sound Card
    Realtek built in
    Monitor(s) Displays
    N/A
    Screen Resolution
    1920x1080
    Hard Drives
    1 TB Optane NVME SSD, 1 TB NVME SSD
    PSU
    Yep, got one
    Case
    Yep, got one
    Cooling
    Stella Artois
    Keyboard
    Built in
    Mouse
    Bluetooth , wired
    Internet Speed
    72 Mb/s :-(
    Browser
    Edge mostly
    Antivirus
    Defender
    Other Info
    TPM 2.0

amitabhr

Member
Local time
6:21 AM
Posts
12
OS
Win 11 Pro 21H2 / Elementary 6 / macOS Big Sur
I have previously shown how to install Ubuntu in Hyper-V enhanced mode but I was googling how to do it for other distros, and came across how to do it for Kali Linux

I could not believe how simple it was compared to setting up Ubuntu. Basically one command in step 3 does all the hard work!
........
........

Could you tell me how to get Budgie desktop installed on WSL2 Ubuntu ? I keep running into issues

BTW, Kali has something called WinKex which does all the config for running GUI Desktop on WSL2 with a single command. And everything works incl sound etc. Also has 3 modes -
Seamless mode is quite good - the Windows 11 desktop has a top taskbar with Kali menu and kali/win apps run all intermingled on same desktop. See image below

Basically install Kali from the windows store and then do 'apt install -y kali-win-kex'
then type
kex --win -s
The top taskbar will appear on your win11 desktop.

Read here: Win-KeX | Kali Linux Documentation

win-kex-sl.png
 

My Computer

System One

  • OS
    Win 11 Pro 21H2 / Elementary 6 / macOS Big Sur
    Computer type
    Tablet
    Manufacturer/Model
    Thinkpad Yoga 260
    CPU
    Intel Core i7 6500U
    Memory
    8 GB
    Screen Resolution
    1920x1080 Touch+Stylus
    Hard Drives
    LITEON SSD 512 GB
    Internet Speed
    200 Mbps
    Other Info
    4G+GPS Snapdragon X7 LTE-A Sierra EM7455
    Synaptics Fingerprint Scanner WBDI | Wacom Stylus
    Intel AC-8260 WiFi + Bluetooth BLE | USB 3.1
    Realtek webcam & microSD | Connexant Audio
    TPM 2.0 Intel PTT | Secure Boot | UEFI Bios 1.82

cereberus

Well-known member
Pro User
VIP
Thread Starter
Local time
1:51 AM
Posts
2,590
OS
Windows 10 Pro + others in VHDs
Could you tell me how to get Budgie desktop installed on WSL2 Ubuntu ? I keep running into issues

BTW, Kali has something called WinKex which does all the config for running GUI Desktop on WSL2 with a single command. And everything works incl sound etc. Also has 3 modes -
Seamless mode is quite good - the Windows 11 desktop has a top taskbar with Kali menu and kali/win apps run all intermingled on same desktop. See image below

Basically install Kali from the windows store and then do 'apt install -y kali-win-kex'
then type
kex --win -s
The top taskbar will appear on your win11 desktop.

Read here: Win-KeX | Kali Linux Documentation

win-kex-sl.png
Sorry - no idea. Maybe @Jimbo can assist?
 

My Computer

System One

  • OS
    Windows 10 Pro + others in VHDs
    Computer type
    Laptop
    Manufacturer/Model
    ASUS Vivobook 14
    CPU
    I7
    Motherboard
    Yep, Laptop has one.
    Memory
    16 GB
    Graphics Card(s)
    Integrated Intel Iris XE
    Sound Card
    Realtek built in
    Monitor(s) Displays
    N/A
    Screen Resolution
    1920x1080
    Hard Drives
    1 TB Optane NVME SSD, 1 TB NVME SSD
    PSU
    Yep, got one
    Case
    Yep, got one
    Cooling
    Stella Artois
    Keyboard
    Built in
    Mouse
    Bluetooth , wired
    Internet Speed
    72 Mb/s :-(
    Browser
    Edge mostly
    Antivirus
    Defender
    Other Info
    TPM 2.0

jimbo45

Well-known member
Power User
VIP
Local time
12:51 AM
Posts
2,068
Location
Hafnarfjörður IS
OS
Windows XP,7,10,11 Linux Arch Linux
I have previously shown how to install Ubuntu in Hyper-V enhanced mode but I was googling how to do it for other distros, and came across how to do it for Kali Linux

I could not believe how simple it was compared to setting up Ubuntu. Basically one command in step 3 does all the hard work!

Edit: I have just discovered it has sound as well. I had to go through hoops and loops to get sound in Ubuntu!

Ubuntu - eat your heart out!!!


1) Download Kali iso

2) Install Kali in Hyper-V as a gen 2 pc in usual way (secure boot needs to be off), setting up an account name and password.
Loads of guides on web how to do this but pretty straight forward. Assume you have call Kali VM simply "Kali"

3) once logged into Kali, open up terminal and run

Code:
kali-tweaks

select "virtualisation" and then "Configure the system for Hyper-V enhanced session mode"

That installs XRDP.

4) close down Kali VM

5) Run following from admin Powershell

Code:
Set-VM "Kali" -EnhancedSessionTransportType HVSocket

(Change vm name in quotes if you used a different one in Step 2)


6) Reboot pc and restart hyper-v Kali vm.

It will come up with the standard Hyper-V enhanced mode pop up screen where you can choose resolution, Windows drives to share with Kali (must be set up as shared drives in Windows in usual way).

View attachment 30996

It will then come up with the xrdp login screen and you enter name and password

View attachment 30997

You can now see shared drives from Windows (if you have set up shares)

View attachment 30998

You can also cut and paste now between Windows and Kali.
While Kali Linux installed this way is nice and easy there's still one minor problem (or probably not so minor) with this -- most up to date Linux systems have got away from X11 and Xorg for the video if you install any desktop (GUI). -- they usually use the far more recent wayland and plasma systems. Not a problem if you only have one VM but communicating any sort of video / gui apps between X11 and wayland / plasma desktops is just a nightmare at the moment. Even getting Windows to "RDP" to a Linux GUI is a problem.

File sharing, command mode, non root ssh access etc are fine from windows - but it's still a pain if you want to access a full Linux desktop GUI from Windows with the WAYLAND video on the target Linux VM.

For file sharing etc you don't need a GUI actually and if you run filezilla client on your Windows front end you can get a nice gui of all the files etc on the remote Linux system for file sharing / transfer (both ways). BTW to XMIT files FROM Windows TO linux you will probably need to enable in the Windows settimgs --add optional features -=->openssh-server and start it in services. For just one way traffic FROM linux TO Windows you won't need openssh server on windows - you will still probably need to install SSH on the Linux system though.

For those who want to try Linux and run as VM's though -- you'll get an infinitely more enjoyable expertience if you learn the basic command line and scripts in Linux -- BASH or ZSH are the most comman "Command processors" -- you even get a choice of those !!!! Once you understand the basics then debugging / trying to get complex things like GUI's working etc will be a lot simpler. Many people just give up after 5 mins just because "It's not the same as Windows" !!!!!!.

Just do a little bit at a time - and as a VM it's fine if you hose things up - just delete and re-create a new one. Linux distros are free at consumer level and install even on rediculously simple hardware so no probs messing around with as many times as you like.

Cheers
jimbo
 
Last edited:

My Computer

System One

  • OS
    Windows XP,7,10,11 Linux Arch Linux
    Computer type
    PC/Desktop
    CPU
    2 X Intel i7

Latest Tutorials

Top Bottom