1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Daft Q: Can you boot to console, but then selectively run and exit the GUI going back to console?

Discussion in 'Linux & Open Source' started by Donnie Fisher, Dec 13, 2019.

  1. Donnie Fisher


    Joined: Jun 22, 2018

    Posts: 488

    Location: Vegas baby !

    I'm looking at building a server for the house based most likely based on linux. It'll be based in the garage and want it to be able to:

    • Provide a NAS storage space for the house network which I can increase / upgrade over time by adding drives (thinking ZFS on ubuntu server at the moment)
    • Run CCTV recording. Dont need motion detection, just straight record from a few camera. (Shinobi?)
    • At times be able to use the GUI ( browse web, youtube etc )
    As it'll likely sit running idle / cctv recording most of the time, I'm currently under the impression that running in console only is better on the power consumption.

    So its it possible to have a machine which boots to console, starts up the NAS / cctv recording, and just sits at the console.

    Then when I want, I can simply type a command which will boot the GUI, mess about as needed then exit the GUI and be back at the console again, and the GUI wont be running to save on the power consumption?
  2. Thranos


    Joined: May 21, 2018

    Posts: 4

    Location: /bin/bash

    Correct, having no GUI loaded can drastically lower the memory usage of your system. Thus it will be freer to concentrate on the tasks you have in mind. For example, I know a Raspberry Pi running Linux consumes a sum of 68MB while also running a web server. While a full Linux desktop consumes around 400Mb with a Desktop Environment just booted.

    What you'll want to do is disable the 'display manager' of a Linux distro, so that when you power it on you're instead presented with a plain text login. It's easy to login using plain text, you'll just be prompted for your username and password. It's worth mentioning that there will be no asterisks appearing for the password characters; this is a security feature.

    So, the meat of the matter. Follow these instructions to disable the graphical login on Ubuntu. You could go further and remove the 'display manager' completely, this would be a command like 'apt-get remove lightdm' on Ubuntu, though I'd only bother with that if you wanted to be sure you'll never look back, or wanted to free some disk space.

    Then, once you're in text mode and logged in, you may run 'startx' to bring up the desktop as before. It's as easy as that!

    If you want to be sure your memory usage is low while running in text mode, use the command 'free -h' to see what's in use. Also 'top' gives a visual overview of everything running.

    Finally, though a little off the immediate topic, I'd also look at using 'ssh' to login and manage your NAS remotely. It'd save you the bother of trooping to the garage every time something goes wrong!
  3. Donnie Fisher


    Joined: Jun 22, 2018

    Posts: 488

    Location: Vegas baby !

    Thanks, the current plan is to likely use a Dell server as the machine, so i should be able to SSH into it, but also use the iDrac setup to get at it remotely as well.

    It will have a display attached to it though, because in the garage when in the garage I do need access to a GUI'ed machine at times ( such as looking at the workshop manuals of the cars when I fix them ). Its occasional, but the grief I get from going through the house when covered in oil is not worth it ! :) This is why i would like to be able to start up the GUI when needed, then close it down afterwards ... all without stopping the base running NAS / CCTV services at the time.

    Plus, its something to learn.
  4. the-evaluator

    Wise Guy

    Joined: Sep 24, 2015

    Posts: 1,616

    When you say power, do you mean electricity or RAM as @Thranos mentioned? I'd assume you're referring to electricity and I may be wrong but I'd be surprised if having the GUI running made any noticable difference to power consumption versus running just the console.

    In any case, if you're using a Dell server then that's likely to be a bit power hungry anyway so the difference in power consumption between having the GUI running and not will be irrelevant. If electricity running costs are a concern then I wouldn't be using a Dell server in the first place.

    If by power you mean RAM, if you find having the GUI running causes RAM issues then shove more RAM in the box.

    In your situation I'd leave the GUI running all the time.
  5. Donnie Fisher


    Joined: Jun 22, 2018

    Posts: 488

    Location: Vegas baby !

    Was mainly meaning leccy power, not processing power. Reading around there was someone with an enterprise server who ran console only - 100W. When they ran desktop + Firefox, it jumped towards 200W. I don’t think my situation would be as marked as that though.

    Yes, a server would run slightly higher wattage overall, but I’m already running separate nas and cctv boxes which I’ll chuck, so that will negate some but far from all the running costs.

    Still swithering about the dell server aspect of it. Yes, I could go for something more modern and ryzen based, but it really want rack sized chassis for easy mounting, and preferably hotswap bays for swapping out a backup drive which I can store off site easily. When you factor that into the price of a newer self build, an existing second hand enterprise server fares pretty well as drives trays etc are easily had to expand the storage and begin rotating backup drives.
    Last edited: Dec 15, 2019