It appears that sudo systemctl disable gdm3 && sudo systemctl disable gdm do not work in 18.04 to disable the windowing system at bootup. What's the method for doing this now?
- 1,359
- 2
- 14
- 24
-
You messed up `sysctl` with `systemctl`. Please read their man-pages ([`man 8 sysctl`](http://manpages.ubuntu.com/manpages/bionic/en/man8/sysctl.8.html) and [`man systemctl`](http://manpages.ubuntu.com/manpages/bionic/en/man1/systemctl.1.html)). – N0rbert Jul 15 '18 at 18:12
-
1LOL, you're right, I did it right on the system, but I simply typed it wrong here. Fixed. – ylluminate Jul 15 '18 at 19:54
4 Answers
To disable GUI on boot, run:
sudo systemctl set-default multi-user.target
To enable GUI again issue the command:
sudo systemctl set-default graphical.target
To start Gnome session on a system without a current GUI just execute:
sudo systemctl start gdm3.service
- 2,515
- 11
- 15
-
1It works but there is one problem. The screen is now pretty small in VirtualBox – nurp Sep 19 '18 at 13:25
-
1
-
Doesn't work for me: 'Failed to set default target: Unit file user-multi.target does not exist.' – michid May 19 '19 at 10:24
-
2
-
On my system, this produces the text 'The unit files have no installation config (WantedBy, RequiredBy, Also, Alias settings in the [Install] section, and DefaultInstance for template units). This means they are not meant to be enabled using systemctl.' So...? – sh37211 Jul 03 '20 at 21:36
-
-
In my case, I needed to find a way to disable GUI after I removed a graphics card from my server. This worked great. – Neurotransmitter Jan 10 '21 at 19:54
To answer @nurp's comment
The screen is now pretty small in VirtualBox .
update your
/etc/default/grubaccordingly:GRUB_CMDLINE_LINUX_DEFAULT="nomodeset" GRUB_GFXMODE=1152x864x32 GRUB_GFXPAYLOAD_LINUX=1152x864x32run
sudo update-grub.nomodesetso that the kernel does not attempt changing the resolution set by GRUB.GRUB_GFXPAYLOAD_LINUXif this variable is set, it controls the video mode in which the Linux kernel starts up, replacing the ‘vga=’ boot option.
References
- 39,392
- 12
- 115
- 163
- 321
- 3
- 3
To shutdown gdm once started manually..
You simply execute:
sudo systemctl stop gdm3.service
- 91
- 1
- 2
- 6
-
1That's what I would have expected, but it doesn't appear to do anything. – binarymelon Oct 24 '18 at 23:21
In answer to the:
sudo systemctl stop gdm3.service
Not appearing to do anything commented by binarymelon
I can only assume you are doing this in the command line interface outside of the GUI... and you are receiving no response because the GUI service is already closed.
Alternatively, (what took many hours to learn and much longer to understand)...
I have found that everything depends on what you have done... for instance, installing lightdm with no “core” or whatever will result in faulty "GUI-ness"...
If you are indeed running the above command line interface instruction from a terminal within the GUI it will most certainly do something...
Mind you, this is my experience in 18.04.
If you are using gdm3 then it will close and be just a (what I call an old-timey) cursor in the top left... and if you aren’t using gdm3 then it will say:
Failed / not loaded
Note and helpful hint:
If u find yourself having stopped the service and still have no command line interface to type new commands on, try:
CTRL + ALT + F3.
This is your one-stop shopping for the killing/shutdown of the GUI that is loaded no matter what it is... even if your password isn’t being accepted.
I know this to be true because if you attempt to restart the GUI “too soon” a.k.a while it is still in the process of closing/stopping, service/shutting down the GUI, then, in my experience the CLI will alert you to this fact and ask you to try again in a bit.
- 1,915
- 13
- 19
- 31
- 1