Often I need to spin up Virtual Machines quickly for testing ideas, building class exercises, and other tinkering around. Virtual Machines are all well and good but get a bit time-consuming to set up and tear down. Docker is great for spinning environments up quickly, but may only give you the bare minimum or a CLI when you may want a bit more…

So, I’ve been looking for a good way to have a remote desktop in a web browser for a virtual machine, that can be set up quickly.

Enter Kasm. They have a set of Docker containers that support web remote desktop out of the box, and can quickly be deployed.

Ubuntu Jammy Desktop— https://hub.docker.com/r/kasmweb/ubuntu-jammy-desktop-vpn

Kali — https://hub.docker.com/r/kasmweb/kali-rolling-desktop

One snag — I wanted to be able to use apt install within my environment. Adapting the official documentation, I would add the “— user root” to the Docker command.

sudo docker run --rm -it --user root --shm-size=512m -p 6901:6901 -e VNC_PW=password kasmweb/ubuntu-jammy-desktop-vpn:1.17.0

sudo docker run --rm -it --user root --shm-size=512m -p 6905:6901 -e VNC_PW=password kasmweb/kali-rolling-desktop:1.17.0

(In this example I’ve put Kali on 6905 so that I can run both instances together).

From one line, I can now connect to https://localhost:6901, use kasm_user / password as the VNC credentials, and I have a Ubuntu desktop instance accessible that I can update and add new packages to quickly and easily!

As I’m running two instances (Ubuntu and Kali) I can share between them as they are on the same local subnet (however ping is not available by default).

apt update

apt install iputils-ping

I now have two different OSs running in two browser windows able to communicate — and it took about 20 seconds to set up!

Nice one Kasm.

P.S. Kasm Tech DockerHub page shows a bunch of different OSs and applications that can all be deployed in the same web-based manner — they even have a Doom image :)

P.P.S. Kali may still require the update to the missing signing key that was widely documented recently — https://www.kali.org/blog/new-kali-archive-signing-key/