25
31

More than 5 years have passed since last update.

Windows10からのRDP接続(ubuntu16.04 LTS)

Last updated at Posted at 2017-12-09

はじめに

Windows10からubuntuへのRDP環境くらい、簡単に作れるだろうって思ってました。
思っていましたが、見事にハマりました。

メモらねば。。。

前提条件

ubuntu 16.04 Server にデスクトップ環境をインストールするところから開始。
ubuntu 16.10以降は簡単になっているようですが、

ワタクシはLTSが使いたいのです!

手順

desktop環境をインストール

CLIでubuntu desktop環境をインストールします。
X Window Systemだけだといろいろ足りていない様子で、
途中で積みます。

最初のお約束。

sudo apt-get update
sudo apt-get upgrade

desktop環境をインストール

sudo apt-get -y install ubuntu-desktop

7分程度かかるインストールが完了したのち、再起動

sudo reboot

コンソールにGUIが表示されればOK
desktop.png

XRDPのmake

apt-get使って最新のxrdpをインストールしたいところですが、
16.04の場合は古いバージョン(v0.61)がインストールされます。

ワタクシはLTSが使いたいのです!

日本 xrdp ユーザ会様 (https://xrdp.vmeta.jp/X11RDP-o-Matic)
の手順が有名ですが、うまくいきませんでした。
仕方がないので、手動で最新のxrdpをインストールします。

まずは下準備。
SSHで接続しなおしてから、CLIで張り付けることを推奨。

sudo apt-get install build-essential devscripts git autoconf libtool pkg-config gcc g++ make libssl-dev libpam0g-dev libjpeg-dev libx11-dev libxfixes-dev libxrandr-dev flex bison libxml2-dev intltool xsltproc xutils-dev python-libxml2 g++ xutils libfuse-dev libmp3lame-dev nasm libpixman-1-dev xserver-xorg-dev

最新版のxrdpバージョンを確認。

目的のソースをダウンロード。
2017年12月9日現在、0.9.4が最新でした。
対象ファイル2つをダウンロード。

wget https://launchpad.net/ubuntu/+archive/primary/+files/xrdp_0.9.4.orig.tar.gz
wget https://launchpad.net/ubuntu/+archive/primary/+files/xrdp_0.9.4.orig-xorgxrdp.tar.gz

解凍

tar -zxvf xrdp_0.9.4.orig.tar.gz
tar -zxvf xrdp_0.9.4.orig-xorgxrdp.tar.gz

インストール

cd ~
cd xrdp-0.9.4
./bootstrap
./configure --enable-fuse
make
sudo make install
sudo ln -s /usr/local/sbin/xrdp{,-sesman} /usr/sbin
cd ~
cd xorgxrdp-0.2.4
./bootstrap
./configure
make
sudo make install

ディスクトップ環境設定

描画にどのディスクトップを利用するかの設定。
今回はxfceにチャレンジ。

cd ~
sudo apt-get install xfce4 xfce4-goodies

.xsessionの設定

echo xfce4-session > ~/.xsession

/etc/xrdp/startwm.sh の編集

sudo vi /etc/xrdp/startwm.sh

変更内容

  # suse
  if [ -r /etc/X11/xdm/Xsession ]; then
    # since the following script run a user login shell,
    # do not execute the pseudo login shell scripts
    # . /etc/X11/xdm/Xsession <-コメントアウト
      xfce4-session <-追加
    exit 0
  fi

xrdp 再起動

service xrdp restart

これでRDP出来るはず。

RDP.png

お疲れさまでした!

総括

次のLTSからはxrdpのバージョンが上がるので、
ここまで苦労しなくて良くなるハズです。
未来に期待!

25
31
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
25
31