cwm - FreeBSD 15.0 RELEASE - 環境構築


 クラウディア


1. 概要
2. インストール
3. SDDM カスタマイズ
4. 初期化ファイル作成
5. ログインマネージャ起動

1. 概要

 下記のデスクトップ環境を構築する手順を記述します。
種 別 リソース・設定 備考
ホスト Windows11 25H2
仮想環境 VirtualBox 7.2.4
ゲスト FreeBSD 15.0 RELEASE
ログインマネージャ SDDM
仮想OS BSD
仮想OSディストリビューション FreeBSD
仮想OSバージョン FreeBSD (64bit)
ハードディスク 160 GB
メモリ 4 GB
CPU 2コア
グラフィックスコントローラ VBoxSVGA 128MB 3D Disable

 ここまでの時点で、システムインストールと「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 cwm
 最後の行の「cwm」のインストールは、一瞬で終わります。  バージョンの推移です。 ・2022年 4月11日 「FreeBSD 13.0 RELEASE」 「cwm-6.7」 ・2022年 5月31日 「FreeBSD 13.1 RELEASE」 「cwm-6.7」 ・2022年12月26日 「FreeBSD 12.4 RELEASE」 「cwm-7.1」 ・2023年 4月24日 「FreeBSD 13.2 RELEASE」 「cwm-7.1」 ・2023年12月20日 「FreeBSD 14.0 RELEASE」 「cwm-7.1」 ・2024年 3月 8日 「FreeBSD 13.3 RELEASE」 「cwm-7.4」 ・2024年 6月 6日 「FreeBSD 14.1 RELEASE」 「cwm-7.4_1」 ・2024年 9月30日 「FreeBSD 13.4 RELEASE」 「cwm-7.4_1」 ・2024年12月 9日 「FreeBSD 14.2 RELEASE」 「cwm-7.4_1」 ・2025年 3月17日 「FreeBSD 13.5 RELEASE」 「cwm-7.4_1」 ・2025年 6月12日 「FreeBSD 14.3 RELEASE」 「cwm-7.4_1」  2025年12月5日の時点で下記のバージョンでした。

$ pkg info cwm
cwm-7.4_1
Name           : cwm
Version        : 7.4_1
Installed on   : Fri Dec  5 14:02:43 2025 JST
Origin         : x11-wm/cwm
Architecture   : FreeBSD:15:amd64
Prefix         : /usr/local
Categories     : x11-wm
Licenses       : ISCL
Maintainer     : eduardo@FreeBSD.org
WWW            : https://github.com/leahneukirchen/cwm
Comment        : Minimalistic window manager for X11 based on evilwm
Shared Libs required:
        libX11.so.6
        libXft.so.2
        libXrandr.so.2
        libc.so.7
Annotations    :
        FreeBSD_version: 1500068
        build_timestamp: 2025-12-01T14:24:30+0000
        built_by       : poudriere-git-3.4.4-7-gd0e6e138
        port_checkout_unclean: no
        port_git_hash  : e3fa556c9a509b3bc0e615815d8368b663c95dc3
        ports_top_checkout_unclean: no
        ports_top_git_hash: b0cd6f432e855ffcd4bae4764463dc264a59340b
        repo_type      : binary
        repository     : FreeBSD-ports
Flat size      : 98.8KiB
Description    :
cwm is a window manager for X11 initially inspired by evilwm. cwm has several
novel features, including the ability to search for windows. it features a
very simple and attractive aesthetic.

3. SDDM カスタマイズ

 ログイン画面の解像度を「1366x768」とし、キーボードレイアウトを「jp.106」にします。  「root」ユーザで

cat << EOF >>  /usr/local/share/sddm/scripts/Xsetup

xrandr --output VGA-0 --mode 1366x768 --rate 60
setxkbmap -layout jp
EOF
 ログイン画面のテーマとカーソルを変更します。  「root」ユーザのまま

sddm --example-config > /usr/local/etc/sddm.conf
vi /usr/local/etc/sddm.conf

[Theme]
# Current theme name
Current=breeze

# Cursor size used in the greeter
CursorSize=

# Cursor theme used in the greeter
CursorTheme=breeze_cursors
 を下記へ変更します。

[Theme]
# Current theme name
Current=sddm-freebsd-black-theme

# Cursor size used in the greeter
CursorSize=

# 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.xsession
#!/bin/sh

exec cwm
EOF

cat << 'EOF' >> /usr/share/skel/dot.xprofile
#!/bin/sh
#
setxkbmap -layout jp
numlock on
xsetroot -cursor_name left_ptr

/usr/local/bin/VBoxClient-all
EOF
exit

chmod +x /usr/share/skel/dot.xsession
 既存のログインユーザで

cp /usr/share/skel/dot.xsession ~/.xsession
cp /usr/share/skel/dot.xprofile ~/.xprofile

5. ログインマネージャ起動

 前項までインストール・設定したものを有効にします。  「root」ユーザ権限で。

sysrc dbus_enable=YES
sysrc sddm_enable=YES
 起動。

service dbus start
service sddm start
 うまく設定できていれば、ログイン画面が表示されます。  ユーザ名・パスワードを入力してログインします。

 「FreeBSD 13.5 RELEASE」の途中から「sddm」の起動時に、下記のメッセージが出て、「sddm-freebsd-black-theme」が効かなくなっています。


[13:21:10.748] (WW) DAEMON: The theme at "/usr/local/share/sddm/themes/sddm-freebsd-black-theme" requires missing "/usr/local/bin/sddm-greeter" . Using fallback theme.

EaseUS
AbemaTV 無料体験
earthcar(アースカー)