7
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS7.6にGUIリモートデスクトップ接続

Posted at

はじめに

CentOSのDesktop環境にリモートデスクトップ接続をインストールしたので、手順をメモします。

環境情報

VirsualBoxの仮想マシンに、GNOMEをインストール済み、まだ仮想ネットワークはNATです。

[user@localhost ~]$ cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[user@localhost ~]$ uname -a
Linux localhost.localdomain 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[user@localhost ~]$uname -a

インストール及び設定手順

インストール

XRDPをインストールします。

sudo -E yum install epel-release -y
sudo -E yum install xrdp tigervnc-server -y

起動と自動起動設定

XRDPを起動します。まだ、次回から自動起動させるため自動起動を設定します。

sudo systemctl start xrdp
sudo systemctl enable xrdp

ファイアウォール設定

ファイアウォールにリモートデスクトップ接続用ポートを許可するように設定します。

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

仮想マシンの設定

今回は仮想マシンのNATネットワークにホストPCから接続するためにポートフォワーディングを設定します。

  1. Oracle VM VirtualBox マネージャーから該当する仮想マシンを選択し、「設定」⇨「ネットワーク」⇨「アダプター1」⇨「高度」⇨「ポートフォワーディング」の順にポートフォワーディングルール画面を開きます。

  2. 「+」ボタンを押して、追加されたルール行に下記値を入力します。

    |項目|値|
    |:-:|:-:|
    |ホストIP|127.0.0.1|
    |ホストポート|13389|
    |ゲストポート|3389|

  3. 「OK」を押してルールを確定します。

接続確認

Windowsから接続できることを確認します。

  1. Windowsからmstscコマンドでリモートデスクトップクライアントを起動します。
  2. 「コンピュータ」に「127.0.0.1:13389」を入力し「接続」をクリックします。
  3. CentOSのRDPログイン画面にユーザーIDとパスワードを入力して接続します。

参考資料

7
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?