Created
January 17, 2017 11:16
-
-
Save dalice/86f11631932897f65375c5523dc0a185 to your computer and use it in GitHub Desktop.
さくらのクラウドのCentOS7にリモートデスクトップで接続できるデスクトップ環境を構築するスタートアップスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# @sacloud-once | |
# @sacloud-desc CentOS7にXRDPをインストールします。インストールには10分程度時間がかかります | |
# @sacloud-desc (このスクリプトは、CentOS7.Xでのみ動作します) | |
# @sacloud-require-archive distro-centos distro-ver-7.* | |
# xrdp、VNCをインストール | |
yum -y install epel-release | |
yum -y update | |
yum -y --enablerepo=epel install xrdp | |
yum -y --enablerepo=epel install tigervnc-server | |
# デスクトップ環境をインストール | |
yum -y groups install "GNOME Desktop" | |
systemctl set-default graphical.target | |
# 元のcolor設定ではリモートログイン時にエラーになるため、32bitから24bitに変更 | |
sed -i -e 's/max_bpp=32/max_bpp=24/g' /etc/xrdp/xrdp.ini | |
# 日本語環境のインストールと設定 | |
yum -y install ibus-kkc vlgothic-* | |
localectl set-locale LANG=ja_JP.UTF-8 | |
source /etc/locale.conf | |
# リモートログイン時の日本語設定 | |
if grep -e 'export LANG=ja_JP.UTF-8' /etc/xrdp/startwm.sh; then | |
: | |
else | |
sed -i -e 's/#export LANG=$LANG/#export LANG=$LANG\nexport LANG=ja_JP.UTF-8/g' /etc/xrdp/startwm.sh | |
fi | |
# xrdpで使用するポートを開放 | |
firewall-cmd --permanent --zone=public --add-port=3389/tcp | |
firewall-cmd --reload | |
# xrdpのサービスを起動し、自動起動を有効 | |
systemctl start xrdp.service | |
systemctl enable xrdp.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
こちらを参考に作成いたしました
http://qiita.com/k_nakayama/items/a5b098eda33aa5753732