HVM Networking - Allow incoming connections to Kali HVM from LAN

I have a Kali HVM successfully running with LAN and internet access. I’ve confirmed this by successfully browsing the internet and connecting via LAN to other machines on the local network.

I need to set up my Qubes system so that i can start a netcat session on my Kali HVM and connect to it from other computers on my LAN network.

Anyone know the best way to do this?

You might have to assign the lan controller to your kali qube.

In dom0:

qvm-pci ls sys-net

Note the BACKEND:DEVID (for example dom0:00_xx.y). Also check if you see the following: no-strict-reset=True

Shutdown sys-net and attach the controller to kali (change values accordingly):

qvm-shutdown --force --wait sys-net
qvm-pci attach --persistent KALIVM BACKEND:DEVID

Note: if you saw no-strict-reset=True before, you need to add the following option when running qvm-pci attach: --option no-strict-reset=True

For my Kali HVM I use external USB Wifi dongle on a separate controller. Exclusively for Kali, no messing with other controllers and qubes.

If you are not able to allocate a specific NIC to Kali, then you can use
this script to open a port on sys-net and forward traffic through the
Qubes networking stack to Kali.

I never presume to speak for the Qubes team. When I comment in the Forum or in the mailing lists I speak for myself.

Unfortunately whenever i try and attach a USB dongle i receive a qrexec error. Is there a workaround to resolve that issue?

How did you attach the dongle and what error do you receive exactly?

I just plugged it in and assigned via the USB devices taskbar item and receive the following error:
Error: QubesVMError - Domain ‘kali’ qrexec not connected

I just plugged it in and assigned via the USB devices taskbar item and receive the following error:
Error: QubesVMError - Domain ‘kali’ qrexec not connected

How did you install Kali?

Installed by downloading the ISO and installing much like a regular ISO based install.
Could i be missing some extra steps in the qube settings for the HVM?

I’m pretty sure a std. ISO from the web, doesn’t include the Qubes Tools needed.

Have you tried:

qvm-template-gui

from at dom0 terminal?

Note: The “kali” image is pretty big, so you might have to expand the size of dom0, to install it:

You might want to notice that community Kali template is heavily outdated. Most recent template is packed by unman and can be found here

https://qubes.3isec.org/Templates_4.1/

I might just ditch the HVM and stick with the template. Thanks for the assistance all.
The instructions from @BEBF738VD and script from @unman will prove extremely useful going forward, much appreciated!

Also to confirm, is this the correct way to fix the key issues for the Kali template to be able to update?

gpg --keyserver hkps://keys.openpgp.org --recv-key 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6
gpg --list-keys --with-fingerprint 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6
gpg --export --armor 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6 > kali-key.asc
gpg --dearmor kali-key.asc
sudo cp kali-key.asc.gpg /etc/apt/trusted.gpg.d/kali-key.gpg