Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

Windows Server 2022 + docker desktop 설치 시 WSL 2로 선택한 경우 "Failed to deploy distro docker-desktop to ..." 오류 발생

현재 버전의 Windows Server 2022는 10.0.20348 버전이므로 이 글에서 설명한 오류가 발생하지 않습니다. 만약 발생한다면 윈도우 업데이트를 통해 20348 버전을 설치해야 합니다.




Docker desktop을 Windows Server 2022에서 설치하면 이렇게 떡 하니,

docker_desktop_wsl2_2022_1.png

"WSL 2"를 지원하는 플랫폼이라고 나오면서 "Enable WSL 2" 버튼을 어서 눌러 달라는 듯이 창을 띄워줍니다. 그래서 버튼을 눌렀더니 이후 "Failed to deploy distro docker-desktop to ..."라는 오류 메시지가 발생합니다.

System.InvalidOperationException:
Failed to deploy distro docker-desktop to %USERPROFILE%\AppData\Local\Docker\wsl\distro: exit code: -1
 stdout: Copyright (c) Microsoft Corporation. All rights reserved.

...[생략]...

 stderr: 
   at Docker.ApiServices.WSL2.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\PR-16841\src\github.com\docker\pinata\win\src\Docker.ApiServices\WSL2\WslCommand.cs:line 146
   at Docker.Engines.WSL2.WSL2Provisioning.<DeployDistroAsync>d__17.MoveNext() in C:\workspaces\PR-16841\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\WSL2Provisioning.cs:line 168
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.Engines.WSL2.WSL2Provisioning.<ProvisionAsync>d__8.MoveNext() in C:\workspaces\PR-16841\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\WSL2Provisioning.cs:line 77
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__28.MoveNext() in C:\workspaces\PR-16841\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 179
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\PR-16841\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\PR-16841\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 67
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\PR-16841\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.EngineStateMachine.<StartAsync>d__14.MoveNext() in C:\workspaces\PR-16841\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\EngineStateMachine.cs:line 69
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.Engines.Engines.<RestartAsync>d__26.MoveNext() in C:\workspaces\PR-16841\src\github.com\docker\pinata\win\src\Docker.Engines\Engines.cs:line 265

wsl.exe를 실행해 docker-desktop을 설치하려고 시도했던 것 같은데, 결정적으로 그 명령어가 뭐였는지에 대한 정보가 없습니다.

어쩔 수 없이 sysmon을 이용해,

실행된 프로세스(EXE)의 명령행 인자를 확인하고 싶다면 - Sysmon
; https://www.sysnet.pe.kr/2/0/1771

확인한 결과 다음의 명령어였습니다.

Process Create:
...[생략]...
IntegrityLevel: Medium
Hashes: SHA1=667C43C37E61ACFEB248C8D263B38789B50C0F0C
ParentProcessGuid: {2732301c-ab0b-61ba-d511-000000000200}
ParentProcessId: 5308
ParentImage: C:\Windows\System32\wsl.exe
ParentCommandLine: "C:\WINDOWS\system32\wsl.exe" --import docker-desktop "%USERPROFILE%\AppData\Local\Docker\wsl\distro" "C:\Program Files\Docker\Docker\resources\wsl\wsl-bootstrap.tar" --version 2

실제로 저렇게 명령어를 실행해 보면 정상적인 출력을 보이지 않습니다. 약간의 시행착오를 거치면 "--version 2"라는 옵션이 문제라는 것을 알 수 있는데요, 그래서 일단 저 옵션을 빼고 실행하면 다음과 같이 잘 됩니다.

c:\temp> wsl.exe --import docker-desktop "%USERPROFILE%\AppData\Local\Docker\wsl\distro" "C:\Program Files\Docker\Docker\resources\wsl\wsl-bootstrap.tar"

c:\temp> wsl --list -v
  NAME              STATE           VERSION
* docker-desktop    Stopped         1

VERSION이 1이라고 되어 있으니 이 부분만 2로 설정되도록 다시 명령을 내려야 하는데,

c:\temp> wsl --set-version docker-desktop 2

이게 문제입니다. 실행해 보면, 결과가 "wsl --help" 화면이 나옵니다. 즉, 해당 명령어의 해석을 지원하지 않는 것입니다. 그렇다고 해서 --set-version 옵션이 아예 누락된 것은 아닌 듯합니다. 왜냐하면 다음과 같이 명령을 내리면,

c:\temp> wsl --set-version docker-desktop
A version number could not be parsed.

버전이 지정되지 않았다고 뜨기 때문입니다. 희한하군요, 이와 마찬가지로 기본 버전도 지정이 안 됩니다.

c:\temp> wsl --set-default-version 2

위의 실행 결과 역시 단순히 "wsl --help" 결과가 나옵니다.




그러다가 우연히 "--status" 옵션을 줬더니,

c:\temp> wsl --status
Default Distribution: docker-desktop
Default Version: 1

WSL automatic updates are on.

The WSL 2 kernel file is not found. To update or restore the kernel please run 'wsl.exe --update'.

c:\temp> wsl --update
Checking for updates...
No updates are available.
The WSL 2 kernel file is not found and may need to be reinstalled or repaired manually.
For more information please visit https://aka.ms/wsl2kernel.

왠지 희망이 보입니다. ^^ 하지만 "wsl.exe --update"로는 안 되는 것 같고, 할 수 없이 웹 사이트를 방문해,

Step 4 - Download the Linux kernel update package
; https://docs.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package

아래의 구성 요소를 다운로드해 설치했습니다.

WSL2 Linux kernel update package for x64 machines
; https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

잘 반영이 되었는지 --status 옵션으로 다시 실행해 보면,

c:\temp> wsl --status
Default Distribution: docker-desktop
Default Version: 1

Windows Subsystem for Linux was last updated on 2021-12-16
WSL automatic updates are on.

Kernel version: 5.10.16

뭔가 느낌이 좋지만, ^^; 여전히 --set-version, --set-default-version 명령어는 먹히지 않습니다.




재미있는 건, 버전을 1로 했을 때는 잘 실행이 된다는 점입니다.

c:\temp> wsl --set-default-version 1
The operation completed successfully.

c:\temp> wsl --set-version docker-desktop 1
Conversion in progress, this may take a few minutes...
No such interface supported

그러니까, 분명히 지금 Windows Server 2022의 WSL 버전이 1로 동작하고 있는 것입니다. 음... 깜빡 속았군요, 결국 docker desktop은 현재 환경이 WSL 2를 지원하는지 단순히 윈도우의 버전으로 확인한 것에 불과한 것입니다.

게다가 검색해 보면, Windows Server 2019부터 preview 빌드에 WSL 2를 지원한다는 글들이 있어서,

How to Install WSL 2 on Windows Server
; https://www.thomasmaurer.ch/2019/08/how-to-install-wsl-2-on-windows-server/

프리뷰 빌드 기준으로 18945 버전부터 지원했으니, 당연히 2022는 20348이므로 지원을 할 거라고 생각했지만 오산이었습니다.

결론은, Windows Server 2022는 WSL 2를 아직 지원하지 않습니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 11/3/2022]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  2  3  4  5  6  7  8  9  [10]  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13693정성태7/24/20247233개발 환경 구성: 717. Visual Studio - C# 프로젝트에서 레지스트리에 등록하지 않은 COM 개체 참조 및 사용 방법파일 다운로드1
13692정성태7/24/20248012디버깅 기술: 199. Windbg - 리눅스에서 뜬 닷넷 응용 프로그램 덤프 파일에 포함된 DLL의 Export Directory 탐색
13691정성태7/23/20247369디버깅 기술: 198. Windbg - 스레드의 Win32 Message Queue 정보 조회
13690정성태7/23/20247005오류 유형: 919. Visual C++ 리눅스 프로젝트 - error : ‘u8’ was not declared in this scope
13689정성태7/22/20248508디버깅 기술: 197. Windbg - PE 포맷의 Export Directory 탐색
13688정성태7/21/20247615닷넷: 2281. C# - Lock / Wait 상태에서도 일부 Win32 메시지 처리파일 다운로드1
13687정성태7/19/20248045닷넷: 2280. C# - PostThreadMessage로 보낸 메시지를 Windows Forms에서 수신하는 방법파일 다운로드1
13686정성태7/19/20247842오류 유형: 918. Visual Studio - ATL Simple Object 추가 시 error C2065: 'IDR_...': undeclared identifier
13685정성태7/19/20247990스크립트: 66. Windows 디렉터리 경로를 WSL의 /mnt 포맷으로 구하는 방법 - 두 번째 이야기
13684정성태7/19/20248164닷넷: 2279. C# - 문자열 보간식 사례 (예: 조건 연산자 사용)
13683정성태7/18/20247637오류 유형: 917. ClrMD - Linux 환경의 .NET 5 덤프 분석 시 hang 현상
13682정성태7/18/20247854닷넷: 2278. WPF - 스레드에 종속되는 DependencyObject파일 다운로드1
13681정성태7/17/20247459닷넷: 2277. C# 13 - (2) 메서드 그룹의 자연 타입 개선 (메서드 추론 개선)파일 다운로드1
13680정성태7/16/20247837닷넷: 2276. C# - Method Group, Natural Type, function_type파일 다운로드1
13679정성태7/16/20246934Linux: 76. Linux - C++ (getaddrinfo 등을 담고 있는) libnss 정적 링크
13678정성태7/15/20247051VS.NET IDE: 191. Visual Studio 2022 - .NET 5 프로젝트를 Docker Support로 실행했을 때 오류
13677정성태7/15/20247131오류 유형: 916. MSBuild - CheckEolTargetFramework (warning NETSDK1138)
13676정성태7/14/20247315Linux: 75. gdb에서 glibc의 함수에 Breakpoint 걸기
13675정성태7/13/20249101C/C++: 166. C/C++ - DLL에서 template 함수를 export하는 방법 [1]파일 다운로드1
13674정성태7/13/20247984오류 유형: 915. Unhandled Exception: Microsoft.Diagnostics.NETCore.Client.ServerNotAvailableException: Unable to connect to Process
13673정성태7/11/20248427닷넷: 2275. C# 13 - (1) 신규 이스케이프 시퀀스 '\e'파일 다운로드1
13672정성태7/10/20247142닷넷: 2274. IIS - (프로세스 종료 없는) AppDomain Recycle
13671정성태7/10/20247258오류 유형: 914. Package ca-certificates is not installed.
13669정성태7/9/20247366오류 유형: 913. C# - AOT StaticExecutable 정적 링킹 시 빌드 오류
13668정성태7/8/20247393개발 환경 구성: 716. Hyper-V - Ubuntu 22.04 Generation 2 유형의 VM 설치
13667정성태7/7/20246608닷넷: 2273. C# - 리눅스 환경에서의 Hyper-V Socket 연동 (AF_VSOCK)파일 다운로드1
1  2  3  4  5  6  7  8  9  [10]  11  12  13  14  15  ...