ここまでの時点で、システムインストールと「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 consolekit2 polkit
pkg install -y bash feh leftwm
「leftwm」では、環境を整えるために「bash」が必要なようです。
「feh」は、デスクトップの背景(壁紙)を書くのに必要です。
さて、これだけだと動かないのです・・・。
ここから先は、「Gemini」伍長に協力していただきました。
まずは、「cargo」が必要なので。
pkg install -y rust
「rust」がインストールできたら。
cargo install leftwm --force --no-default-features --features "lefthk xlib file-log"
上記、「x11」主体にしているのと。
「Linux」中心になっているので「journald」がないと起動できないのを無効にしています。
少し時間がかかります。
この後。
cp ~/.cargo/bin/* /usr/local/bin/.
sh
cat << EOF >> /usr/local/bin/leftwm
#!/bin/sh
/usr/local/bin/lefthk-worker &
exec /usr/local/bin/leftwm-worker
EOF
exit
chmod +x /usr/local/bin/leftwm
「cp」以降は、現在の「leftwm」の本体は、「leftwm-worker」なのに。
「/usr/local/share/xsessions/leftwm.desktop」で起動しようとしているのが、「leftwm」だからなのです。
また、「lefthk-worker」を同時に起動しないと、キーボードがフックできないからです。
備考にバージョン情報を記録しておきます。
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
ログイン画面のテーマとカーソルを変更します。
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
2026年6月10日日の時点で、ここまでの設定では、思い通りにならないので。
「デスクトップ環境構築 - 共通事項 - ログインマネージャ - SDDM」の「FreeBSD 14.4 RELEASE 以降」のページを参照し。
記述してある内容を適用します。
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
#
setxkbmap -layout jp
numlockx on
/usr/local/bin/VBoxClient-all
EOF
exit
chmod +x /usr/share/skel/dot.xsession
既存のログインユーザで。
cp /usr/share/skel/dot.xsession ~/.xsession
5. ログインマネージャ起動
前項までインストール・設定したものを有効にします。
「root」ユーザ権限で。
sysrc polkitd_enable=YES
sysrc dbus_enable=YES
sysrc sddm_enable=YES
起動します。
service dbus start
service sddm start
うまく設定できていれば、ログイン画面が表示されます。
ユーザ名・パスワードを入力してログインします。
6. 備考
バージョンの推移です。
・2022年 4月18日 「FreeBSD 13.0 RELEASE」 「0.2.11.19_3」
・2022年 6月 1日 「FreeBSD 13.0 RELEASE」 「0.2.11.19_3」
・2023年 1月11日 「FreeBSD 12.4 RELEASE」 「0.3.0_4」
・2023年 5月24日 「FreeBSD 13.1 RELEASE」 「0.3.0_10」
・2024年 2月 2日 「FreeBSD 14.0 RELEASE」 「0.5.1」
・2024年 4月 1日 「FreeBSD 13.3 RELEASE」 「0.5.1」
・2024年 6月20日 「FreeBSD 14.1 RELEASE」 「0.5.1」
2026年6月10日の時点で、下記のバージョンでした。
pkg info leftwm
leftwm-0.5.4_10
Name : leftwm
Version : 0.5.4_10
Installed on : Wed Jun 10 09:06:04 2026 JST
Origin : x11-wm/leftwm
Architecture : FreeBSD:15:amd64
Prefix : /usr/local
Categories : x11-wm
Licenses : MIT
Maintainer : bofh@FreeBSD.org
WWW : https://leftwm.org/
Comment : Tiling window manager for Adventurers
Options :
DOCS : on
THEMES : on
Shared Libs required:
libc.so.7
libgcc_s.so.1
libm.so.5
libthr.so.3
Annotations :
FreeBSD_version: 1500068
build_timestamp: 2026-05-23T18:26:19+0000
built_by : poudriere-git-3.4.8
port_checkout_unclean: no
port_git_hash : 78db3aeaafd6e8351d3fa52693f922e0020da12f
ports_top_checkout_unclean: no
ports_top_git_hash: 530483d57eeee02f07bd6ab97a8d045b2d8913fd
repo_type : binary
repository : FreeBSD-ports
Flat size : 22.1MiB
Description :
LeftWM is a tiling window manager written in Rust that aims to be stable
and performant. LeftWM is designed to do one thing and to do that one thing
well: be a window manager. LeftWM therefore follows the following mantra:
- LeftWM is not a compositor.
- LeftWM is not a lock screen.
- LeftWM is not a bar. But, there are lots of good bars out there. With
themes, picking one is as simple as setting a symlink.