LoginSignup
1
2

More than 5 years have passed since last update.

EC2にデスクトップ環境を構築する手順

Last updated at Posted at 2018-08-25

はじめに

RDPでリモートのデスクトップ環境が複数ほしいなーと思ったので、AWSの無料枠に収まる範囲の軽量な?デスクトップ環境の構築方法をメモします。

EC2

今回使うEC2インスタンスは下記の通りです。

AMI

image.png

インスタンスタイプ

t2.micro

EBS

10GB (汎用SSD)

セキュリティグループ

Protocol TCP/UDP Port
SSH TCP 22
RDP TCP 3389

容量確認

ubuntu@ip:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            488M     0  488M   0% /dev
tmpfs           100M  3.3M   96M   4% /run
/dev/xvda1      9.7G  961M  8.7G  10% /
tmpfs           496M     0  496M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           496M     0  496M   0% /sys/fs/cgroup
/dev/loop0       87M   87M     0 100% /snap/core/5145
/dev/loop1       13M   13M     0 100% /snap/amazon-ssm-agent/295
tmpfs           100M     0  100M   0% /run/user/1000

環境構築

デスクトップ環境の構築手順に入ります。

リポジトリ最新化

パッケージをインストールするために、リポジトリを最新化します。

ubuntu@ip :~$ sudo apt update
Hit:1 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
# 省略
Get:37 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3,456 B]
Get:38 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1,744 B]
Fetched 25.5 MB in 4s (5,288 kB/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
5 packages can be upgraded. Run 'apt list --upgradable' to see them.

LXDE

デスクトップ環境は、LXDEを選びました。

sudo apt install -y lxde

XRDP

リモートのデスクトップ環境へ接続するために、xrdpをインストールしておきます。

sudo apt install -y xrdp

ユーザ設定

RDPでログインするために、ユーザにパスワードを設定しておきます。

$ sudo passwd ubuntu
Enter new UNIX password:ログイン時のパスワードを設定 
Retype new UNIX password: 同じものをもう一度
passwd: password updated successfully

確認

RDPでEC2へログインしてみました。
LXDEをインストールすると、デフォルトでfirefoxが入っているみたいですね。
image.png

容量は7GB近く空いていました。

ubuntu@:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            488M     0  488M   0% /dev
tmpfs           100M  3.4M   96M   4% /run
/dev/xvda1      9.7G  2.6G  7.1G  27% /
tmpfs           496M   19M  478M   4% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           496M     0  496M   0% /sys/fs/cgroup
/dev/loop0       87M   87M     0 100% /snap/core/5145
/dev/loop1       13M   13M     0 100% /snap/amazon-ssm-agent/295
tmpfs           100M  8.0K  100M   1% /run/user/1000

おわりに

日本語化パッケージなどは今回設定していません。
とりあえずGUIでブラウジングするための環境構築手順に留まっています。

以上!

1
2
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
1
2