[Tut] Parrot on WSL 2 (Official)

Before the actual steps, I want to say a special thank to author of Spatacoli blog. This tutorial can’t be there without this awesome article: Custom WSL Image – Spatacoli

The article above is licensed under Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)

Prepare environment:

In this tutorial im using 2 different machine:

  • Parrot to create image from docker and Windows to create wsl. Create image from Parrot or any Linux distro is not required. Docker is required to create image
  • Windows for the WSL (ofc). User MUST have WSL version 2 and I strongly recommend user to install Windows Terminal

Overview

I. Create wsl image from docker

  1. Pull latest docker image
  2. Export compressed file from docker image

II. Create wsl system

  1. Transfer image to Windows
  2. Import image
  3. Customize

Steps

I. On Parrot (install docker by sudo apt install docker.io)

1.Search parrot image on docker. In this example I’ll use “parrotsec/core”
command: docker search parrot


2. Pull the image docker pull parrotsec/core

3. Create image (?) docker create -i parrotsec/core bash

Terminal will show a long hash value that we’ll use in next step

  1. Generate image file docker export <hash value> > parrotsec.tar

(note: the extension is tar. I typed .tar.gz by mistake). I renamed the file to “parrotsec.tar” after this export command. The file name is not important thing and won’t make any differences

II. On windows machine

  1. Transfer generated tar file to Windows machine. In this example I created local web server and downloaded file on Windows machine via HTTP.

  2. Import image. Command structure is like the screenshot bellow

Command wsl –import ParrotSec D:\ParrotSec C:\Users\dmknght\Downloads\parrotsec.tar

After image is imported, users can start Parrot’s cli by click on “down arrow” button

Parrot is started

  1. To start Parrot from terminal by default, you can go to settings of Windows terminal and change default profile to ParrotSec

Hey @dmknght , your code to import doesn’t quite work, at least not for me. What did work was this:
wsl --import ParrotSec D:\ParrotSec C:\Users\<username>\Downloads\parrotsec.tar

The structure of import command is wsl --import <distritubtion name> <save path> <import file> and i have no idea why the fuck it had god damn () and [] on this article. Must be something when i copied from libre.

It must be, if I hadn’t been reading the help output myself I wouldn’t have noticed the issue and wouldn’t have gotten it to work :rofl:

In Microsofts infinate wisdom the only error I get after attempting to build the image on windows 10 is “unspecified error” when trying to run

wsl --import <distritubtion name> <save path> <import file>

I will keep smacking away at it. Build on *nix and move to M$ crap…

Did you enable wsl2? it could be the reason of your error i guess.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.

This method works but there is no gui and no systemd.
There is a better way to import ParrotOS into WSL by using the iso.
Download the latest image and extract using 7zip:
7z x ParrotOS.iso

cd into live and mount the filesystem.squash image as ro, where $ROOTFS_DIR is your chosen dir.

mount -o ro live/filesystem.squashfs $ROOTFS_DIR;

Create tar.gz archive

tar -zcvf distro.tar.gz $ROOTFS_DIR/.

Once it is completed, you only need to import it into wsl:

wsl.exe --import $DISTRO_NAME $DISTRO_LOCATION distro.tar.gz

Make sure to add your user with adduser rather than useradd to get the full-color terminal
Last but not least:

Open regedit and navigate to Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\$DISTRO_GUID Ensure the following values are set

Name Type Data
DefaultEnvironment REG_MULTI_SZ HOSTTYPE=x86_64

LANG=en_US.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
TERM=xterm-256color|
|DefaultUid|REG_DWORD|$USER_ID|

Some of the steps are taken from Instructions on how to install a custom distro in WSL2 (Windows SubSystem for Linux 2) · GitHub but works like a charm with full GUI support.

Cheers boys.

2 Likes

To be perfectly honest, the aforementioned method is a bit sloppy and I noticed some functions are not working all that great.

So I went ahead and downloaded the ParrotOS live image and used VMware to create a virtual machine. I also made sure to ask VMware to keep the disk data (.vmdk) in one file.
Mounting it under Windows does not allow you to access the virtual drive, yet you can always leverage another WSL distro and guestmount to get things going:

sudo guestmount -a ParrotOS.vmdk -i --ro /mnt/vmdk

This would mount the virtual drive in /mnt where you can then archive everything into a tar.gz:

cd /mnt/vmdk/ && tar -zcvf Parrot.tar.gz .*

After you’re done, should just be a matter of importing into WSL.

I hope you understand that WSL doesn’t support systemd by default, similar to docker.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.