Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
12
Help us understand the problem. What is going on with this article?
@ie4

EC2 の CentOS で リモートデスクトップ (コピペでGO!)

More than 5 years have passed since last update.
  • 取り急ぎのチラ裏・メモに近いです。
  • この辺の技術、実はよく分かってないので、
    ツッコミ歓迎ですm(_ _)m
    (rootはさすがに…とか、あると思うので、その辺は適宜…)
  • EC2である必要はないかも。一般的なVPSでもいけるかも。

使うもの

  • EC2 (region: Tokyo)
  • 5901が空いてるSecurityGroup
  • CentOS 6.5 (AMI: ami-81294380)
  • tigerVNC (サーバー/クラント)

コマンド一覧 (サーバー側の用意)

※rootで入るので、sudo -i は要らないかも。

sudo -i
yum install -y tigervnc-server
yum groupinstall -y "X Window System"
yum groupinstall -y "汎用デスクトップ(GNOMEデスクトップ)"
yum install -y gnome-panel

vncpasswd

cat << EOF >> /etc/sysconfig/vncservers
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768 -nolisten tcp"
EOF

/etc/rc.d/init.d/vncserver start

sed -i "s/^twm &/#twm &/g" ~/.vnc/xstartup
cat << EOF >> ~/.vnc/xstartup
LANG=ja_JP.UTF8
export LANG
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim
export XMODIFIERS="@im=SCIM"
exec gnome-session &
EOF

sed -i "s/^\(.\+dport 22 -j ACCEPT\)/\1\n-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT/g" /etc/sysconfig/iptables

service iptables restart

/etc/rc.d/init.d/vncserver restart

クライアントから接続

参考URL

12
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ie4
IoTっぽい記事多めです。
iotlt
IoT縛りの勉強会です。 毎月イベントを実施しているので是非遊びに来てください! 登壇者を中心にQiitaでも情報発信していきます。 https://iotlt.connpass.com

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
12
Help us understand the problem. What is going on with this article?