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

비밀번호

댓글 작성자
 




... 76  77  [78]  79  80  81  82  83  84  85  86  87  88  89  90  ...
NoWriterDateCnt.TitleFile(s)
11986정성태7/17/201916857오류 유형: 557. 드라이브 문자를 할당하지 않은 파티션을 탐색기에서 드라이브 문자와 함께 보여주는 문제
11985정성태7/17/201917009개발 환경 구성: 452. msbuild - csproj에 환경 변수 조건 사용 [1]
11984정성태7/9/201925540개발 환경 구성: 451. Microsoft Edge (Chromium)을 대상으로 한 Selenium WebDriver 사용법 [1]
11983정성태7/8/201914892오류 유형: 556. nodemon - 'mocha' is not recognized as an internal or external command, operable program or batch file.
11982정성태7/8/201914991오류 유형: 555. Visual Studio 빌드 오류 - result: unexpected exception occured (-1002 - 0xfffffc16)
11981정성태7/7/201918076Math: 64. C# - 3층 구조의 신경망(분류)파일 다운로드1
11980정성태7/7/201928175개발 환경 구성: 450. Visual Studio Code의 Java 확장을 이용한 간단한 프로젝트 구축파일 다운로드1
11979정성태7/7/201918434개발 환경 구성: 449. TFS에서 gitlab/github등의 git 서버로 마이그레이션하는 방법
11978정성태7/6/201917688Windows: 161. 계정 정보가 동일하지 않은 PC 간의 인증을 수행하는 방법 [1]
11977정성태7/6/201922290오류 유형: 554. git push - error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
11976정성태7/4/201916625오류 유형: 553. (잘못 인증 한 후) 원격 git repo 재인증 시 "remote: HTTP Basic: Access denied" 오류 발생
11975정성태7/4/201925424개발 환경 구성: 448. Visual Studio Code에서 콘솔 응용 프로그램 개발 시 "입력"받는 방법
11974정성태7/4/201921157Linux: 22. "Visual Studio Code + Remote Development"로 윈도우 환경에서 리눅스(CentOS 7) C/C++ 개발
11973정성태7/4/201919899Linux: 21. 리눅스에서 공유 라이브러리가 로드되지 않는다면?
11972정성태7/3/201923682.NET Framework: 847. JAVA와 .NET 간의 AES 암호화 연동 [1]파일 다운로드1
11971정성태7/3/201919970개발 환경 구성: 447. Visual Studio Code에서 OpenCvSharp 개발 환경 구성
11970정성태7/2/201918569오류 유형: 552. 웹 브라우저에서 파일 다운로드 후 "Running security scan"이 끝나지 않는 문제
11969정성태7/2/201919035Math: 63. C# - 3층 구조의 신경망파일 다운로드1
11968정성태7/1/201925730오류 유형: 551. Visual Studio Code에서 Remote-SSH 연결 시 "Opening Remote..." 단계에서 진행되지 않는 문제 [1]
11967정성태7/1/201919779개발 환경 구성: 446. Synology NAS를 Windows 10에서 iSCSI로 연결하는 방법
11966정성태6/30/201918721Math: 62. 활성화 함수에 따른 뉴런의 출력을 그리드 맵으로 시각화파일 다운로드1
11965정성태6/30/201919309.NET Framework: 846. C# - 2차원 배열을 1차원 배열로 나열하는 확장 메서드파일 다운로드1
11964정성태6/30/201920862Linux: 20. C# - Linux에서의 Named Pipe를 이용한 통신
11963정성태6/29/201920603Linux: 19. C# - .NET Core Unix Domain Socket 사용 예제
11962정성태6/27/201918287Math: 61. C# - 로지스틱 회귀를 이용한 선형분리 불가능 문제의 분류파일 다운로드1
11961정성태6/27/201917820Graphics: 37. C# - PLplot - 출력 모음(Family File Output)
... 76  77  [78]  79  80  81  82  83  84  85  86  87  88  89  90  ...