How can I set up Ubuntu Server 16.04 to load a GUI on demand?
Solution 1
Run systemctl start lightdm
to start lightdm, and by extension, the rest of the gui, when you desire. systemctl stop lightdm
will shut it down.
Solution 2
Take control from the graphical login manager, use following commands:-
sudo systemctl enable multi-user.target --force
sudo systemctl set-default multi-user.target
edit /etc/default/grub and change
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
to
GRUB_CMDLINE_LINUX_DEFAULT="text"
Then, update the grub, by following command :-
sudo update-grub
After reboot login prompt will appear instead of GNOME login terminal
To start GUI use following command :-
sudo systemctl start lightdm.service && sudo gnome-session
Related videos on Youtube
Wichita
Updated on September 18, 2022Comments
-
Wichita over 1 year
I would like my server to boot to command line by default but load a GUI when I need one.
I have a virtual machine set up just for testing and I got the standard UNITY GUI installed on it no problem. I also modified the /etc/default/grub file to boot to text mode. It wasn't working at first and would still boot to the GUI by default but after some research I found that disabling lightdm got me back to the normal terminal login. My issue is I can not launch back into the full GUI anymore. I can use the command 'startx' to launch into a pretty much featureless GUI but that doesn't really help me.