WSL 에서 X Window(X11) 사용 방법 
//----------------------------------------------------------------------------- 
< VcXsrv >
    - Open-Source X Server for Windows - 다운로드 설치 
https://vcxsrv.com/
https://github.com/marchaesen/vcxsrv
실행 
* XLaunch 
Multiple windows , Dispaly number : -1 
     -> Start no client 
     -> Clipboard 체크, Primary Selectrion 체크,  
          Native opengl : 체크 해제 
          Didable access control : 체크

- Windows Defender 방화벽에 허용 설정 
제어판\모든 제어판 항목\Windows Defender 방화벽\허용되는 앱 
VcXsrv windows xserver : 개인, 공용 모두 체크 
//------------------------------------- 
* VcXsrv 저장된 설정파일(config.xlaunch)로 실행하는 방법 
"C:\Program Files\VcXsrv\xlaunch.exe" -run config.xlaunch 
참고 
"C:\Program Files\VcXsrv\vcxsrv.exe"  :0 -ac -terminate -lesspointer -multiwindow -clipboard -wgl 
//----------------------------------------------------------------------------- 
< WSL 에서 x window 실행 > 
* X Window(X11) 설치 
$ sudo apt install x11-apps -y 
    - xorg xauth 는 설치할 필요 없음 
* 자신의 로컬 IP 파악 : ipconfig 
$ export DISPLAY=로컬IP:0.0
- 테스트 앱 실행
$ xclock 

//----------------------------------------------------------------------------- 
< AWS EC2 ubuntu 서버에서 x windows 실행 > 
     - AWS EC2 ubuntu 서버에서 VcXsrv 로 접속하기 
//------------------------------------- 
PowerShell > $env:DISPLAY = "localhost:0.0" 
PowerShell > ssh -Y ubuntu@serverIP
     - -Y를 사용해야 함. 기능 : ForwardX11 yes , ForwardX11Trusted yes 
    
     - -X 옵션 사용시 ubuntu에서 에러 발생 
Error: Can't open display: localhost:10 
login ok 
Ubuntu ~$ echo $DISPLAY 
localhost:10 
Ubuntu ~$ xclock 
'Code' 카테고리의 다른 글
| 우분투 서버 부팅이 느린 경우 해결 방법 (0) | 2025.01.20 | 
|---|---|
| ubuntu server, 부팅시 서비스 로딩 순서 조정 (0) | 2025.01.20 | 
| Linux, Wine(Wine Is Not an Emulator) 사용법 (0) | 2024.11.22 | 
| Ubuntu, X Window(X11)을 원격 터미널에서 사용하는 방법 (0) | 2024.11.21 | 
| MSYS2 MSYS, MINGW64, UCRT64 차이점 비교 (0) | 2024.11.14 | 










