본문 바로가기
DataScience/참고자료

참고 : Ubuntu WSL 환경에서 리눅스 GUI 활용하기

by 올커 2023. 7. 11.

Ubuntu WSL 환경에서 YOLOv5나 OpenCV를 사용할 때 시각화가 필요한 경우가 많다.

하지만 WSL환경에서는 아래와 같은 오류를 만나게 된다

 "Available platform plugins are: xcb."

이를 해결하기 위해서는 아래 Xming X Server for Windows 파일을 다운로드 받아서 설치해준 후 별도의 설정이 필요했다.

 

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

 

설치부터 추가 설정해주어야 하는 부분들은 아래 링크의 영상에서 잘 설명해주고 있다.

https://www.rickmakes.com/windows-subsystem-for-linux-2-installing-vcxrv-x-server/

 

Windows Subsystem for Linux 2: Installing VcXsrv X Server - RickMakes

Find Windows IP Address Set DISPLAY Variable Export opengl Variable Update Package List Install x11-apps

www.rickmakes.com


해결 순서를 요약하면 아래와 같다.

1) Xming X Server for Windows를 먼저 다운로드 받아서 설치한다.(*링크)

2) Ubuntu에서 아래 명령어를 순서대로 실행한다.

 - IP 주소 확인

cat /etc/resolv.conf

 - DISPLAY 변수 지정 (* <ip_address>는 위에서 확인한 IP 주소를 넣는다)

export DISPLAY=<ip_address>:0.0

 - opengl 변수를 추출

export LIBGL_ALWAYS_INDIRECT=1

 - Package List를 업데이트

sudo apt update

 - x11-apps를 설치

sudo apt install x11-apps

3) 설치가 잘 되었는지 아래 명령어들을 실행해보며 확인한다.

xcalc		// 계산기 실행
xlogo		// 로고 확인
xclock		// 시계 앱 실행
반응형

댓글