[Ubuntu Server 22.04] 在Ubuntu桌面安装上,进行自动登录的设定

注意事项

请在链接中进行记录

[Ubuntu Server 22.04] 个人初期设置备忘录

总而言之

“Contents” -> 目录

1. 安装Tailscale
2. 安装WeTTY
3. 安装Ubuntu桌面(GDM3自定义Ubuntu)并进行自动登录设置
概述
构建
– 安装和配置
安装Ubuntu桌面环境GNOME
配置GUI的自动登录
启动GNOME
– 自动登录到Ubuntu服务器本身
引用来源、参考来源、参考资料
4. 设置Ubuntu桌面RDP
5. 安装PowerTOP TLP
6. 自动重启设置(Crontab, rtcwake)

“说明”

Ubuntu Desktop 是基于GNOME Desktop的Ubuntu定制版本。

建筑

安装和设置

安装Ubuntu使用的GNOME桌面环境。
    1. GNOME 安装

 

    1. sudo apt update && sudo apt upgrade -y

 

    1. sudo apt install ubuntu-desktop -y

在电脑启动时,显示CUI界面(将默认目标切换为CUI)
sudo systemctl set-default multi-user.target

进行一次重新启动
sudo reboot
或者
sudo shutdown -r now

[自动登录设置适用于图形用户界面(GUI)]
’/etc/gdm3/custom.conf 内の[daemon]以下に次を記入
’|[daemon]
’|# Uncomment the line below to force the login screen to use Xorg
’|#WaylandEnable=false
’|
’|# Enabling automatic login
’|AutomaticLoginEnable = True
’|AutomaticLogin = ここにユーザー名

例)
sudo vim /etc/gdm3/custom.conf
# i を押す、下のやつを入力
[daemon]
AutomaticLoginEnable=True
AutomaticLogin=USER_1
# Esc を押す
# :x を Enter
cat /etc/gdm3/custom.conf
启动 GNOME
sudo systemctl start gdm3
sudo systemctl status gdm3

Ubuntu Server自动登录到自身。

只需一种选择的方式,将以下表述用中国语言进行本地化:
如果您希望自动登录到TTY1,虽然这并不推荐,但请执行以下步骤。

sudo mkdir '/etc/systemd/system/getty@tty1.service.d'

# drop-in ファイルの作成
sudo su -c "cat << '__EOF__' > '/etc/systemd/system/getty@tty1.service.d/autologin.conf'
### Editing /etc/systemd/system/getty@tty1.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin $(whoami) --noclear %I 38400 linux
__EOF__"

# 作成できたか確認
sudo ls -laF /etc/systemd/system/getty@tty1.service.d/
# 必要があれば、改行コードを変更
sudo sed -i -e 's/\r//g' "/etc/systemd/system/getty@tty1.service.d/autologin.conf"
# 記入内容、特にユーザー名の確認
sudo cat /etc/systemd/system/getty@tty1.service.d/autologin.conf

# 記入した内容を反映
sudo systemctl daemon-reload
# ちゃんと追記されているか確認
sudo systemctl --no-pager cat getty@tty1.service

引用来源、参照来源、参考来源

在Ubuntu Server22.04上安装GUI(桌面)环境的方法:
– https://4thsight.xyz/40719

如何启用Ubuntu 20.04上的自动登录?-Linux提示:
– https://ciksiti.com/ja/chapters/608-how-to-enable-automatic-login-on-ubuntu-20-04—linux-hint

自动登录tty1设置当启动电源:
– /etc/systemd/system/getty@tty1.service.d/autologin.conf

ArchWiki:虚拟控制台:
– https://wiki.archlinux.org/title/Getty#Automatic_login_to_virtual_consol

使用systemd实现自动登录(非GUI)(适用于Ubuntu 16.04+和Debian 8+):
– https://www.blackmanticore.com/8683a884ca8aad72b46442e0b7196cef

bannerAds