CentOS7

デスクトップ環境 : Xfce インストール

サーバーにデスクトップ環境は通常は必要ない場合が多いのですが、ときに必要なアプリケーションがGUI必須のものがあります。 その場合は以下のようにして環境を導入します。

ここでは Xfceデスクトップ環境をインストールします。

[root@localhost ~]# yum -y groups install "Server with GUI"
# EPEL からインストール
[root@localhost ~]# yum --enablerepo=epel -y groups install "Xfce"

インストールが完了したら、リモート接続ではなく直接コンソール経由でログインし、以下のコマンドを実行します。するとデスクトップ環境が起動します。

[root@localhost ~]# echo "exec /usr/bin/xfce4-session" >> ~/.xinitrc
[root@localhost ~]# startx

Xfceデスクトップが起動しました。

日本語環境にする

日本語関連のパッケージをインストールします。

[root@localhost ~]# yum -y install ibus-kkc vlgothic-*

システムの文字セットを変更します。

[root@localhost ~]# localectl set-locale LANG=ja_JP.UTF-8
[root@localhost ~]# source /etc/locale.conf
[root@localhost ~]# echo $LANG
ja_JP.UTF-8 # 変更された
[root@localhost ~]# passwd # 試しに何かしてみる
ユーザー root のパスワードを変更。 # 日本語になっている
新しいパスワード:

システム全体の文字セットは変更せず、ユーザー固有で日本語環境にするなら、以下のように個別設定をしてください。

[hoge@localhost ~]$ vi ~/.bash_profile
# 最終行に追記
LANG=ja_JP.UTF-8
export LANG
[hoge@localhost ~]$ source ~/.bash_profile
[hoge@localhost ~]$ echo $LANG
ja_JP.UTF-8 # 変更された

グラフィカルログインに変更するには以下のようにします。

[root@localhost ~]# systemctl set-default graphical.target
rm '/etc/systemd/system/default.target'
ln -s '/usr/lib/systemd/system/graphical.target' '/etc/systemd/system/default.target'
# 確認
[root@localhost ~]# systemctl get-default
graphical.target
[root@localhost ~]# ll /etc/systemd/system/default.target
lrwxrwxrwx 1 root root 36 Jul 9 21:55 /etc/systemd/system/default.target -> /lib/systemd/system/graphical.target

以上でシステムを再起動すると、日本語環境になります。ログインしたいユーザーを選択してログインしてください。

パスワードを入力し、「サインイン」ボタンの左横のアイコンをクリックして「Xfce セッション」を選択したのち、「サインイン」ボタンをクリックしてログインします。


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2018-09-06 (木) 15:11:52