启动到控制台(标准方法失败)

启动到控制台(标准方法失败)

我正在尝试让 Ubuntu 直接启动到控制台。我不想完全删除 GUI,因为有时我仍然需要它来作为训练轮,但如果不需要它,我也不想处理它。过去,我能够通过编辑在以前的版本中轻松实现这一点/etc/default/grub,但出于某种原因,它在 15.10 上不起作用。

这是我的/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=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="text"

# 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=640x480

# 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"

如您所见,我已注释掉 quiet splash,GRUB_CMDLINE_LINUX将的值更改为"text",并取消注释GRUB_INIT_TUNE。但是,唯一似乎有影响的是安静启动。当我在该行中添加和删除哈希时,它会影响机器启动时的行为,所以我知道 grub 会在我告诉它时进行更新。但无论我做什么,它仍然会立即加载 GUI。

答案1

编辑(/etc/default/grubGRUB_CMDLINE_LINUX="3"的,删除text并在其位置添加3)。

您可以通过在终端窗口中运行来实现此目的:

sudo nano /etc/default/grub

  • 编辑文件并退出

sudo update-grub

重新启动后您将进入命令行。

启动3参数将运行级别设置为3而不是默认值(5),这是启动 GUI 所必需的。

相关内容