[WSL] Install WSL (Windows Subsystem for Linux)

2023. 6. 12. 00:48·Programming
728x90
728x90

[WSL] Install WSL

Pre-requirements.

  • windows 10 이상 : ( version 2004 , build 19041 이상이어야 함.)
  • windows 11 권장 : ( gpu 기능 등 가능... )
  • Tensorflow나 Pytorch등에서 GPU가속을 제대로 쓰려면, build 20150 이상은 되어야 함 (GPGPU가 없는 경우엔 상관없으니 pass)

다음은 GPU 관련 자료임:

더보기

2022.07.17 - [Computer/CUDA] - [ML] WSL2 : Install Tensorflow (GPU)

 

[ML] WSL2 : Install Tensorflow (GPU)

wsl2부터는 gpu 사용가능함: cuda 가능! tensorflow 의 GPU 를 사용하기 위한 CUDA를 WSL2에서 본격적으로 지원.DirectML을 통해서도 GPU지원이 가능하지만, 아직까지는 CUDA가 나은 편임.Pre-requirements1. Windows 11

dsaint31.tistory.com


다음은 MS의 공식 문서임:

더보기

https://learn.microsoft.com/en-us/windows/wsl/install

 

Install WSL

Install Windows Subsystem for Linux with the command, wsl --install. Use a Bash terminal on your Windows machine run by your preferred Linux distribution - Ubuntu, Debian, SUSE, Kali, Fedora, Pengwin, Alpine, and more are available.

learn.microsoft.com


 


참고: 최신 내용

2026.1 현재 가장 권장되는 설치 방식은 winget과 wsl --install을 이용하는 방식임.

https://ds31x.tistory.com/585

 

WSL 을 winget으로 설치 및 제거하기

이 문서는 winget 기반으로 WSL + Debian을 설치하고 WSL2로 사용한 뒤, 다시 완전히 제거하는 절차를 정리함. 2024.09.08 - [utils] - [Utils] winget 간단 사용법 [Utils] winget 간단 사용법winget은 CLI Windows Package Man

ds31x.tistory.com


Windows 버전확인.

  • windows키 + R 누르고 winver 입력
  • 버전 등을 확인하고 확인 클릭

WSL완전제거 (필요시)

https://ds31x.tistory.com/386

 

[CE] WSL 완전제거하기

WSL 완전 제거 방법Linux 배포판 등록 해제: 이 과정은 해당 distribution(배포판)의 모든 데이터를 삭제하므로, 중요한 데이터는 미리 백업해야 함.Command Prompt(또는 PowerShell)을 열고 wsl -l -v 명령어로

ds31x.tistory.com


Install WSL.

  1. Windows 관련 기능 활성화 (관리자 권한 필요):
    1. 제어판 > 프로그램 및 기능 > Windows 기능 켜기/끄기로 이동.
    2. "Windows Subsystem for Linux"와 "Virtual Machine Platform" 등을 체크.
      • "Windows Subsystem for Linux" = Linux용 Windows 하위시스템
      • "Virtual Machine Platform" = 가상 머신 플랫폼
    3. 확인을 누르고 컴퓨터를 reboot.
  2. cmd or wt를 관리자모드로 실행. (Powershell을 사용해도 됨. )
    1. 커맨드 프롬프트 (cmd) 에서 설치 또는 Powershell에서 설치.
    2. windows키 + r을 누르고 cmd라고 치면, 커맨드 프롬프트(=터미널)이 수행됨.
  3. cmd(command rompt)에서 다음을 입력.
    wsl --install
    • 특정 distribution을 지정하여 설치하려면 다음과 같음.
      wsl --install -d <distribution>
    • 18.04로 설치한다면 다음과 같음.
      wsl --install -d ubuntu-18.04
    • online에서 설치 가능한 배포판 확인하려면 다음을 입력.
      wsl --list --online
      참고로, Microsoft store에서 찾는 게 설명이 보다 자세함.
  4. 이후 알아서 설치가 됨.
    • 기본으로 설치되는 배포판(Ubuntu)의 username, password를 설정하는 과정이 포함됨.
    • 가급적 암호를 잊지 않도록 주의할 것.

문제가 발생할 경우 다음을 참고

위의 순서대로 했는데도 다음의 에러들이 발생할 수 있음.

error code: 0x8004032d 또는 0x8000000d

이 경우,

  1. windows키 + R누르고 optional features 를 입력하고 엔터를 눌러 Windows 기능 켜기/끄기를 실행하고,
  2.  다음 그림처럼 Linux용 Windows 하위시스템 이 클릭되어 있는지 확인할 것.
  3.  이후 시스템을 재부팅하고 wsl --install 등을 다시 시도해볼 것.)

 

이 외의 에러는 아래로 내려가서 에러 코드에 해당하는 페이지의 지시를 따를 것.


WSL 실행하기.

  1. 설치 이후 버전 확인
    wsl -l -v
    • asterisk, * 가 붙은 것이 기본으로 수행되는 distribution임
      (bash등으로 실행 배포판을 지정하지 않은 경우 기본으로 수행되는 distribution이 된다.)
    • VERSION이 2여야 GUI 및 CUDA 등을 사용 가능해짐.
    • wsl --update 를 수행할 것. (←version2로 올림)
  2. 특정 배포판 지정하여 실행
    (가운데 있는 ~의 위치에 셀이 시작되는 경로를 지정한다. ~는 default 유저의 home directory를 의미함.).
    wsl ~ -d [Distribution]
    • 그냥 기본으로 지정된 배포판 실행은 bash or wsl임 (wsl 권장).

Ubuntu 또는 Debian을 설치하길 권함 : 가장 널리 쓰이기 때문에 이후 패키지들의 설치가 원활함.
Ubuntu 실행 후, sudo apt-get update 와 sudo apt-get upgrade 수행할 것.


wsl 의 Shell 에서도 wsl 명령어(window terminal에서 쓰던)를 사용가능함.
단, wsl.exe로 수행해야 함.

 

WSL의 사용법은 다음을 참고할 것.

https://ds31x.tistory.com/67

 

[Env] WSL 기본 명령어 정리.

wsl 자체 관련 wsl update or rollback (wsl 자체에 대한)wsl --update # wsl version updatewsl --update rollback # 이전 버전으로상태 확인 wsl --statusHelpwsl --helpDistribution 실행 관련wsl로 default distribution 실행하기bashwsl -l

ds31x.tistory.com


설치도중 Error에 대한 해결책

Error code : 0x800701bc

아래의 url로 해도 되지만, 더 아래에 있는 0x8004032d의 경우로 해도 되는 경우 있음.

https://ds31x.tistory.com/76

 

[Error] WSL 설치 관련

wsl 설치 중 다음의 error가 발생한 경우, MS의 다음 URL에서 WSL2 Linux 커널 업데이트 패키지를 다운로드하고 이를 설치한다. https://learn.microsoft.com/ko-kr/windows/wsl/install-manual#step-4---download-the-linux-kernel-u

ds31x.tistory.com


Error code : 0x80370102

https://ds31x.tistory.com/77

 

[Error] WSL : Error: 0x80370102

"Error: 0x80370102 필요한 기능이 설치되어 있지 않아 가상 머신을 시작할 수 없습니다." 위의 에러를 해결하려면, CPU의 virutalization을 활성화해야 한다. BIOS에서 설정 Intel CPU의 경우, BIOS에서 Intel(VMX)

ds31x.tistory.com


Error code : 0x8004032d 또는 0x8000000d

https://ds31x.tistory.com/323

 

[Error] WSL: 0x8004032d / 0x800000d

WSL을 설치하다 다음의 에러를 발생하는 경우가 있음(Windows10에서 설치하다 발생함)우선기본 Distribtion이 설치가 안 되고,재부팅 등을 해도 이 두 에러코드 중 하나를 출력하면서 WSL에 동작하지 않

ds31x.tistory.com


root 계정으로만 로그인 되는 경우.

https://ds31x.tistory.com/102

 

[WSL] root계정으로만 로그인 되는 경우.

WSL로 ubuntu등을 설치할 때, 중간에 해당 배포판의 계정을 입력하라는 다음의 문구가 나온다.Installing: Ubuntu 20.04 LTSUbuntu 20.04 LTS has been installed.Launching Ubuntu 20.04 LTS...Installing, this may take a few minutes...

ds31x.tistory.com

 


References

https://learn.microsoft.com/ko-kr/windows/wsl/install

 

WSL 설치

wsl --install 명령을 사용하여 Linux용 Windows 하위 시스템을 설치합니다. Ubuntu, Debian, SUSE, Kali, Fedora, Pengwin, Alpine 등 원하는 Linux 배포판에서 실행되는 Windows 머신에서 Bash 터미널을 사용할 수 있습니

learn.microsoft.com

https://devblogs.microsoft.com/commandline/install-wsl-with-a-single-command-now-available-in-windows-10-version-2004-and-higher/

 

Install WSL with a single command now available in Windows 10 version 2004 and higher

In the latest Windows Insider Preview builds, you can install everything you need to run WSL just by running wsl.exe --install. We’re excited to announce that this functionality is now officially backported to Windows 10 version 2004 and higher, which wi

devblogs.microsoft.com

 

https://dsaint31.tistory.com/423

 

[CE] Introduction of WSL

Windows Subsystem for Linux : Linux용 Windows 하위 시스템.Windows OS를 사용하는 사용자 및 개발자가GNU/Linux용 Software 혹은 개발툴을 사용해야 하는 경우, (opensource의 강력함 때문에 linux를 사용해야하는 경우

dsaint31.tistory.com


https://ds31x.tistory.com/585

 

WSL 을 winget으로 설치 및 제거하기

이 문서는 winget 기반으로 WSL + Debian을 설치하고 WSL2로 사용한 뒤, 다시 완전히 제거하는 절차를 정리함. 2024.09.08 - [utils] - [Utils] winget 간단 사용법 [Utils] winget 간단 사용법winget은 CLI Windows Package Man

ds31x.tistory.com

 

https://ds31x.tistory.com/586

 

WSL (WSL2 포함) 정리

WSL(Windows Subsystem for Linux)Windows 환경에서 GNU/Linux 실행 환경을 제공가상 머신이나 듀얼 부팅 없이 Linux용 개발 도구와 소프트웨어를 사용할 수 있게 해주는 Windows의 하위 시스템.기존의 가상화, 듀

ds31x.tistory.com


 

728x90

'Programming' 카테고리의 다른 글

[Python] (Data) Type: Summary  (0) 2023.06.12
[Python] Expression vs. Statement  (0) 2023.06.12
[Python] Python 소개?  (0) 2023.06.12
[Python] Dynamic Typed Language vs. Static Typed Language  (0) 2023.06.11
[Python] Keyword란? (Soft Keyword 포함)  (0) 2023.06.11
'Programming' 카테고리의 다른 글
  • [Python] (Data) Type: Summary
  • [Python] Expression vs. Statement
  • [Python] Python 소개?
  • [Python] Dynamic Typed Language vs. Static Typed Language
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (785)
      • Private Life (15)
      • Programming (55)
        • DIP (116)
        • ML (34)
      • Computer (119)
        • CE (53)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (368)
        • Signals and Systems (115)
        • Math (176)
        • Linear Algebra (33)
        • Physics (43)
        • 인성세미나 (1)
      • 정리필요. (61)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (7)
        • PET Study 2009 (1)
        • 방사선 장해방호 (5)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

    • Test
    • PET Study 2009
    • 기타 방사능관련.
  • 인기 글

  • 태그

    Probability
    SIGNAL
    ML
    fourier transform
    random
    Programming
    Python
    function
    signals_and_systems
    signal_and_system
    linear algebra
    인허가제도
    math
    Vector
    SS
    opencv
    cv2
    Optimization
    numpy
    Term
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
[WSL] Install WSL (Windows Subsystem for Linux)
상단으로

티스토리툴바