Nicolas Engel

Idea(ls) on cybersecurity

Windows prototyping and virtualization solutions

A recurring trend in IT security is the overused use of fashionable terms, which do not cover the same reality for the customer or his service provider. SecOps (Security Operations) is the perfect example here. In order to clarify the debates in the professional world, I therefore wanted to use my pentest laboratory prototype to improve it as follows. The initial principles remain unchanged, namely:

The improvements over the first version are as follows:

You might say, what is the point of taking up an existing subject on the sole pretext of improving it ? The challenge here is less to talk about the final solution than about its hosting and its multiple associated failures that I have encountered.

A handmade Pentest lab

For once, let’s start at the end.

The local pentest laboratory solution made available by Oliver Wiegers on Github is a work of art. Kudos to him!

So I installed the lab on an Ubuntu PC to find out if it was as interesting as it looked.

sudo apt install docker docker-compose jq python3-pip
sudo pip3 install yq
sudo ssh-keygen
$ git clone
$ cd pentest_lab
$ ./ -C
sudo ./ -u

The installation takes a long time especially because of the updating of Kali Linux tools. Once the process is finalized, the IP addresses are statically defined to facilitate the SSH connection to the Kali image.

Everything works fine on a non-virtualized Linux instance. Have a good time !

Once this step is over, the idea is to determine how to virtualize this laboratory under Windows. This is where the trouble begins.

Virtualization options and their technical limits

The prototype being functional, I started to test several virtualization methods.

As a reminder, 2 main architectures exist. Virtual machines (VM) as well as containers such as the Docker solution make it possible to virtualize applications on a host system such as Microsoft Windows, Linux or MacOS.

To complete this technical panorama, let’s dwell for a moment on 2 technical bricks of virtualization under Windows, WSL2 and Hyper-V:

In summary, Hyper-V is the technical brick for running virtual machines in Windows. WSL2 is the technical building block for running Docker containers. The fact that WSL2 itself relies on part of the Hyper-V architecture to function makes this beautiful subject, which is the exciting world of virtualization, more complex.

So Oliver Wiegers’ prototype virtualization options are:

Regarding the first option, the installation of the Ubuntu image in Windows via WSL2 went well. Launching the installation script is possible but I never managed to finalize its installation. The script consistently crashes in Kali Linux update without being able to get detailed error logs of the issue.

Regarding the second option, using Canonical’s Multipass solution works similarly to Docker. Thus, launching the tool from the command line via Powershell under Windows works well (cf. Ubuntu official documentation). Unfortunately, as soon as I try to generate an image with a large enough disk size for the prototype, the image generation conflicts with Hyper-V and I am unable to generate an IP address for the image .

My third and last option is therefore the use of Docker Desktop with WSL 2 to generate an Ubuntu image that itself includes a Docker-compose to build the prototype. For docker-compose to work, it is necessary to take an image with SystemD installed, which is not the case in the default Ubuntu image provided in Docker.

docker run -d --name systemd-ubuntu --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro jrei/systemd-ubuntu
$ docker exec -it systemd-ubuntu /bin/bash
$ apt update && apt full-upgrade
$ systemctl start docker

Finally, this third and last solution works and allows me to use the pentest lab locally on Windows !

In summary, this prototype allowed me to dig into Linux virtualization solutions under Windows in order to host the Pentest laboratory created by Oliver Wiegers. These multiple and varied solutions are interesting to explore in order to understand the philosophy of the tools but also the compromises to be made between lightness and the ability to configure the tools. The failures encountered were in the end formative and instructive to understand the current state of the market in the field.

“Success is the failure of failure.”

Delphine Lamotte

Leave a Reply

Your email address will not be published. Required fields are marked *