본문 바로가기

 

윈도우 10 의 경우, WSL2에 ubuntu-desktop을 Windows X Server로 띄우면

VMWare,VirtualBox 같은 가상머신처럼 Ubuntu를 사용 가능하다.

 

윈도우 11 의 경우, WSL2에 WSLg 방식으로 X-server로 띄우면

각각의 <Ubuntu 프로그램>을 <윈도우 프로그램>처럼 실행하는 것은 가능하다.

 


Window10 22H2, WSL2

WSL2 With GUI

 

윈도우 기능 켜기

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

$  dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

더보기

1. PowerShell <관리자 모드>로 실행

 

2. "가상 머신 플랫폼" 기능 켜기

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

 

3. "Linux용 Windows 하위 시스템" 기능 켜기 

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

 

 

✅WSL 설치 & 재부팅 & 우분투 자동 설치

$  wsl --install

$  shutdown -r -t 0

더보기

 1. WSL 설치

wsl --install

 

2. 재부팅

shutdown -r -t 0

 

3. 우분투 자동 설치 및 아이디, 비밀번호 등록

 

Windows 선택적 기능 사용

$  Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

더보기
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

 

WSL 버전 설정

wsl -l -v

$  wsl --set-default-version 2

더보기
wsl -l -v
wsl --set-default-version 2

 

Ubuntu 업데이트

$  sudo apt update
$  sudo apt-mark hold acpid acpi-support
$  sudo apt upgrade -y

더보기

1. 

sudo apt update

 

2.

sudo apt-mark hold acpid acpi-support

 

3.

sudo apt upgrade -y

 

ubuntu-desktop, gnome 설치

(오래걸림)
$  sudo apt install ubuntu-desktop gnome -y

더보기
sudo apt install ubuntu-desktop gnome -y

 

.bashrc 설정

$  nano ~/.bashrc

(bashrc 붙여넣기)
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
export LIBGL_ALWAYS_INDIRECT=1

더보기

  bashrc 스크립트 nano 에디터로 열기

sudo nano ~/.bashrc

 

  bashrc 스크립트 하단에 명령어 추가

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
export LIBGL_ALWAYS_INDIRECT=1

 

 

 

  bashrc 스크립트 저장하고 닫기

 

systemd 설정

To enable systemd, use the following commands:
$  cd ~
$  git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
$  cd ubuntu-wsl2-systemd-script/
$  bash ubuntu-wsl2-systemd-script.sh

더보기
cd ~
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash ubuntu-wsl2-systemd-script.sh

 

WSL 종료

PowerShell 에서 wsl 종료
$   wsl --shutdown

더보기

1. PowerShell <관리자 모드>로 실행

 

2. PowerShell 에서 wsl 종료 

 

XLaunch 설치

 

XLaunch 실행

 

gnome-session 실행

더보기
gnome-session

 

 

BasicLike

어? 나 프로그래밍 좋아하네?