IT

LLM 파인튜닝 실습을 위한 WSL 설치 VS Code에서 WSL 연결

ShrimpTaco 2025. 5. 7. 22:22
반응형

설치

명령 프롬프트 관리자 권한으로 실행해서 아래 명령어를 입력합니다.

> wsl --install

Microsoft Store에서 다운로드 중인 것을 확인할 수 있습니다. (수동으로 설치하지 않아도 됩니다.)

20.04나 22.04 버전이 안정적일 것 같지만 나중에 업그레이드 하기 싫어서 24.04 LTS 버전으로 설치했습니다.

명령프롬프트를 관리자 권한으로 실행했었는데, 관리자 권한으로 실행하지 않고 설치했을 때 잘 설치 된 걸 확인할 수 있었습니다.

C:\Users\ShrimpTaco>wsl -d Ubuntu
Provisioning the new WSL instance Ubuntu
This might take a while...
Create a default Unix user account: ShrimpTaco
New password:
Retype new password:
passwd: password updated successfully
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

Welcome to Ubuntu 24.04.2 LTS (GNU/Linux 5.15.167.4-microsoft-standard-WSL2 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

 System information as of Fri May 23 21:07:42 KST 2025

  System load:  0.0                 Processes:             31
  Usage of /:   0.1% of 1006.85GB   Users logged in:       0
  Memory usage: 5%                  IPv4 address for eth0: 172.22.115.110
  Swap usage:   0%


This message is shown once a day. To disable it please create the
/home/ShrimpTaco/.hushlogin file.
ShrimpTaco@ShrimpTaco-DESKTOP:/mnt/c/Users/ShrimpTaco$

VS Code에서 Ubuntu 배포판으로 연결하려면 Ubuntu가 실행 중이어야 VS Code가 연결 가능 합니다.

따라서 wsl -d ubuntu 명령어로 Ubuntu를 먼저 켜주었습니다.


VS Code에서 왼쪽 아래 초록색 원격 아이콘 클릭 → Remote-WSL: New Window 선택 →
Ubuntu 배포판으로 연결 시도

VS Code가 기본 WSL 배포판으로 docker-desktop으로 연결하려고 해서, 기본 배포판을Ubuntu로 변경해 주었습니다.

wsl --set-default ubuntu


다시 왼쪽 아래 초록색 원격 아이콘 클릭했더니 정상적으로 연결되어 WSL: Ubuntu라고 뜬 것을 확인할 수 있었습니다.

반응형