我想将一个盒子作为(通常)“服务器”(没有 GUI)运行,偶尔也用 GUI 运行,因为这样有些事情更容易。我正在使用 Linux Mint 18 Cinnamon。我想启动到控制台而不是启动,mdm
但我希望能够切换回来,因此涉及完全删除的解决方案mdm
对我来说不起作用。
对于默认启动,我已经编辑grub
(下面的整个文件)GRUB_CMDLINE_LINUX="text"
并运行sudo update-grub
但mdm
仍然启动;然后我尝试设置mdm
为手动,echo manual | sudo tee /etc/init/mdm.override
但mdm
仍然启动。
我可以mdm
手动停止,sudo service mdm stop
这与我想要的很接近。
我最好的解决方案让我mdm
像往常一样启动,然后我必须mdm
手动停止。我希望机器从reboot
或 电源循环正常启动,除了 GUI 根本不启动(除非我告诉它,例如通过grub
在grub
菜单中编辑或选择不同的选项)。“正常启动”是指像tomcat
启动这样的服务,我仍然rsh
可以对机器和/或远程调试它。
# 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="text"
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"
Run Code Online (Sandbox Code Playgroud)
sudo systemctl disable mdm
Run Code Online (Sandbox Code Playgroud)
这实际上并没有“禁用”服务,它只是阻止它自动启动。
然后,如果你想进入你的 gui,你可以
sudo systemctl start mdm
Run Code Online (Sandbox Code Playgroud)
如果你想默认引导到 gui:
sudo systemctl enable mdm
Run Code Online (Sandbox Code Playgroud)
对于 pre- systemd系统,您需要删除 /etc/rc* 目录中 mdm 的符号链接。
归档时间: |
|
查看次数: |
22544 次 |
最近记录: |