joe99 寫到:
請問各位前輩, 我的是ubuntu 1604 mate 版本, 裝在樹莓派3上面的,要如何設定開機就在桌面的環境,不用再去看登入的動作,我已經在使用者設定哪一邊把登入密碼的選項關掉了,但是還是會跳出一個畫面要用滑鼠去按登入的動作,可以設定成一開機就到桌面的環境嗎? 我查詢Google的說法是說在安全性那裡選擇 ,可是樹莓派的選項裡並沒有安全性, 謝謝
提供一個您可以探索的方向
您可以先確認您的系統所使用的「
XDM(X Display Manager)」是何者?
以我的系統「Xubuntu 16.04 amd64 英文界面」為例
執行下面指令,觀看「
/etc/X11/default-display-manager」這個檔案的內容
$ cat /etc/X11/default-display-manager
顯示
/usr/sbin/lightdm
目前在「泛Ubuntu」使用的是「
lightdm」,(有些不是)。
關於這方面的設定,可以參考之前「
一篇討論」提供的相關連結,
或是參考「Debian Wiki / LightDM /
Enable autologin」。
執行
$ dpkg -L lightdm | sort | less
顯示
/.
/etc
/etc/apparmor.d
/etc/apparmor.d/abstractions
/etc/apparmor.d/abstractions/lightdm
/etc/apparmor.d/abstractions/lightdm_chromium-browser
/etc/apparmor.d/lightdm-guest-session
/etc/dbus-1
/etc/dbus-1/system.d
/etc/dbus-1/system.d/org.freedesktop.DisplayManager.conf
/etc/guest-session
/etc/init
/etc/init.d
/etc/init.d/lightdm
/etc/init/lightdm.conf
/etc/lightdm
/etc/lightdm/lightdm.conf.d
/etc/lightdm/users.conf
/etc/logrotate.d
/etc/logrotate.d/lightdm
/etc/pam.d
/etc/pam.d/lightdm
/etc/pam.d/lightdm-autologin
/etc/pam.d/lightdm-greeter
/etc/X11
/lib
/lib/systemd
/lib/systemd/system
/lib/systemd/system/lightdm.service
/usr
/usr/bin
/usr/bin/dm-tool
/usr/lib
/usr/lib/lightdm
/usr/lib/lightdm/config-error-dialog.sh
/usr/lib/lightdm/guest-session-auto.sh
/usr/lib/lightdm/lightdm-greeter-session
/usr/lib/lightdm/lightdm-guest-session
/usr/sbin
/usr/sbin/guest-account
/usr/sbin/lightdm
/usr/sbin/lightdm-session
/usr/share
/usr/share/apport
/usr/share/apport/package-hooks
/usr/share/apport/package-hooks/source_lightdm.py
/usr/share/bash-completion
/usr/share/bash-completion/completions
/usr/share/bash-completion/completions/dm-tool
/usr/share/bash-completion/completions/lightdm
/usr/share/doc
/usr/share/doc/lightdm
/usr/share/doc/lightdm/changelog.Debian.gz
/usr/share/doc/lightdm/copyright
/usr/share/doc/lightdm/keys.conf
/usr/share/doc/lightdm/lightdm.conf.gz
/usr/share/lightdm
/usr/share/lightdm/guest-session
/usr/share/lightdm/guest-session/setup.sh
/usr/share/lightdm/guest-session/skel
/usr/share/lightdm/guest-session/skel/.config
/usr/share/lightdm/guest-session/skel/.config/autostart
/usr/share/lightdm/guest-session/skel/.config/autostart/guest-session-startup.desktop
/usr/share/lightdm/lightdm.conf.d
/usr/share/lightdm/lightdm.conf.d/50-disable-log-backup.conf
/usr/share/lightdm/lightdm.conf.d/50-greeter-wrapper.conf
/usr/share/lightdm/lightdm.conf.d/50-guest-wrapper.conf
/usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/dm-tool.1.gz
/usr/share/man/man1/lightdm.1.gz
/var
/var/cache
/var/cache/lightdm
/var/lib
/var/lib/lightdm-data
/var/log
/var/log/lightdm
執行下面指令,觀看「
/usr/share/doc/lightdm/lightdm.conf.gz」這個檔案。
$ less /usr/share/doc/lightdm/lightdm.conf.gz
可以看到一些設定參數和註解說明。
...略...
#
# Seat configuration
#
# Seat configuration is matched against the seat name glob in the section, for example:
# [Seat:*] matches all seats and is applied first.
# [Seat:seat0] matches the seat named "seat0".
# [Seat:seat-thin-client*] matches all seats that have names that start with "seat-thin-client".
...略...
# autologin-guest = True to log in as guest by default
# autologin-user = User to log in with by default (overrides autologin-guest)
# autologin-user-timeout = Number of seconds to wait before loading default user
# autologin-session = Session to load for automatic login (overrides user-session)
# autologin-in-background = True if autologin session should not be immediately activated
...略...
===========================================================
另外在安裝系統的時候,有一個步驟,有一個選項,可以選擇自動登入,
就會產生相關的設定檔案,
如何探索這一段可以參考之前的一篇「
討論回覆」。
以下提供我的「
/etc/lightdm/lightdm.conf」和「
/etc/lightdm/users.conf」的內容,供您參考。
執行下面指令,觀看「
/etc/lightdm/lightdm.conf」的內容。
$ cat /etc/lightdm/lightdm.conf
顯示
[Seat:*]
autologin-guest=false
autologin-user=username
autologin-user-timeout=0
執行下面指令,觀看「
/etc/lightdm/users.conf」的內容。
$ cat /etc/lightdm/users.conf
顯示
#
# User accounts configuration
#
# NOTE: If you have AccountsService installed on your system, then LightDM will
# use this instead and these settings will be ignored
#
# minimum-uid = Minimum UID required to be shown in greeter
# hidden-users = Users that are not shown to the user
# hidden-shells = Shells that indicate a user cannot login
#
[UserList]
minimum-uid=500
hidden-users=nobody nobody4 noaccess
hidden-shells=/bin/false /usr/sbin/nologin
===========================================================
執行
$ lightdm --help
顯示
Usage:
lightdm [OPTION...] - Display Manager
Help Options:
-h, --help Show help options
Application Options:
-c, --config=FILE Use configuration file
-d, --debug Print debugging messages
--test-mode Run as unprivileged user, skipping things that require root access
--pid-file=FILE File to write PID into
--log-dir=DIRECTORY Directory to write logs to
--run-dir=DIRECTORY Directory to store running state
--cache-dir=DIRECTORY Directory to cache information
--show-config Show combined configuration
-v, --version Show release version
執行
$ lightdm --show-config
顯示
[LightDM]
G backup-logs=false
[Seat:*]
H greeter-wrapper=/usr/lib/lightdm/lightdm-greeter-session
I guest-wrapper=/usr/lib/lightdm/lightdm-guest-session
J xserver-command=X -core
K greeter-session=lightdm-gtk-greeter
L user-session=xubuntu
M autologin-guest=false
M autologin-user=username
M autologin-user-timeout=0
Sources:
G /usr/share/lightdm/lightdm.conf.d/50-disable-log-backup.conf
H /usr/share/lightdm/lightdm.conf.d/50-greeter-wrapper.conf
I /usr/share/lightdm/lightdm.conf.d/50-guest-wrapper.conf
J /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf
K /usr/share/lightdm/lightdm.conf.d/60-lightdm-gtk-greeter.conf
L /usr/share/lightdm/lightdm.conf.d/60-xubuntu.conf
G /usr/share/lightdm/lightdm.conf.d/50-disable-log-backup.conf
H /usr/share/lightdm/lightdm.conf.d/50-greeter-wrapper.conf
I /usr/share/lightdm/lightdm.conf.d/50-guest-wrapper.conf
J /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf
K /usr/share/lightdm/lightdm.conf.d/60-lightdm-gtk-greeter.conf
L /usr/share/lightdm/lightdm.conf.d/60-xubuntu.conf
M /etc/lightdm/lightdm.conf
===========================================================
## manpage
$ man
lightdm## Debian Wiki
*
DisplayManager*
LightDM## Ubuntu Wiki
*
LightDM===========================================================
參考之前另一篇討論「
回覆」提到的探索步驟。
執行下面指令,下載「ubiquity」的「
Source Package」。
$ apt-get source ubiquity
下載完成,會解開到一個資料「ubiquity-2.21.63.3」。
然後執行下面指令,用「lightdm」當關鍵字找尋相關的檔案。
$ grep lightdm ubiquity-2.21.63.3/* -R -n
顯示
ubiquity-2.21.63.3/bin/ubiquity:71: '/etc/lightdm/lightdm.conf'):
ubiquity-2.21.63.3/debian/ubiquity.ubiquity.upstart:14: or starting lightdm)
ubiquity-2.21.63.3/debian/ubiquity.ubiquity.upstart:20: or stopping lightdm)
ubiquity-2.21.63.3/debian/oem-config.oem-config.upstart:13: or starting lightdm
ubiquity-2.21.63.3/debian/oem-config.oem-config.upstart:20: or stopping lightdm)
ubiquity-2.21.63.3/debian/changelog:516: installation. lightdm and friends do a proper shutdown already, it's just
ubiquity-2.21.63.3/debian/changelog:533: start lightdm in the cases where we don't want ubiquity-dm.
ubiquity-2.21.63.3/debian/changelog:4268: lxdm and lightdm handling (LP: #806247).
ubiquity-2.21.63.3/debian/changelog:4308: * Add lightdm to lists of display managers in Upstart jobs (LP: #798328).
grep: ubiquity-2.21.63.3/d-i/source/console-setup/xorg.lst: No such file or directory
ubiquity-2.21.63.3/d-i/source/user-setup/debian/changelog:31: gdm, kdm, lxdm, sddm, and lightdm for automatic login. Add
ubiquity-2.21.63.3/d-i/source/user-setup/debian/changelog:179: * user-setup-apply: use correct syntax escaping, fix the lightdm
ubiquity-2.21.63.3/d-i/source/user-setup/debian/changelog:236: gdm, kdm, lxdm, and lightdm for automatic login. Add
ubiquity-2.21.63.3/d-i/source/user-setup/debian/changelog:281: gdm, kdm, lxdm, and lightdm for automatic login. Add
ubiquity-2.21.63.3/d-i/source/user-setup/debian/changelog:334: gdm, kdm, lxdm, and lightdm for automatic login. Add
ubiquity-2.21.63.3/d-i/source/user-setup/debian/changelog:450: gdm, kdm, lxdm, and lightdm for automatic login. Add
ubiquity-2.21.63.3/d-i/source/user-setup/debian/changelog:495: gdm, kdm, lxdm, and lightdm for automatic login. Add
ubiquity-2.21.63.3/d-i/source/user-setup/debian/changelog:609: gdm, kdm, lxdm, and lightdm for automatic login. Add
ubiquity-2.21.63.3/d-i/source/user-setup/debian/changelog:830: as the rest of the lightdm config is put in place already from install.
ubiquity-2.21.63.3/d-i/source/user-setup/debian/changelog:838: * Write out a lightdm configuration if one does not exist when
ubiquity-2.21.63.3/d-i/source/user-setup/debian/changelog:852: * Handle new lightdm configuration keys.
ubiquity-2.21.63.3/d-i/source/user-setup/user-setup-apply:327: if $chroot $ROOT [ -d /etc/lightdm ]; then
ubiquity-2.21.63.3/d-i/source/user-setup/user-setup-apply:329: LightDMCustomFile=$ROOT/etc/lightdm/lightdm.conf
ubiquity-2.21.63.3/d-i/source/user-setup/user-setup-apply:340: sed -i "s/^\(\(str *\)\?autologin-user\)=.*$/\1=$USER/g;" $ROOT/etc/lightdm/lightdm.conf
ubiquity-2.21.63.3/src/wallpaper/wallpaper.c:2: * Almost entirely stolen from lightdm.
接下來執行
$ grep 'LightDMCustomFile=$ROOT/etc/lightdm/lightdm.conf' ubiquity-2.21.63.3/d-i/source/user-setup/user-setup-apply -R -n -A 13 -B 2
顯示
327- if $chroot $ROOT [ -d /etc/lightdm ]; then
328- # Configure LightDM autologin
329: LightDMCustomFile=$ROOT/etc/lightdm/lightdm.conf
330- AutologinParameters="autologin-guest=false\n\
331-autologin-user=$USER\n\
332-autologin-user-timeout=0"
333- if ! grep -qs '^autologin-user' $LightDMCustomFile; then
334- if ! grep -qs '^\[Seat:\*\]' $LightDMCustomFile; then
335- echo '[Seat:*]' >> $LightDMCustomFile
336- fi
337- sed -i "s/\[Seat:\*\]/\[Seat:\*\]\n$AutologinParameters/" $LightDMCustomFile
338- #oem config scenario
339- else
340- sed -i "s/^\(\(str *\)\?autologin-user\)=.*$/\1=$USER/g;" $ROOT/etc/lightdm/lightdm.conf
341- fi
342- fi
===========================================================
或是也可以執行下面指令,下載「
ubiquity」這個「Package」。
$ apt-get download ubiquity
然後執行下面指令,解開「Package」
$ dpkg -x ubiquity_2.21.63.3_amd64.deb ubiquity
會解開到「ubiquity」這個資料夾。
接下來使用「lightdm」當關鍵字,找尋相關的檔案
$ grep lightdm ubiquity/* -R -n
顯示
ubiquity/etc/init/ubiquity.conf:14: or starting lightdm)
ubiquity/etc/init/ubiquity.conf:20: or stopping lightdm)
ubiquity/usr/lib/ubiquity/user-setup/user-setup-apply:327: if $chroot $ROOT [ -d /etc/lightdm ]; then
ubiquity/usr/lib/ubiquity/user-setup/user-setup-apply:329: LightDMCustomFile=$ROOT/etc/lightdm/lightdm.conf
ubiquity/usr/lib/ubiquity/user-setup/user-setup-apply:340: sed -i "s/^\(\(str *\)\?autologin-user\)=.*$/\1=$USER/g;" $ROOT/etc/lightdm/lightdm.conf
ubiquity/usr/lib/ubiquity/bin/ubiquity:71: '/etc/lightdm/lightdm.conf'):
再來執行
$ grep 'LightDMCustomFile=$ROOT/etc/lightdm/lightdm.conf' ubiquity/usr/lib/ubiquity/user-setup/user-setup-apply -R -n -A 13 -B 2
一樣會看到上面「Source Package」找到的內容。
探索套件的一些討論案例,紀錄在「
[索引] 套件操作實務」。
===========================================================
此篇連結也紀錄在「
[索引] 泛Ubuntu 安裝調校」。
===========================================================
以上提供參考
報告完畢
