{"id":28984328,"url":"https://github.com/chavatte/parrotosinwslwithgui","last_synced_at":"2026-05-04T00:31:49.029Z","repository":{"id":298556020,"uuid":"984794893","full_name":"chavatte/ParrotOSinWSLwithGUI","owner":"chavatte","description":"This details the installation process of Parrot OS Security Edition within the Windows Subsystem for Linux (WSL2), configuring GUI access via XRDP. It includes manual rootfs import and a PowerShell function for simplified connection.","archived":false,"fork":false,"pushed_at":"2025-06-11T17:41:41.000Z","size":472,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T17:06:21.758Z","etag":null,"topics":["cybersecurity","debian","development-environment","ethical-hacking","gui","guide","linux","parrot-os","penetration-testing","powershell","tutorial","virtualization","windows","wsl2","xrdp"],"latest_commit_sha":null,"homepage":"https://chavatte.vercel.app/","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chavatte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["chavatte"]}},"created_at":"2025-05-16T14:16:55.000Z","updated_at":"2025-06-21T04:38:21.000Z","dependencies_parsed_at":"2025-06-11T19:13:45.793Z","dependency_job_id":"1a4c059d-4a64-45bc-b65c-864f364b6fe2","html_url":"https://github.com/chavatte/ParrotOSinWSLwithGUI","commit_stats":null,"previous_names":["chavatte/parrotosinwslwithgui"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chavatte/ParrotOSinWSLwithGUI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chavatte%2FParrotOSinWSLwithGUI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chavatte%2FParrotOSinWSLwithGUI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chavatte%2FParrotOSinWSLwithGUI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chavatte%2FParrotOSinWSLwithGUI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chavatte","download_url":"https://codeload.github.com/chavatte/ParrotOSinWSLwithGUI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chavatte%2FParrotOSinWSLwithGUI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278322188,"owners_count":25967873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cybersecurity","debian","development-environment","ethical-hacking","gui","guide","linux","parrot-os","penetration-testing","powershell","tutorial","virtualization","windows","wsl2","xrdp"],"created_at":"2025-06-24T17:03:23.804Z","updated_at":"2026-05-04T00:31:49.004Z","avatar_url":"https://github.com/chavatte.png","language":"PowerShell","funding_links":["https://github.com/sponsors/chavatte"],"categories":[],"sub_categories":[],"readme":"\u003cpre style=\"font-size: 0.5rem;\"\u003e\n\n                              \\\\\\\\\\\\\n                           \\\\\\\\\\\\\\\\\\\\\\\\\n                          \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n-------------,-|           |C\u003e   // )\\\\\\\\|    .o88b. db   db  .d8b.  db    db  .d8b.  d888888b d888888b d88888b\n           ,','|          /    || ,'/////|   d8P  Y8 88   88 d8' '8b 88    88 d8' '8b '~~88~~' '~~88~~' 88'  \n---------,','  |         (,    ||   /////    8P      88ooo88 88ooo88 Y8    8P 88ooo88    88       88    88ooooo \n         ||    |          \\\\  ||||//''''|    8b      88~~~88 88~~~88 '8b  d8' 88~~~88    88       88    88~~~~~ \n         ||    |           |||||||     _|    Y8b  d8 88   88 88   88  '8bd8'  88   88    88       88    88.   \n         ||    |______      ''''\\____/ \\      'Y88P' YP   YP YP   YP    YP    YP   YP    YP       YP    Y88888P\n         ||    |     ,|         _/_____/ \\\n         ||  ,'    ,' |        /          |                 ___________________________________________\n         ||,'    ,'   |       |         \\  |              / \\                                           \\ \n_________|/    ,'     |      /           | |             |  |                                            | \n_____________,'      ,',_____|      |    | |              \\ |      chavatte@duck.com                     | \n             |     ,','      |      |    | |                |                       chavatte.vercel.app  | \n             |   ,','    ____|_____/    /  |                |    ________________________________________|___\n             | ,','  __/ |             /   |                |  /                                            /\n_____________|','   ///_/-------------/   |                 \\_/____________________________________________/ \n              |===========,'                                                                                  \n\t\t\t  \n\n\u003c/pre\u003e\n\n\u003cimg src=\"./assets/logo.png\" alt=\"ParrotOS With GUI on WLS2\" style=\"margin: 20px;\"\u003e\n\n# Parrot OS Security com GUI no WSL2 (Windows 10/11) | Parrot OS Security with GUI on WSL2 (Windows 10/11)\n\n## Resumo\n\nEste guia detalha o processo de instalação do Parrot OS Security Edition no Subsistema Windows para Linux (WSL2), configurando o acesso à sua interface gráfica (GUI) via XRDP e fornecendo um script PowerShell para facilitar a conexão. O método foca na importação manual de um *rootfs*, garantindo flexibilidade e um atalho de conexão rápida.\n\n## Abstract\n\nThis guide details the installation process of Parrot OS Security Edition on the Windows Subsystem for Linux (WSL2), configuring access to its graphical user interface (GUI) via XRDP, and providing a PowerShell script for easy connection. The method focuses on manually importing a *rootfs*, ensuring flexibility and a quick connection shortcut.\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003e🇧🇷 Guia Completo (Português do Brasil)\u003c/summary\u003e\n\n## Visão Geral\n\nO Parrot OS é uma distribuição GNU/Linux baseada em Debian, amplamente utilizada por profissionais de segurança e entusiastas de privacidade. O WSL2 permite executar um ambiente Linux completo e integrado ao Windows, oferecendo excelente desempenho. Este guia foca na importação manual de um *rootfs* do Parrot OS para WSL, garantindo flexibilidade na escolha da versão e local de instalação.\n\n**Funcionalidades cobertas:**\n\n* Configuração do WSL2 no Windows.\n* Download e preparação de um *rootfs* do Parrot OS para WSL.\n* Importação e configuração inicial do Parrot OS no WSL.\n* Instalação e configuração de um ambiente de desktop (se não incluído no *rootfs*).\n* Configuração do servidor XRDP para acesso remoto ao desktop.\n* Criação de uma função PowerShell (`Connect-ParrotGUI`) para conexão rápida.\n\n## Pré-requisitos\n\n* Windows 10 (build 19041 ou superior) ou Windows 11 (64 bits), devidamente atualizado.\n* Virtualização de Hardware (VT-x/AMD-V) habilitada na BIOS/UEFI do sistema.\n* Privilégios de Administrador no Windows.\n* Conexão estável com a Internet.\n* (Recomendado) [Windows Terminal](https://aka.ms/terminal) instalado via Microsoft Store.\n\n## Passo 1: Habilitando o WSL2 e Recursos de Virtualização\n\n1. **Abrir PowerShell como Administrador:**\n   Pesquise \"PowerShell\", clique com o botão direito em \"Windows PowerShell\" e selecione \"Executar como administrador\".\n2. **Habilitar Funcionalidades Necessárias:**\n   Execute os seguintes comandos:\n\n   ```powershell\n   dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart\n   dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart\n   ```\n3. **Reiniciar o Windows:** Este passo é crucial.\n4. **Atualizar Componentes do WSL (Incluindo Kernel):**\n   Após reiniciar, abra o PowerShell (preferencialmente como Administrador) e execute:\n\n   ```powershell\n   wsl --update\n   ```\n\n   Este comando instalará a versão mais recente do kernel Linux e outros componentes do WSL.\n5. **Definir WSL2 como Padrão:**\n\n   ```powershell\n   wsl --set-default-version 2\n   ```\n\n## Passo 2: Download e Preparação do RootFS do Parrot OS para WSL\n\n1. **Obter o RootFS:**\n\n   * **Recomendado:** Visite a [página oficial de downloads do Parrot OS](https://parrotsec.org/download/) ou o [repositório GitLab do projeto WSL do Parrot](https://gitlab.com/parrotsec/project/wsl) para encontrar a versão WSL mais recente. Procure por um link direto para um arquivo `.tar.gz` ou um `.zip` que o contenha.\n   * **Alternativa (Usando um Link de Build Específico - Use com Cautela):** Links diretos para artefatos de *jobs* do GitLab (ex: `.../jobs/ID_DO_JOB/artifacts/download...`) podem expirar ou ser de versões desatualizadas. Prossiga com cautela se usar um desses.\n2. **Extrair `install.tar.gz` (se necessário):**\n\n   * Se você baixou um arquivo como `artifacts.zip`, extraia-o.\n   * Navegue pela estrutura de pastas extraídas (ex: `Base_Builder/build/output.zip/build/` ou similar) até localizar o arquivo `install.tar.gz`.\n   * Mova este arquivo `install.tar.gz` para um local de fácil acesso, por exemplo: `C:\\Temp\\ParrotWSL\\install.tar.gz`.\n3. **Criar Pasta de Instalação no Windows:**\n   Crie um diretório onde os arquivos do Parrot OS serão armazenados.\n   Exemplo: `C:\\WSL_Distros\\Parrot` (você pode escolher qualquer unidade/caminho).\n\n## Passo 3: Importando e Configurando o Parrot OS no WSL\n\n1. **Importar para o WSL:**\n   Abra o PowerShell como Administrador e execute:\n\n   ```powershell\n   # Substitua os caminhos e o nome da distro conforme sua configuração\n   wsl --import Parrot \"C:\\WSL_Distros\\Parrot\" \"C:\\Temp\\ParrotWSL\\install.tar.gz\" --version 2\n   ```\n\n   *(`Parrot` é o nome sugerido para a distro no WSL. `C:\\WSL_Distros\\Parrot` é o diretório de instalação. `C:\\Temp\\ParrotWSL\\install.tar.gz` é o rootfs baixado).*\n2. **Configuração Inicial do Usuário:**\n\n   * Inicie a nova distro (logará como `root`):\n     ```powershell\n     wsl -d Parrot\n     ```\n   * Dentro do terminal Parrot, crie seu usuário (substitua `seu_usuario_parrot`):\n     ```bash\n     adduser seu_usuario_parrot\n     ```\n\n     (Siga os prompts para senha e informações).\n   * Adicione o usuário aos grupos necessários:\n     ```bash\n     usermod -aG sudo,adm,cdrom,dip,plugdev seu_usuario_parrot\n     ```\n   * Defina o usuário como padrão para login no WSL:\n     ```bash\n     echo -e \"[user]\\ndefault = seu_usuario_parrot\" \u003e /etc/wsl.conf\n     ```\n   * Saia da sessão `root`:\n     ```bash\n     exit\n     ```\n3. **Finalizar e Reiniciar a Distro:**\n   No PowerShell:\n\n   ```powershell\n   wsl --terminate Parrot\n   wsl -d Parrot\n   ```\n\n   Você deve logar como `seu_usuario_parrot`.\n4. **Atualizar o Sistema e Ferramentas:**\n   Dentro do terminal Parrot:\n\n   ```bash\n   sudo apt update \u0026\u0026 sudo apt full-upgrade -y\n   # Opcional, se o rootfs for \"core\" ou para garantir todas as ferramentas:\n   sudo apt install parrot-tools-full -y\n   ```\n5. **(Opcional) Limpeza:** Delete os arquivos de download e extração temporários.\n\n## Passo 4: Instalando/Verificando o Ambiente Gráfico (Desktop)\n\n1. **Verificação Inicial:**\n\n   * Instale o XRDP (se ainda não estiver incluído no seu *rootfs*):\n     ```bash\n     sudo apt update\n     sudo apt install xrdp -y\n     sudo adduser xrdp ssl-cert # Garante permissões\n     sudo service xrdp restart  # Ou 'start'\n     ```\n   * Obtenha o IP do WSL (ex: `ip addr show eth0 | grep \"inet\\b\" | awk '{print $2}' | cut -d/ -f1`).\n   * Tente conectar via \"Conexão de Área de Trabalho Remota\" do Windows a este IP.\n   * **Se um desktop Parrot carregar:** Ótimo, seu *rootfs* já incluía um ambiente. Pule para o Passo 5.\n   * **Se tela preta/cinza ou falha após login XRDP:** Prossiga para instalar um ambiente.\n2. **Instalar um Ambiente de Desktop (se necessário):**\n\n   * Liste opções: `apt search parrot-desktop`\n   * **Recomendado (MATE):**\n     ```bash\n     sudo apt install parrot-desktop-mate -y\n     ```\n   * Alternativas: `parrot-desktop-xfce`, `parrot-desktop-kde`, `parrot-desktop-gnome`.\n   * **Prompts de Configuração:** Durante a instalação, podem surgir prompts para `wireshark-common` ou `macchanger`. Recomenda-se escolher **\"Não\"** (padrão) se em dúvida.\n   * Após a instalação, reinicie o XRDP:\n     ```bash\n     sudo service xrdp restart\n     ```\n\n## Passo 5: Configurando o Acesso Remoto com XRDP\n\n1. **Garantir Instalação do XRDP:** (Já deve ter sido feito no Passo 4.1)\n   ```bash\n   sudo apt install xrdp -y\n   ```\n2. **Adicionar Usuário `xrdp` ao Grupo `ssl-cert`:** (Já deve ter sido feito no Passo 4.1)\n   ```bash\n   sudo adduser xrdp ssl-cert\n   ```\n3. **Iniciar/Reiniciar Serviço XRDP:**\n   (O script PowerShell no Passo 7 tentará fazer isso, mas para testes manuais:)\n   ```bash\n   sudo service xrdp start\n   # ou\n   sudo service xrdp restart\n   ```\n\n   Verifique o status com `sudo service xrdp status`.\n\n## Passo 6: Conectando à Interface Gráfica\n\n1. **Obter IP do WSL Parrot:**\n   No terminal Parrot:\n   ```bash\n   ip addr show eth0 | grep \"inet\\b\" | awk '{print $2}' | cut -d/ -f1\n   ```\n2. **Conexão de Área de Trabalho Remota (Windows):**\n   * Execute `mstsc.exe`.\n   * Insira o IP do WSL.\n   * **Aviso de Certificado:** Você verá um aviso sobre o certificado não ser confiável e/ou nome incorreto. **Isto é esperado.** Marque \"Não perguntar novamente...\" e clique em \"Sim\".\n3. **Login XRDP:**\n   * Sessão: `Xorg` (ou `Xvnc`).\n   * Usuário/Senha: Suas credenciais do Parrot OS (`seu_usuario_parrot`).\n   * Clique \"OK\".\n\n## Passo 7: Função PowerShell para Conexão Rápida (`Connect-ParrotGUI`)\n\nPara facilitar conexões futuras, adicione a seguinte função aos seus perfis do PowerShell:\n\n* **Windows PowerShell (nativo):** `$PROFILE` geralmente aponta para `C:\\Users\\\u003cSeuUsuario\u003e\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1`\n* **PowerShell 7+ (moderno):** `$PROFILE` geralmente aponta para `C:\\Users\\\u003cSeuUsuario\u003e\\Documents\\PowerShell\\Microsoft.PowerShell_profile.ps1`\n\n1. Abra cada arquivo de perfil com `notepad $PROFILE` em sua respectiva versão do PowerShell.\n2. Copie e cole o código abaixo em **ambos** os arquivos:\n\n```powershell   \n$OutputEncoding = [System.Text.Encoding]::UTF8\n[Console]::OutputEncoding = [System.Text.Encoding]::UTF8\n\nfunction Connect-ParrotGUI {\n  [CmdletBinding()]\n  param (\n    [string]$DistroName = \"Parrot\" \n  )\n\n  Write-Host \"Tentando conectar à GUI do WSL: ${DistroName}...\"\n\n  try {\n    Write-Host \"Verificando/Iniciando serviço XRDP em ${DistroName} usando 'service' (pode pedir senha sudo)...\"\n    $statusOutput = wsl -d $DistroName -- sudo service xrdp status\n    if ($statusOutput -match \"is running\") {\n      Write-Host \"Serviço XRDP já está ativo.\"\n    }\n    else {\n      Write-Host \"Serviço XRDP não parece estar ativo. Tentando iniciar com 'sudo service xrdp start'...\"\n      wsl -d $DistroName -- sudo service xrdp start\n      Start-Sleep -Seconds 3 \n      $statusOutputAfterStart = wsl -d $DistroName -- sudo service xrdp status\n      if ($statusOutputAfterStart -match \"is running\") {\n        Write-Host \"Serviço XRDP iniciado com sucesso.\"\n      }\n      else {\n        Write-Warning \"Falha ao iniciar/confirmar o serviço XRDP em ${DistroName} com 'service'. A conexão RDP pode falhar. Verifique manualmente.\"\n      }\n    }\n  }\n  catch {\n    Write-Warning \"Ocorreu um erro ao tentar verificar/iniciar o serviço XRDP em ${DistroName} com 'service'.\"\n    Write-Warning \"Certifique-se de que o XRDP está instalado.\"\n    Write-Warning \"Você pode precisar iniciá-lo manualmente: wsl -d ${DistroName} -- sudo service xrdp start\"\n  }\n\n  Write-Host \"Obtendo endereço IP para ${DistroName}...\"\n  $ipAddress = $null \n  try {\n    $ipOutputLines = wsl -d $DistroName -- ip -4 addr show eth0\n    if ($LASTEXITCODE -ne 0) {\n      Write-Error \"Falha ao executar 'ip addr show eth0' em ${DistroName}. A distro está rodando e acessível?\"\n    }\n    else {\n      foreach ($line in $ipOutputLines) {\n        if ($line -match 'inet\\s+([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)/') {\n          $ipAddress = $matches[1]\n          break \n        }\n      }\n    }\n  }\n  catch {\n    Write-Error \"Falha ao executar comando no WSL para obter IP. Erro: $($_.Exception.Message)\"\n    Write-Host \"Verifique se a distribuição '${DistroName}' está em execução e acessível.\"\n    return \n  }\n\n  if (-not [string]::IsNullOrWhiteSpace($ipAddress)) {\n    Write-Host \"Endereço IP encontrado para ${DistroName}: ${ipAddress}\"\n    Write-Host \"Iniciando Conexão de Área de Trabalho Remota para ${ipAddress} (tela cheia)...\"\n    try {\n      Start-Process mstsc.exe -ArgumentList \"/v:${ipAddress} /f\" -ErrorAction Stop \n    }\n    catch {\n      Write-Error \"Falha ao iniciar a Conexão de Área de Trabalho Remota (mstsc.exe). Erro: $($_.Exception.Message)\"\n      Write-Host \"Verifique se o mstsc.exe está acessível no seu sistema.\"\n    }\n  }\n  else {\n    Write-Error \"Não foi possível obter o endereço IP para ${DistroName}.\"\n    Write-Host \"Verifique os seguintes pontos:\"\n    Write-Host \"1. A instância WSL '${DistroName}' está em execução? (Use: wsl -l -v)\"\n    Write-Host \"2. Dentro do '${DistroName}', a rede (interface eth0) está ativa e com IP? (Use: wsl -d ${DistroName} -- ip addr show eth0)\"\n    Write-Host \"3. Dentro do '${DistroName}', o XRDP está instalado? O comando 'sudo service xrdp start' funciona manualmente?\"\n  }\n}}\n\n```\n3. **Salvar e Recarregar Perfis:** Salve os arquivos. Feche e reabra as janelas do PowerShell ou execute `. $PROFILE` em cada uma.\n4. **Ajustar Política de Execução (se necessário):** Se o comando não for reconhecido, abra o PowerShell como Administrador e execute `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`.\n5. **Uso:** Digite `Connect-ParrotGUI` no PowerShell.\n\n## Solução de Problemas Comuns\n\n* **Erro `systemd ... PID 1`:** Este guia usa `sudo service xrdp start` para compatibilidade com Windows 10. No Windows 11, você pode habilitar `systemd` no arquivo `C:\\Users\\\u003cSeuUsuario\u003e\\.wslconfig` adicionando:\n  ```ini\n  [boot]\n  systemd=true\n  ```\n\n  Lembre-se de `wsl --shutdown` após alterar `.wslconfig`. Se usar `systemd`, substitua `sudo service xrdp start/status/restart` por `sudo systemctl start/status/restart xrdp` e use `sudo systemctl enable xrdp --now` para habilitar o início automático.\n* **Tela Preta/Cinza no XRDP:** Verifique se um ambiente de desktop completo está instalado (Passo 4.2). Certifique-se de que o XRDP está configurado para usar o gerenciador de sessão correto (geralmente automático com metapacotes de desktop).\n* **Comando `Connect-ParrotGUI` não encontrado:** Verifique se a função está salva no arquivo `$PROFILE` correto para a versão do PowerShell que você está usando e se a política de execução permite carregar o perfil.\n* **IP do WSL Muda:** O IP do WSL pode mudar. O script `Connect-ParrotGUI` obtém o IP atual a cada execução.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e🇬🇧 Complete Guide (English)\u003c/summary\u003e\n\n## Overview\n\nParrot OS is a Debian-based GNU/Linux distribution widely used by security professionals and privacy enthusiasts. WSL2 allows running a full Linux environment integrated with Windows, offering excellent performance. This guide focuses on manually importing a Parrot OS *rootfs* for WSL, providing flexibility in choosing the version and installation location.\n\n**Features covered:**\n\n* Setting up WSL2 on Windows.\n* Downloading and preparing a Parrot OS *rootfs* for WSL.\n* Importing and initial setup of Parrot OS in WSL.\n* Installing and configuring a desktop environment (if not included in the *rootfs*).\n* Configuring the XRDP server for remote desktop access.\n* Creating a PowerShell function (`Connect-ParrotGUI`) for quick connection.\n\n## Prerequisites\n\n* Windows 10 (build 19041 or higher) or Windows 11 (64-bit), fully updated.\n* Hardware Virtualization (VT-x/AMD-V) enabled in the system's BIOS/UEFI.\n* Administrator privileges on Windows.\n* Stable internet connection.\n* (Recommended) [Windows Terminal](https://aka.ms/terminal) installed via Microsoft Store.\n\n## Step 1: Enabling WSL2 and Virtualization Features\n\n1. **Open PowerShell as Administrator:**\n   Search for \"PowerShell\", right-click on \"Windows PowerShell\", and select \"Run as administrator\".\n2. **Enable Necessary Features:**\n   Execute the following commands:\n\n   ```powershell\n   dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart\n   dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart\n   ```\n3. **Restart Windows:** This step is crucial.\n4. **Update WSL Components (Including Kernel):**\n   After restarting, open PowerShell (preferably as Administrator) and run:\n\n   ```powershell\n   wsl --update\n   ```\n\n   This command will install the latest version of the Linux kernel and other WSL components.\n5. **Set WSL2 as Default:**\n\n   ```powershell\n   wsl --set-default-version 2\n   ```\n\n## Step 2: Downloading and Preparing Parrot OS RootFS for WSL\n\n1. **Obtain the RootFS:**\n\n   * **Recommended:** Visit the [official Parrot OS download page](https://parrotsec.org/download/) or the [Parrot WSL GitLab project repository](https://gitlab.com/parrotsec/project/wsl) to find the latest WSL version. Look for a direct link to a `.tar.gz` file or a `.zip` file containing it.\n   * **Alternative (Using a Specific Build Link - Use with Caution):** Direct links to GitLab *job* artifacts (e.g., `.../jobs/JOB_ID/artifacts/download...`) may expire or refer to outdated versions. Proceed with caution if using one of these.\n2. **Extract `install.tar.gz` (if necessary):**\n\n   * If you downloaded a file like `artifacts.zip`, extract it.\n   * Navigate through the extracted folder structure (e.g., `Base_Builder/build/output.zip/build/` or similar) to locate the `install.tar.gz` file.\n   * Move this `install.tar.gz` file to an easily accessible location, for example: `C:\\Temp\\ParrotWSL\\install.tar.gz`.\n3. **Create Installation Folder in Windows:**\n   Create a directory where the Parrot OS files will be stored.\n   Example: `C:\\WSL_Distros\\Parrot` (you can choose any drive/path).\n\n## Step 3: Importing and Configuring Parrot OS in WSL\n\n1. **Import into WSL:**\n   Open PowerShell as Administrator and run:\n\n   ```powershell\n   # Replace paths and distro name according to your setup\n   wsl --import Parrot \"C:\\WSL_Distros\\Parrot\" \"C:\\Temp\\ParrotWSL\\install.tar.gz\" --version 2\n   ```\n\n   *(`Parrot` is the suggested name for the distro in WSL. `C:\\WSL_Distros\\Parrot` is the installation directory. `C:\\Temp\\ParrotWSL\\install.tar.gz` is the downloaded rootfs).*\n2. **Initial User Setup:**\n\n   * Start the new distro (will log in as `root`):\n     ```powershell\n     wsl -d Parrot\n     ```\n   * Inside the Parrot terminal, create your user (replace `your_parrot_user`):\n     ```bash\n     adduser your_parrot_user\n     ```\n\n     (Follow the prompts for password and information).\n   * Add the user to necessary groups:\n     ```bash\n     usermod -aG sudo,adm,cdrom,dip,plugdev your_parrot_user\n     ```\n   * Set the user as default for WSL login:\n     ```bash\n     echo -e \"[user]\\ndefault = your_parrot_user\" \u003e /etc/wsl.conf\n     ```\n   * Exit the `root` session:\n     ```bash\n     exit\n     ```\n3. **Finalize and Restart the Distro:**\n   In PowerShell:\n\n   ```powershell\n   wsl --terminate Parrot\n   wsl -d Parrot\n   ```\n\n   You should log in as `your_parrot_user`.\n4. **Update System and Tools:**\n   Inside the Parrot terminal:\n\n   ```bash\n   sudo apt update \u0026\u0026 sudo apt full-upgrade -y\n   # Optional, if the rootfs is \"core\" or to ensure all tools:\n   sudo apt install parrot-tools-full -y\n   ```\n5. **(Optional) Cleanup:** Delete the temporary download and extraction files.\n\n## Step 4: Installing/Verifying the Graphical Environment (Desktop)\n\n1. **Initial Check:**\n\n   * Install XRDP (if not already included in your *rootfs*):\n     ```bash\n     sudo apt update\n     sudo apt install xrdp -y\n     sudo adduser xrdp ssl-cert # Ensures permissions\n     sudo service xrdp restart  # Or 'start'\n     ```\n   * Get the WSL IP (e.g., `ip addr show eth0 | grep \"inet\\b\" | awk '{print $2}' | cut -d/ -f1`).\n   * Try connecting via Windows Remote Desktop Connection to this IP.\n   * **If a Parrot desktop loads:** Great, your *rootfs* already included an environment. Skip to Step 5.\n   * **If black/gray screen or failure after XRDP login:** Proceed to install an environment.\n2. **Install a Desktop Environment (if necessary):**\n\n   * List options: `apt search parrot-desktop`\n   * **Recommended (MATE):**\n     ```bash\n     sudo apt install parrot-desktop-mate -y\n     ```\n   * Alternatives: `parrot-desktop-xfce`, `parrot-desktop-kde`, `parrot-desktop-gnome`.\n   * **Configuration Prompts:** During installation, prompts for `wireshark-common` or `macchanger` may appear. It's recommended to choose **\"No\"** (default) if in doubt.\n   * After installation, restart XRDP:\n     ```bash\n     sudo service xrdp restart\n     ```\n\n## Step 5: Configuring Remote Access with XRDP\n\n1. **Ensure XRDP Installation:** (Should have been done in Step 4.1)\n   ```bash\n   sudo apt install xrdp -y\n   ```\n2. **Add `xrdp` User to `ssl-cert` Group:** (Should have been done in Step 4.1)\n   ```bash\n   sudo adduser xrdp ssl-cert\n   ```\n3. **Start/Restart XRDP Service:**\n   (The PowerShell script in Step 7 will attempt this, but for manual testing:)\n   ```bash\n   sudo service xrdp start\n   # or\n   sudo service xrdp restart\n   ```\n\n   Check status with `sudo service xrdp status`.\n\n## Step 6: Connecting to the Graphical Interface\n\n1. **Get WSL Parrot IP:**\n   In the Parrot terminal:\n   ```bash\n   ip addr show eth0 | grep \"inet\\b\" | awk '{print $2}' | cut -d/ -f1\n   ```\n2. **Remote Desktop Connection (Windows):**\n   * Run `mstsc.exe`.\n   * Enter the WSL IP.\n   * **Certificate Warning:** You will see a warning about the certificate not being trusted and/or the name being incorrect. **This is expected.** Check \"Don't ask me again...\" and click \"Yes\".\n3. **XRDP Login:**\n   * Session: `Xorg` (or `Xvnc`).\n   * Username/Password: Your Parrot OS credentials (`your_parrot_user`).\n   * Click \"OK\".\n\n## Step 7: PowerShell Function for Quick Connection (`Connect-ParrotGUI`)\n\nTo facilitate future connections, add the following function to your PowerShell profiles:\n\n* **Windows PowerShell (native):** `$PROFILE` usually points to `C:\\Users\\\u003cYourUser\u003e\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1`\n* **PowerShell 7+ (modern):** `$PROFILE` usually points to `C:\\Users\\\u003cYourUser\u003e\\Documents\\PowerShell\\Microsoft.PowerShell_profile.ps1`\n\n1. Open each profile file with `notepad $PROFILE` in its respective PowerShell version.\n2. Copy and paste the code below into **both** files:\n\n```powershell\nfunction Connect-ParrotGUI {\n  [CmdletBinding()]\n  param (\n    [string]$DistroName = \"Parrot\" \n  )\n\n  Write-Host \"Attempting to connect to WSL GUI: ${DistroName}...\"\n\n  try {\n    Write-Host \"Checking/Starting XRDP service in ${DistroName} using 'service' (may prompt for sudo password)...\"\n    $statusOutput = wsl -d $DistroName -- sudo service xrdp status\n    if ($statusOutput -match \"is running\") {\n      Write-Host \"XRDP service is already active.\"\n    }\n    else {\n      Write-Host \"XRDP service does not seem to be active. Attempting to start with 'sudo service xrdp start'...\"\n      wsl -d $DistroName -- sudo service xrdp start\n      Start-Sleep -Seconds 3 \n      $statusOutputAfterStart = wsl -d $DistroName -- sudo service xrdp status\n      if ($statusOutputAfterStart -match \"is running\") {\n        Write-Host \"XRDP service started successfully.\"\n      }\n      else {\n        Write-Warning \"Failed to start/confirm XRDP service in ${DistroName} with 'service'. RDP connection might fail. Check manually.\"\n      }\n    }\n  }\n  catch {\n    Write-Warning \"An error occurred while trying to check/start XRDP service in ${DistroName} with 'service'.\"\n    Write-Warning \"Ensure XRDP is installed.\"\n    Write-Warning \"You may need to start it manually: wsl -d ${DistroName} -- sudo service xrdp start\"\n  }\n\n  Write-Host \"Getting IP address for ${DistroName}...\"\n  $ipAddress = $null \n  try {\n    $ipOutputLines = wsl -d $DistroName -- ip -4 addr show eth0\n    if ($LASTEXITCODE -ne 0) {\n      Write-Error \"Failed to execute 'ip addr show eth0' in ${DistroName}. Is the distro running and accessible?\"\n    }\n    else {\n      foreach ($line in $ipOutputLines) {\n        if ($line -match 'inet\\s+([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)/') {\n          $ipAddress = $matches[1]\n          break \n        }\n      }\n    }\n  }\n  catch {\n    Write-Error \"Failed to execute command in WSL to get IP. Error: $($_.Exception.Message)\"\n    Write-Host \"Verify that the '${DistroName}' distribution is running and accessible.\"\n    return \n  }\n\n  if (-not [string]::IsNullOrWhiteSpace($ipAddress)) {\n    Write-Host \"IP address found for ${DistroName}: ${ipAddress}\"\n    Write-Host \"Starting Remote Desktop Connection to ${ipAddress} (fullscreen)...\"\n    try {\n      Start-Process mstsc.exe -ArgumentList \"/v:${ipAddress} /f\" -ErrorAction Stop \n    }\n    catch {\n      Write-Error \"Failed to start Remote Desktop Connection (mstsc.exe). Error: $($_.Exception.Message)\"\n      Write-Host \"Verify that mstsc.exe is accessible on your system.\"\n    }\n  }\n  else {\n    Write-Error \"Could not get IP address for ${DistroName}.\"\n    Write-Host \"Please check the following:\"\n    Write-Host \"1. Is the WSL instance '${DistroName}' running? (Use: wsl -l -v)\"\n    Write-Host \"2. Inside '${DistroName}', is the network (eth0 interface) active and has an IP? (Use: wsl -d ${DistroName} -- ip addr show eth0)\"\n    Write-Host \"3. Inside '${DistroName}', is XRDP installed? Does 'sudo service xrdp start' work manually?\"\n  }\n}\n```\n3. **Save and Reload Profiles:** Save the files. Close and reopen PowerShell windows or run `. $PROFILE` in each.\n4. **Adjust Execution Policy (if needed):** If the command isn't recognized, open PowerShell as Administrator and run `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`.\n5. **Usage:** Type `Connect-ParrotGUI` in PowerShell.\n\n## Common Troubleshooting\n\n* **`systemd ... PID 1` Error:** This guide uses `sudo service xrdp start` for Windows 10 compatibility. On Windows 11, you can enable `systemd` in your `C:\\Users\\\u003cYourUser\u003e\\.wslconfig` file by adding:\n  ```ini\n  [boot]\n  systemd=true\n  ```\n\n  Remember to `wsl --shutdown` after changing `.wslconfig`. If using `systemd`, replace `sudo service xrdp start/status/restart` with `sudo systemctl start/status/restart xrdp` and use `sudo systemctl enable xrdp --now` to enable automatic startup.\n* **Black/Gray Screen on XRDP:** Ensure a full desktop environment is installed (Step 4.2). Make sure XRDP is configured to use the correct session manager (usually automatic with desktop metapackages).\n* **`Connect-ParrotGUI` command not found:** Verify the function is saved in the correct `$PROFILE` file for your PowerShell version and that the execution policy allows loading the profile.\n* **WSL IP Changes:** The WSL IP address can change. The `Connect-ParrotGUI` script gets the current IP on each run.\n\n\u003c/details\u003e\n\n---\n\n## Conclusão\n\nAo seguir este guia, você conseguirá instalar com sucesso o Parrot OS Security Edition no WSL2, configurar um ambiente gráfico acessível via RDP e criar uma função PowerShell conveniente para agilizar suas conexões. O resultado será um poderoso ambiente de segurança e desenvolvimento Linux perfeitamente integrado ao seu sistema Windows.\n\n## Conclusion\n\nBy following this guide, you will be able to successfully install Parrot OS Security Edition on WSL2, configure a graphical environment accessible via RDP, and create a convenient PowerShell function to streamline your connections. This will provide you with a powerful Linux security and development environment seamlessly integrated into your Windows system.\n\n---\n\n## Contribuições\n\nSugestões e melhorias para este guia são bem-vindas. Sinta-se à vontade para abrir uma *Issue* ou um *Pull Request*.\n\n## Contributions\n\nSuggestions and improvements to this guide are welcome. Feel free to open an *Issue* or a *Pull Request*.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchavatte%2Fparrotosinwslwithgui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchavatte%2Fparrotosinwslwithgui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchavatte%2Fparrotosinwslwithgui/lists"}