ここまでの時点で、システムインストールと「VirtualBox Guest Additions」の設定は終わっているものとします。
ぞれぞれのインストール・設定に関しては、
「FreeBSD - デスクトップ環境構築 - 共通事項 - システムインストール」
「FreeBSD - デスクトップ環境構築 - 共通事項 - VirtualBox Guest Additions」
をご参照ください。
2. インストール
「root」ユーザ権限で。
pkg install -y xorg ja-font-migmix numlockx
pkg install -y sddm sddm-freebsd-black-theme cursor-neutral-white-theme
pkg install -y fvwm3
最後の行の「fvwm」のインストールは、すぐに終わります。
2022年4月11日時点で、「FreeBSD 13.0 RELEASE」へインストールしたとき、2022年6月2日、「FreeBSD 13.1 RELEASE」へインストールしたときは「fvwm3-1.0.4_1」でした。
2023年1月 5日の時点で、「FreeBSD 13.1 RELEASE」へインストールしたときは、「fvwm3-1.0.5_1」でした。
2023年5月11日の時点で、「fvwm」のバージョンは、下記の通りでした。
$ fvwm3 --version
fvwm3 1.0.6a (released)
with support for: ReadLine, PNG, Shape, XShm, SM, Bidi text, XRandR, XRender, XCursor, XFT, NLS
fvwm3 comes with NO WARRANTY, to the extent permitted by law. You may
redistribute copies of fvwm under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
3. SDDM カスタマイズ
ログイン画面の解像度を「1366x768」とし、キーボードレイアウトを「jp.106」にします。
「root」ユーザで
sh
cat << 'EOF' >> /usr/local/share/sddm/scripts/Xsetup
xrandr --output VGA-0 --mode 1366x768 --rate 60
setxkbmap -layout jp
EOF
exit
ログイン画面のテーマとカーソルを変更します。
「root」ユーザのまま
sddm --example-config > /usr/local/etc/sddm.conf
vi /usr/local/etc/sddm.conf
[Theme]
# Current theme name
Current=breeze
# Cursor theme used in the greeter
CursorTheme=breeze_cursors
を下記へ変更します。
[Theme]
# Current theme name
Current=sddm-freebsd-black-theme
# Cursor theme used in the greeter
CursorTheme=Neutral++_White
4. ユーザ用初期化ファイルの作成
「root」ユーザ権限で。
sh
cat << 'EOF' >> /etc/profile
export LC_ALL="ja_JP.UTF-8"
export LANGUAGE="ja_JP.UTF-8"
export LANG="ja_JP.UTF-8"
EOF
cat << 'EOF' >> /etc/csh.cshrc
setenv LC_ALL "ja_JP.UTF-8"
setenv LANGUAGE "ja_JP.UTF-8"
setenv LANG "ja_JP.UTF-8"
EOF
cat << 'EOF' >> /usr/share/skel/dot.xinitrc
#!/bin/sh
#
/usr/local/bin/VBoxClient-all
#
setxkbmap -layout jp
numlockx on
export DESKTOP=fvwm
exec fvwm3
EOF
chmod +x /usr/share/skel/dot.xinitrc
exit
既存のログインユーザで
cp /usr/share/skel/dot.xinitrc ~/.xinitrc
5. /etc/rc.conf 編集
前項までインストール・設定したものを有効にします。
sysrc dbus_enable=YES
sysrc sddm_enable=YES
6. ログインマネージャ起動
「root」ユーザで
service dbus start
service sddm start
うまく設定できていれば、ログイン画面が表示されます。
ユーザ名・パスワードを入力してログインします。