0

I have a PC I am dedicating as a server for Minecraft. It is running Ubuntu Server 20.04.2

Im fine using command line but I don't like only having one space to work. My solution is startx

I have used startx in the past and I enjoy using it. Black background that I can have multiple terminals open without pulling too many resources for graphics.

Ive been using this as a reference: https://askubuntu.com/questions/53822/how-do-you-run-ubuntu-server-with-a-gui
Specifically,

Minimal GUI:

sudo apt install xorg
sudo apt install --no-install-recommends openbox

Run the command startx and openbox will start (you can open a terminal there and run any application you want)"

It has worked before with Ubuntu Server 20.04.1 but stopped working recently

When I start the server I get a GUI login screen instead of a command line and when I log in I have a whole Gui Desktop instead of a command line.

Summary:

  1. I want to boot up the system and be greeted by a command line login
  2. When logged in I want it to stay in a command line until I type "startx"
  3. When typing "startx" I want startx to run the startx GUI

It has worked before with these instructions but won't work now. What do I need to do?

Thank you!

1
  • This sounds like even your --no-install-recommeds installed the login manager (I think it is gdm by default). See if that is running. You should be able to find out which one it is by doing: cat /etc/X11/default-display-manager You could then reconfigure it, or remove the display manager.
    – number9
    Apr 21 at 22:04
1

Change your server to multiuser target instead of graphical target (equivalent to the concept or runlevels of UNIX and non-systemd Linux distros in case you're more familiar with):
sudo systemctl set-default multi-user.target

After reboot you'll be presented by console text prompt to login.

You can check it by,
systemctl get-default

In case you don't have startx command available, install xinit package:
sudo apt install xinit

Not necessary step, but since you'll switch to command-line login and you'll start X by startx, you can also uninstall the Display Manager (DM). It's the the app controlling the graphical login. I can't tell which is installed by installing Openbox, you'll have to search for it.

1
  • To explain better: By default, installing the xorg package assumes that installing it also means you want to boot to a GUI login. For the vast majority of users, this is a true and valid assumption, which is why it is the default. IIRC, there's a priority setting that will ask you if you want this rather than assume; But of course, most users leave the default priority alone as well, so the install uses the defaults.
    – C. M.
    Apr 22 at 14:32
-1

startx starts a GUI server. This is a mismatch for a "server" and an overuse of resources.

screen is a better tool for this. Read man screen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.