December 13, 2021

How to update WSL1 to WSL2

 

WSL1 cannot run 32-bit ELF files, so the update to WSL2 is required. The process is as follows.

 

WSL1은 32비트 ELF 파일을 실행할 수 없으므로 WSL2로 업데이트가 필요하다. 해당 과정은 아래와 같다.

 

 

 

1. Check the version.
버전 확인.

> wsl -l -v
  NAME            STATE           VERSION
* Ubuntu-20.04    Stopped         1

 

If the WSL version is 1 when you enter the above command in CMD or Powershell, you need to update it.

 

CMD 또는 파워쉘에서 위와 같이 명령어를 입력했을 때 WSL 버전이 1로 나온다면 업데이트할 필요가 있다.




2. Enable VirtualMachinePlatform option.
VirtualMachinePlatform 옵션 활성화.

> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

 

Reboot after entering the above command. 


위 명령어를 입력 후에는 재부팅한다.




3. Install Linux Kernel Components.
리눅스 커널 구성요소 설치.

Windows Subsystem for Linux Update Setup (Link)


Reboot after installation is complete. 

 

설치 완료 후 재부팅한다.




4. Apply WSL2.
WSL2 적용.

> wsl --set-version Ubuntu-20.04 2

변환이 진행 중입니다. 몇 분 정도 걸릴 수 있습니다...
WSL 2와의 주요 차이점에 대한 자세한 내용은 https://aka.ms/wsl2를 참조하세요
변환이 완료되었습니다.

> wsl -l -v
  NAME            STATE          VERSION
* Ubuntu-20.04    Stopped        2

 

For the application target, input what is written in "NAME". If the WSL2 application is successful, you can see the string "Conversion is complete" and the number in "VERSION" is changed.


적용 대상은 "NAME"에 적혀있는 것을 입력한다. WSL2 적용 성공 시 "변환이 완료되었습니다."라는 문자열을 확인할 수 있으며 "VERSION"의 숫자가 변경된다.