docker 오류 : An unexpected error occurred
docker desktop을 실행하는 와중에 다음과 같은 오류메세지가 떴다.
Docker Desktop - Unexpected WSL error An unexpected error occurred while executing a WSL command. |
An unexpected error occurred while executing a WSL command. Either shut down WSL down with wsl --shutdown, and/or reboot your machine. You can also try reinstalling WSL and/or Docker Desktop. If the issue persists, deploying WSL2 distributions ensuring main distro is deployed: deploying "docker-desktop": importing WSL distro "WSL2는 현재 컴퓨터 구성에서 지원되지 않습니다.\r\n\"가상 머신 플랫폼\" 선택적 구성 요소를 사용하도록 설정하고 BIOS에서 가상화가 사용하도록 설정되어 있는지 확인하세요.\r\n실행하여 \"가상 머신 플랫폼\"을 사용하도록 설정: wsl.exe --install --no-distribution\r\n자세한 내용은 https://aka.ms/enablevirtualization 참조하세요.\r\n오류 코드: Wsl/Service/RegisterDistro/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED\r\n" output="docker-desktop": exit code: 4294967295: running WSL command wsl.exe C:\WINDOWS\System32\wsl.exe --import docker-desktop \AppData\Local\Docker\wsl\main C:\Program Files\Docker\Docker\resources\wsl\wsl-bootstrap.tar --version 2: WSL2는 현재 컴퓨터 구성에서 지원되지 않습니다. "가상 머신 플랫폼" 선택적 구성 요소를 사용하도록 설정하고 BIOS에서 가상화가 사용하도록 설정되어 있는지 확인하세요. 실행하여 "가상 머신 플랫폼"을 사용하도록 설정: wsl.exe --install --no-distribution 자세한 내용은 https://aka.ms/enablevirtualization 참조하세요. 오류 코드: Wsl/Service/RegisterDistro/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED : exit status 0xffffffff checking if isocache exists: CreateFile \\wsl$\docker-desktop-data\isocache\: The network name cannot be found.
해결방안
1. BIOS 가상화활성화
- 컴퓨터를 재부팅하여 BIOS 설정으로 진입
- Virtualization 또는 Intel VT-x (AMD 시스템의 경우 AMD-V) 옵션을 찾아 활성화
- 변경사항을 저장한 후 PC 재부팅
2. Windows 기능 켜기/끄기
- 아래의 항목들이 체크되어 활성화 되어있는지 확인
- Hyper-V
- Windows 하이퍼바이저 플랫폼
- 가상 머신 플랫폼
3. Windows에서 가상 머신 플랫폼 활성화
- 관리자 권한으로 PowerShell 실행 후 명령어 입력
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- 명령어 실행 후 PC 재부팅
4. PowerShell(관리자권한)에서 명령어 실행
bcdedit /enum | findstr -i hypervisorlaunchtype
👉 hypervisorlaunchtype Off 일 경우
bcdedit /set hypervisorlaunchtype Auto
나는 여러번 시도하여 4번 해결방법을 통해 해결했다.