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

비밀번호

댓글 작성자
 




... 61  62  63  64  65  66  67  68  [69]  70  71  72  73  74  75  ...
NoWriterDateCnt.TitleFile(s)
12208정성태4/12/202015942Linux: 29. 리눅스 환경에서 C/C++ 프로그램이 Segmentation fault 에러가 발생한 경우
12207정성태4/2/202015742스크립트: 19. Windows PowerShell의 NonInteractive 모드
12206정성태4/2/202018395오류 유형: 613. 파일 잠금이 바로 안 풀린다면? - The process cannot access the file '...' because it is being used by another process.
12205정성태4/2/202015053스크립트: 18. Powershell에서는 cmd.exe의 명령어를 지원하진 않습니다.
12204정성태4/1/202015061스크립트: 17. Powershell 명령어에 ';' (semi-colon) 문자가 포함된 경우
12203정성태3/18/202017888오류 유형: 612. warning: 'C:\ProgramData/Git/config' has a dubious owner: '...'.
12202정성태3/18/202021154개발 환경 구성: 486. .NET Framework 프로젝트를 위한 GitLab CI/CD Runner 구성
12201정성태3/18/202018387오류 유형: 611. git-credential-manager.exe: Using credentials for username "Personal Access Token". [1]
12200정성태3/18/202018496VS.NET IDE: 145. NuGet + Github 라이브러리 디버깅 관련 옵션 3가지 - "Enable Just My Code" / "Enable Source Link support" / "Suppress JIT optimization on module load (Managed only)"
12199정성태3/17/202016130오류 유형: 610. C# - CodeDomProvider 사용 시 Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path '...\f2_6uod0.tmp'.
12198정성태3/17/202019515오류 유형: 609. SQL 서버 접속 시 "Cannot open user default database. Login failed."
12197정성태3/17/202018762VS.NET IDE: 144. .NET Core 콘솔 응용 프로그램을 배포(publish) 시 docker image 자동 생성 - 두 번째 이야기 [1]
12196정성태3/17/202015932오류 유형: 608. The ServicedComponent being invoked is not correctly configured (Use regsvcs to re-register).
12195정성태3/16/202018252.NET Framework: 902. C# - 프로세스의 모든 핸들을 열람 - 세 번째 이야기
12194정성태3/16/202020977오류 유형: 607. PostgreSQL - Npgsql.NpgsqlException: sorry, too many clients already
12193정성태3/16/202017872개발 환경 구성: 485. docker - SAP Adaptive Server Enterprise 컨테이너 실행 [1]
12192정성태3/14/202019879개발 환경 구성: 484. docker - Sybase Anywhere 16 컨테이너 실행
12191정성태3/14/202021019개발 환경 구성: 483. docker - OracleXE 컨테이너 실행 [1]
12190정성태3/14/202015567오류 유형: 606. Docker Desktop 업그레이드 시 "The process cannot access the file 'C:\Program Files\Docker\Docker\resources\dockerd.exe' because it is being used by another process."
12189정성태3/13/202021172개발 환경 구성: 482. Facebook OAuth 처리 시 상태 정보 전달 방법과 "유효한 OAuth 리디렉션 URI" 설정 규칙
12188정성태3/13/202025995Windows: 169. 부팅 시점에 실행되는 chkdsk 결과를 확인하는 방법
12187정성태3/12/202015523오류 유형: 605. NtpClient was unable to set a manual peer to use as a time source because of duplicate error on '...'.
12186정성태3/12/202017381오류 유형: 604. The SysVol Permissions for one or more GPOs on this domain controller and not in sync with the permissions for the GPOs on the Baseline domain controller.
12185정성태3/11/202017958오류 유형: 603. The browser service was unable to retrieve a list of servers from the browser master...
12184정성태3/11/202019887오류 유형: 602. Automatic certificate enrollment for local system failed (0x800706ba) The RPC server is unavailable. [3]
12183정성태3/11/202017688오류 유형: 601. Warning: DsGetDcName returned information for \\[...], when we were trying to reach [...].
... 61  62  63  64  65  66  67  68  [69]  70  71  72  73  74  75  ...