I currently use Windows as my daily driver and have found WSL to be tremendously helpful when I want to use a Linux environment. During CTFs, labs, or other activities, it can be annoying to constantly clean up a single environment, so I created this Python script to help automate the process of installing packages/tools (with Kali's keyrings) and recreating environments.
-
Run the application:
python main.py
-
Create a configuration:
- Select "Manage configurations" → "Create new configuration"
- Choose distribution (Debian/Ubuntu)
- Select packages to include
-
Create a template:
- Select "Create template"
- This installs the base WSL distribution
-
Setup & Install packages:
- Select "Setup & Install packages"
- Choose your template
- This configures Kali repositories and installs selected packages
The default packages, setup commands, and available distributions can be found in config.py:
- UNIVERSAL_PACKAGES: List of packages
- AVAILABLE_DISTROS: Supported distributions and their setup commands
- Setup Commands: Kali repository configuration and keyring installation
By default, WSL instances are stored in the wsl-instances/ folder relative to the script location.
To change the storage location, modify line 5 in config.py:
WSL_BASE_PATH = os.path.join(os.path.dirname(__file__), "wsl-instances")Examples:
- Different drive:
WSL_BASE_PATH = "D:\\WSL-Instances" - User Documents:
WSL_BASE_PATH = os.path.join(os.path.expanduser("~"), "Documents", "WSL-Instances")
Note
Currently uses apt to install packages. If you want to use another package manager, consider modifying setup commands instead.
To add your own packages to the package list, edit the UNIVERSAL_PACKAGES array in config.py:
UNIVERSAL_PACKAGES = [
"your-package",
"another-package",
# ... existing packages
]- Windows 10/11 with WSL2 enabled
- Python 3.6+
- Sufficient storage space: includes the template distro, temporary compressed file for cloning (deleted after cloning), and the cloned distro
Contributions are more than welcome. Feel free to open a pull request.
This project is licensed under MIT License.
