如何在启动时启动 lig​​htdm 服务

Mud*_*pil 5 boot grub2 lightdm systemd

我的系统正在运行 Ubuntu 15.04,我已经通过@Bruno Pereira 的回答将默认启动更改为“ text”而不是“ quiet splash如何在启动时禁用 X,以便系统以文本模式启动?。然而我又已经改变了默认的开机quiet splashupdate-grub,但作为Ubuntu的15.04使用systemd我的系统不启动到图形登录,并停留在Ubuntu的标志screen.I've去tty1通过终端CTRL+ ALT+F1和manullay开始Lightdm服务为sudo service lightdm start每登录。

我应该如何将引导更改为图形登录,即“ quiet splash”?内容sudo gedit /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT="quiet splash"
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="quiet splash"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=1920x1080

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
Run Code Online (Sandbox Code Playgroud)

A.B*_*.B. 5

首先为图形环境运行此命令

sudo systemctl set-default graphical.target
Run Code Online (Sandbox Code Playgroud)

因为你以前用过sudo systemctl set-default multi-user.target


然后修复中的条目 /etc/default/grub

这种说法是完全错误的:

GRUB_DEFAULT="quiet splash"
Run Code Online (Sandbox Code Playgroud)

打开配置:

sudo nano /etc/default/grub
Run Code Online (Sandbox Code Playgroud)

并替换条目

GRUB_DEFAULT="quiet splash"
Run Code Online (Sandbox Code Playgroud)

GRUB_DEFAULT=0
Run Code Online (Sandbox Code Playgroud)

添加条目

GRUB_CMDLINE_LINUX="quiet splash"
Run Code Online (Sandbox Code Playgroud)

在那之后运行

sudo update-grub
Run Code Online (Sandbox Code Playgroud)
  • GRUB_DEFAULT

    默认菜单项。这可能是一个数字,在这种情况下,它标识生成的菜单中从零开始计数的第 N 个条目,或者菜单条目的标题,或者特殊字符串“已保存”。如果您想将菜单条目设置为默认值,即使在它之前可能有可变数量的条目,使用标题可能会很有用。

  • GRUB_CMDLINE_LINUX

    添加到 Linux 内核菜单项的命令行参数。

  • GRUB_CMDLINE_LINUX_DEFAULT

    除非将“GRUB_DISABLE_RECOVERY”设置为“true”,否则将为每个 Linux 内核生成两个菜单条目:一个默认条目和一个用于恢复模式的条目。此选项列出了仅添加到默认菜单项的命令行参数,在 'GRUB_CMDLINE_LINUX' 中列出的参数之后。

来源