I have gone through a few topics and articles, but “headless” is confusing me a bit. So perhaps, I first need to understand whether my idea is actually feasible.
I run Manjaro Gnome on a desktop x86 Intel based system with Docker and a few containers.
Lately I noticed I use the actual GUI less, because I am not physically behind the monitor. Instead, I use my laptop (also runs Manjaro Gnome) and sometimes connect to it via gnome-remote-desktop (RDP).
So I thought: hey, why not disable the GUI by default (do not start it at boot). I am extremely focused on every 0.5W energy I can save (I have a special Fujitsu motherboard designed for 24/7 use with low power consumption). And I like to give this a try.
I suspect, to disable the GUI from starting automatically, I need to change something in GRUB.
But will I still be able to login (via Terminal) ? Because I do want the processes such as docker, wireguard etc to start (which happens via systemd).
And how can I start the GUI if I need to?
Lastly, if the GUI is not started, would I still be able to connect via RDP/Gnome-remote-desktop, or first use SSH to launch the GUI and then connect via Gnome-remote-desktop? I noticed Gnome has a “headless remote desktop” feature, but its unclear what that really means.
Currently, step 1 would be to disable GUI from starting, while making sure I can still login and have a command ready to start it when needed…
Strangely, I can’t find much about this topic, all info is regarding ARM/RPi with a specific version of Manjaro.
Any help, clarification would be appreciated.
The easy way is to disable the display manager.
In case of Gnome disable gdm
sudo systemctl disable gdm
In my vocabulary and understanding of the headless definition - is a system you access over network - a system where you do not visually or physically interact with the hardware.
It does not imply it cannot be used on-site physically/visually - as it could easily be a rpi sitting next to you on the desktop.
While the following has been written using a rpi - the principles used applies to non rpi as well
Thanks, I didn’t find those topics very helpful, as its mostly covering installation over SSH, or headless mode using VNC which I really do not want (I prefer RDP, which Gnome supports) but I have gotten a lot further now.
My biggest worry was how to login? But with display manager disabled, I am prompted for login so that is perfect. Also, if I do occasionally need the GUI, I can simply do
systemctl start gdm and voila, login screen > desktop.
However, when I am done and want to close the GUI again (without stopping any services running under the user account),
systemctl stop gdm does not succeed, I get a black screen with blinking underscore. No terminal.
Perhaps I am using the wrong command to stop the GUI gracefully? Unfortunately I am afraid I need to do a reboot via SSH now, because I can no longer interact with the system (no GUI, no terminal).
Once that is figured out, my next step would be to be able to start a remote GUI session using RDP (without having to start the display manager locally first). The solution I found seems to be here:
But I have not tested that yet.
Oh noo! This actually messed up my desktop! When I start GDM manually (or enable the service and reboot), I get the default desktop, the way it looks after you install Manjaro! I do not see my personalized configuration anymore. It looks like that got deleted somehow?
I only did
sudo systemctl disable gdm and ran
systemctl start gdm and
systemctl stop gdm.
I suppose I have to use the snapshots to go back to the one from yesterday.
Disabling the display manager does not alter your personal settings in any way.
You see what the user you are using to login with would see - something tells me it is not the same user as the one you used to customize the desktop.
I have no experience with RDP on Linux - other than the client connection I make to remote windows servers.
When I setup remote connection to a headless system I use TigerVNC - not RDP so I won’t be of much use in that regard.
I only have 1 single user set up called “asterix” and logged in with that user.
Also tried logging out and in again via GUI. Same story. I lost my customization.
My best guess is this happened after I had disabled GDM, then started it manually, then when I was in Gnome, I executed
systemctl stop gdm → that gave me a blank screen with blanking cursor. Something went wrong there.
I will go back to snapshot of yesterday and try again. Will try to find a way to stop gdm more gracefully.
That may be - but I highly doubt that disabling gdm caused it.
Enabling/Disabling the display manager is simply adding and removing of them symlink /etc/systemd/system/display-manager.service - and that action alone will not touch anything inside your /home/$USER folder.
So logic states it is something else - but since I have noknowledge on running a RDP as a service
Yes I know all
systemctl disable does is remove a symlink. I am trying to explain this happened after manually stopping gdm.
My point is that my system went blank (black) with blinking cursor. I couldn’t do anything. Clearly something went wrong and that may have caused this issue. This happened after action 4 below:
systemctl disable gdm and reboot.
- notice terminal gives me login prompt. Exactly what I was hoping for. Login with user
- now as a test, if I occasionally need GUI, start gdm
systemctl start gdm all fine, it starts and looks like I expected.
- now, as a test, stop gdm again, when I am done with GUI:
systemctl stop gdm
→ black screen with blinking underscore. No input works.
- Via a different device, login via ssh,
- terminal → login.
systemctl start gdm
→ shows me default GUI instead of my customized version.
it is not clear if this is using ssh or you are in hands-on mode.
If you are in hands-on mode - there is no need to launch gdm - after all you are logged in - simply run startx should do it.
I am only testing hands-on mode for now. And I use the default of Manjaro Gnome. so Wayland. I thought
startx was for X only, not Wayland? I would expect something else? Like
gnome-session --session gnome-wayland
My shortcomings are obvious - I don’t use Gnome - I certainly didn’t know Gnome on ARM was using wayland
But alas - in any case - you don’t need to launch gdm - as it only provides a graphical handling of the login to the system - and as you are already logged in you should use the command suitable for your system.
Not on ARM
No worries, you gave me the little push I needed to start switching to headless by default for my homeserver.