본문 바로가기
Technical/System

윈도우 원격 데스크톱으로 리눅스에 접속하기

by 박성규 2022. 2. 15.

윈도우의 원격 데스크톱은 윈도우에만 접속 가능하다고 생각 하겠지만 리눅스에서 

조금만 셋팅을 해주면 윈도우에서 원격데스크톱을 이용해 리눅스에 GUI환경으로 접속이 가능합니다.

 

*단, 리눅스 설치시 GUI 환경이 설치 되어 있어야 함

 

시스템 환경은 다음과 같습니다.

Windows10 - 노트북

CentOS 7.4 - vmware

 

먼저 리눅스에 epel-release, xrdp, tigervnc-server 패키지를 설치 합니다.

xrdp패키지는 epel-release 패키지 설치 이후 설치가 되니 epel-release를 먼저 설치 합니다.

 

# yum install -y epel-release

# yum install -y epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.navercorp.com
 * extras: mirror.navercorp.com
 * updates: mirror.navercorp.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                          Arch                       Version                    Repository                  Size
================================================================================
Installing:
 epel-release                     noarch                     7-11                       extras                      15 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Downloading packages:
epel-release-7-11.noarch.rpm                                                                      |  15 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : epel-release-7-11.noarch                                                                              1/1 
  Verifying  : epel-release-7-11.noarch                                                                              1/1 

Installed:
  epel-release.noarch 0:7-11                                                                                             

Complete!

다음 나머지 패키지도 설치 합니다.

 

# yum install -y xrdp

# yum install -y xrdp
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.navercorp.com
 * epel: ftp.iij.ad.jp
 * extras: mirror.navercorp.com
 * updates: mirror.navercorp.com
Resolving Dependencies
--> Running transaction check
---> Package xrdp.x86_64 1:0.9.18-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                  Arch                       Version                              Repository                Size
================================================================================
Installing:
 xrdp                     x86_64                     1:0.9.18-3.el7                       epel                     453 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 453 k
Installed size: 2.2 M
Downloading packages:
xrdp-0.9.18-3.el7.x86_64.rpm                                                                      | 453 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:xrdp-0.9.18-3.el7.x86_64                                                                            1/1 
  Verifying  : 1:xrdp-0.9.18-3.el7.x86_64                                                                            1/1 

Installed:
  xrdp.x86_64 1:0.9.18-3.el7                                                                                             

Complete!

 

# yum install -y tigervnc-server

# yum install -y tigervnc-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.navercorp.com
 * epel: ftp.iij.ad.jp
 * extras: mirror.navercorp.com
 * updates: mirror.navercorp.com
Resolving Dependencies
--> Running transaction check
---> Package tigervnc-server.x86_64 0:1.8.0-22.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                          Arch                    Version                         Repository                Size
================================================================================
Installing:
 tigervnc-server                  x86_64                  1.8.0-22.el7                    updates                  211 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 211 k
Installed size: 498 k
Downloading packages:
tigervnc-server-1.8.0-22.el7.x86_64.rpm                                                           | 211 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : tigervnc-server-1.8.0-22.el7.x86_64                                                                   1/1 
  Verifying  : tigervnc-server-1.8.0-22.el7.x86_64                                                                   1/1 

Installed:
  tigervnc-server.x86_64 0:1.8.0-22.el7                                                                                  

Complete!

 

리눅스 방화벽에 원격데스크톱 포트(3389)를 open 해주거나 방화벽 서비스를 중지 시킵니다.

 

방화벽에 포트 open 하기

firewall-cmd --permanent --zone=public --add-port=3389/tcp

success

 

방화벽 갱신

firewall-cmd --reload

success

 

포트 확인 하기

firewall-cmd --list-ports
3389/tcp

 

방화벽에 포트 open은 끝났고 이제 xrdp 서비스를 시작해주면 됩니다.

systemctl start xrdp

 

만약 리눅스 시스템을 재기동 후에도 자동으로 xrdp 서비스를 실행하고 싶다면 enable 해줍니다.

# systemctl enable xrdp
Created symlink from /etc/systemd/system/multi-ser.target.wants/xrdp.service to /usr/lib/systemd/system/xrdp.service.

 

이제 윈도우에서 원격 데스크톱을 이용하여 리눅스에 접속하면 됩니다.

로그인 화면

 

접속화면

로그인 후 바탕화면 나오는데 시간이 조금 걸릴수 있습니다.

윈도우와 다르게 리눅스에선 원격데스크톱으로 접속해도 콘솔 화면이 로그 아웃되지 않습니다.

 

댓글