OS/Linux

WSL2에서 GUI 사용하기

dozob 2021. 10. 19. 20:21
$ wget -qO - https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
$ sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'
$ sudo apt-get update
$ sudo apt-get install atom

WSL2가 설치되었고 Ubuntu(20.04 LTS)도 설치되어 있음.

 

Xming X Server for Windows 설치

(2021.10.19 - Xming-6-9-0-31-setup.exe)

https://sourceforge.net/projects/xming/

 

Xming X Server for Windows

Download Xming X Server for Windows for free. X Window System Server for Windows. Xming is the leading X Window System Server for Microsoft Windows 8/7/Vista/XP (+ server 2012/2008/2003). It is fully featured, small and fast, simple to install and because

sourceforge.net

XLaunch 실행

Multiple windows 선택
No Access Control 체크
[마침]

Windows 보안 경고 화면이 뜨면 모두 체크하고 [액세스 허용] 클릭

만약 체크를 잘못하고 넘어간 경우:

"제어판 > 시스템 및 보안 > Windows Defender 방화벽"

Windows Defender 방화벽을 통해 앱 또는 기능 허용

 

WSL2 > Ubuntu 상에서 DNS 서버 IP 주소 확인

$ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.20.96.1

.bashrc에 추가, 설정 적용

$ echo "export DISPLAY=172.20.96.1:0" >> ~/.bashrc
$ source ~/.bashrc

gedit 패키지 설치 후 확인

$ sudo apt-get update
$ sudo apt-get install gedit
$ gedit

XLauncher(Xming)을 통해 윈도우 상에서 뜬 리눅스 GUI

GUI 프로그램 설치

Nautilus : 리눅스 기본 파일 관리자

File Roller : 압축 관리 프로그램

$ sudo apt -y install nautilus file-roller

Atom : text 편집기

$ wget -qO - https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
$ sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'
$ sudo apt-get update
$ sudo apt-get install atom

 

설치된 패키지 확인

$ dpkg --get-selections