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)
13298정성태3/27/20233682Windows: 236. Win32 - MessageBeep 소리가 안 들린다면?
13297정성태3/26/20234358Windows: 235. Win32 - Code Modal과 UI Modal
13296정성태3/25/20233696Windows: 234. IsDialogMessage와 협업하는 WM_GETDLGCODE Win32 메시지 [1]파일 다운로드1
13295정성태3/24/20233964Windows: 233. Win32 - modeless 대화창을 modal처럼 동작하게 만드는 방법파일 다운로드1
13294정성태3/22/20234139.NET Framework: 2105. LargeAddressAware 옵션이 적용된 닷넷 32비트 프로세스의 가용 메모리 - 두 번째
13293정성태3/22/20234205오류 유형: 853. dumpbin - warning LNK4048: Invalid format file; ignored
13292정성태3/21/20234330Windows: 232. C/C++ - 일반 창에도 사용 가능한 IsDialogMessage파일 다운로드1
13291정성태3/20/20234742.NET Framework: 2104. C# Windows Forms - WndProc 재정의와 IMessageFilter 사용 시의 차이점
13290정성태3/19/20234249.NET Framework: 2103. C# - 윈도우에서 기본 제공하는 FindText 대화창 사용법파일 다운로드1
13289정성태3/18/20233440Windows: 231. Win32 - 대화창 템플릿의 2진 리소스를 읽어들여 자식 윈도우를 생성하는 방법파일 다운로드1
13288정성태3/17/20233554Windows: 230. Win32 - 대화창의 DLU 단위를 pixel로 변경하는 방법파일 다운로드1
13287정성태3/16/20233709Windows: 229. Win32 - 대화창 템플릿의 2진 리소스를 읽어들여 윈도우를 직접 띄우는 방법파일 다운로드1
13286정성태3/15/20234168Windows: 228. Win32 - 리소스에 포함된 대화창 Template의 2진 코드 해석 방법
13285정성태3/14/20233757Windows: 227. Win32 C/C++ - Dialog Procedure를 재정의하는 방법파일 다운로드1
13284정성태3/13/20233955Windows: 226. Win32 C/C++ - Dialog에서 값을 반환하는 방법파일 다운로드1
13283정성태3/12/20233497오류 유형: 852. 파이썬 - TypeError: coercing to Unicode: need string or buffer, NoneType found
13282정성태3/12/20233822Linux: 58. WSL - nohup 옵션이 필요한 경우
13281정성태3/12/20233735Windows: 225. 윈도우 바탕화면의 아이콘들이 넓게 퍼지는 경우 [2]
13280정성태3/9/20234496개발 환경 구성: 670. WSL 2에서 호스팅 중인 TCP 서버를 외부에서 접근하는 방법
13279정성태3/9/20234048오류 유형: 851. 파이썬 ModuleNotFoundError: No module named '_cffi_backend'
13278정성태3/8/20234019개발 환경 구성: 669. WSL 2의 (init이 아닌) systemd 지원 [1]
13277정성태3/6/20234663개발 환경 구성: 668. 코드 사인용 인증서 신청 및 적용 방법(예: Digicert)
13276정성태3/5/20234338.NET Framework: 2102. C# 11 - ref struct/ref field를 위해 새롭게 도입된 scoped 예약어
13275정성태3/3/20234693.NET Framework: 2101. C# 11의 ref 필드 설명
13274정성태3/2/20234278.NET Framework: 2100. C# - ref 필드로 ref struct 타입을 허용하지 않는 이유
13273정성태2/28/20233973.NET Framework: 2099. C# - 관리 포인터로서의 ref 예약어 의미
1  2  3  4  5  6  7  8  9  10  11  12  [13]  14  15  ...