« Raspbian LiteのPHP環境構築 | メイン | nethserverを試してみる »
2018年12月16日
Ubuntuのデスクトップを使ってみる
UbuntuServerを入れていたHPのノートPCに『Ubuntu 18.04 LTS』をインストールする。
但し、以下の制約条件を設ける。
1.使うときだけ電源を入れたいので、WakeOnLanで起動する
2.ノートPCのふたを閉めたまま運用する
3.WindowsのリモートデスクトップまたはSSHでアクセスする
【OSのインストール】
「最小インストール」を選択
【インストール後の設定】
1.固定IPアドレスに変更
「設定」→「ネットワーク」→有線の設定ダイアログ→「IPv4」タブで『自動(DHCP)』を『手動』に変更し、IPアドレス等のネットワーク設定を行う。
ついでに「IPv6」は『無効』にする。
2.rootパスワードを設定し、必要なパッケージを導入
$ sudo passwd root [Enter]
でパスワードを設定した後、rootになって
# apt install vim ethtool net-tools openssh-server xrdp [Enter]
3.ふたを閉じてもスリープに入らないように設定
# vi /etc/systemd/logind.conf [Enter]
↓
『HandleLidSwitch=ignore』を追記
4.WakeOnLan対応
# ifconfig [Enter]
でNIC名を確認…うちの環境では「enp67s0」
# vi /etc/rc.local [Enter]
----------------(ここから)----------------
#!/bin/bash
ethtool -s enp67s0 wol g
----------------(ここまで)----------------
# chmod 755 /etc/rc.local [Enter]
# crontab -e [Enter]
----------------(ここから)----------------
@reboot /etc/rc.local
----------------(ここまで)----------------
5.Windowsからリモートデスクトップ接続できるように設定
# vi /etc/xrdp/xrdp.ini
↓
『new_cursors=true』を『new_cursors=false』に変更
# vi /etc/xrdp/sesman.ini [Enter]
↓
『FuseMountName=thinclient_drives』を『FuseMountName=.thinclient_drives』に変更
# vi /etc/polkit-1/localauthority/50-local.d/xrdp-color-manager.pkla [Enter]
----------------(ここから)----------------
[Networkmanager]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device
ResultAny=no
ResultInactive=no
ResultActive=yes
----------------(ここまで)----------------
# vi /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf [Enter]
----------------(ここから)----------------
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.color-manager.create-device" ||
action.id == "org.freedesktop.color-manager.create-profile" ||
action.id == "org.freedesktop.color-manager.delete-device" ||
action.id == "org.freedesktop.color-manager.delete-profile" ||
action.id == "org.freedesktop.color-manager.modify-device" ||
action.id == "org.freedesktop.color-manager.modify-profile") &&
subject.isInGroup("{group}")) {
return polkit.Result.YES;
}
});
----------------(ここまで)----------------
# exit [Enter]
$ cd [Enter]
$ vi .xsessionrc [Enter]
----------------(ここから)----------------
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share:/usr/share:/var/snapd/desktop
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
----------------(ここまで)----------------
※ノートPC側でログインしている場合、Windowsからリモートデスクトップでログインできない点に注意!
なお、接続時のSessionは『Xorg』を選択。
投稿者 masatsu : 2018年12月16日 01:12