WSL: Problema ao iniciar o ubuntu wsl2

Environment

Habilite o recurso Plataforma de Máquina Virtual do Windows e verifique se a virtualização está habilitada no BIOS.     Para obter mais informações, acesse https://aka.ms/wsl2-install                                                         Press any key to continue...

Steps to reproduce

WSL logs: Habilite o recurso Plataforma de Máquina Virtual do Windows e verifique se a virtualização está habilitada no BIOS. Para obter mais informações, acesse https://aka.ms/wsl2-install Press any key to continue…

Expected behavior

Actual behavior

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 17

Most upvoted comments

Execute no PowerShell como Administrador:

  1. dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  2. dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Reinicie o computador e execute esses:

  1. DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
  2. bcdedit /set hypervisorlaunchtype auto

Reinicie o computador e pronto!

Conforme destacado por @stavski, em alguns casos pode ser necessário verificar e reparar a imagem do Windows. Para isso, antes de tudo, execute os comandos:

  1. DISM /Online /Cleanup-image /Scanhealth
  2. DISM /Online /Cleanup-image /Restorehealth

Obrigado funcionou corretamente mas tive que executar esses dois comandos antes de tudo e reiniciar o pc.

DISM /Online /Cleanup-image /Scanhealth DISM /Online /Cleanup-image /Restorehealth

Executa no power shell como adm:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Reinicia o pc…

Executa esses:

DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V

bcdedit /set hypervisorlaunchtype auto

Reinicia o pc e pronto.

It worked on win11

Consegui e finalmente deu certo esse erro, obrigado

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Executa no power shell como adm:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Reinicia o pc…

Executa esses:

DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V

bcdedit /set hypervisorlaunchtype auto

Reinicia o pc e pronto.

Thanks!! It worked on win11 2023. /o/