我想以“服务器”的形式(通常)运行一个盒子(没有GUI),有时运行GUI,因为有些事情这样更容易。我和Linux 18肉桂一起工作。我想要引导到控制台,而不是启动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 start这样的服务,我仍然可以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"发布于 2016-08-12 21:56:53
sudo systemctl disable mdm 这实际上并没有“禁用”服务,它只是阻止了服务的自动启动。
如果你想进入你的家庭,你会的
sudo systemctl start mdm如果您想在默认情况下引导到gui:
sudo systemctl enable mdm 对于预系统%d系统,您需要删除/etc/rc*目录中的mdm符号链接。
https://unix.stackexchange.com/questions/303113
复制相似问题