The officially official Devuan Forum!

You are not logged in.

#1 2021-05-03 21:47:05

hdt551
Member
Registered: 2021-04-07
Posts: 10  

[SOLVED] How to change system to boot to text login instead of gui

I installed xfce but would like the machine to boot to non-graphics mode instead of the gui login.
I still want to go into graphics mode as needed with "startx".

On debian you have to use systemctl commands to change to text login but of course that's not available.
I tried editing /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="text" but that didn't work.

This is on Beowulf.

Offline

#2 2021-05-03 22:10:21

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 582  

Re: [SOLVED] How to change system to boot to text login instead of gui

Hi, use the run level... 1 to 6 inplace of "text"


pic from 1993, new guitar day.

Offline

#3 2021-05-03 22:23:01

Marjorie
Member
From: Teignmouth, UK
Registered: 2019-06-09
Posts: 219  

Re: [SOLVED] How to change system to boot to text login instead of gui

I have this working in Beowulf with lightdm and Cinnamon.

I have a GRUB_CMDLINE_LINUX="text" in /etc/default/grub.

I assume that you ran update-grub to change /boot/grub/grub.cfg?

This should have put a 'text' parameter in the linux /vmlinux.. line of your grub.cfg's menuentry.

This will start you in text mode, not sure if this will then permit you to successfully run startx - it is implemented as a simple trap in the lightdm init script (/etc/init.d/lightdm):

case "$1" in
  start)
        CONFIGURED_DAEMON=$(basename "$(cat $DEFAULT_DISPLAY_MANAGER_FILE 2> /dev/null)")
        if grep -wqs text /proc/cmdline; then
            log_warning_msg "Not starting Light Display Manager (lightdm); found 'text' in kernel commandline."
        elif [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ] && \
           [ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] && \
           [ "$CONFIGURED_DAEMON" != lightdm ] ; then
                log_action_msg "Not starting Light Display Manager; it is not the default display manager"
        else
                log_daemon_msg "Starting Light Display Manager" "lightdm"
                start-stop-daemon --start --quiet --pidfile /var/run/lightdm.pid --name lightdm --exec $DAEMON -b|| echo -n " already running"
                log_end_msg $?
        fi
  ;;

In my case this is on my mail server and I just run it headless and ssh -X into it from my desktop PC. Graphics mode (Cinnamon desktop) is installed as I used it when configuring the server and it's there if I were to need to work on the server with a keyboard and screen plugged in on my desk.

Last edited by Marjorie (2021-05-03 22:44:44)

Offline

#4 2021-05-03 22:29:05

hdt551
Member
Registered: 2021-04-07
Posts: 10  

Re: [SOLVED] How to change system to boot to text login instead of gui

Unfortunately setting GRUB_CMDLINE_LINUX ="text" or "3" doesn't work for me.
It is recognizing the change, if it set it to "1", it does indeed go into single user mode.
(I am running update-grub after the change)

I can see the word runlevel 3 scroll by just before it switches to the gui login.

Offline

#5 2021-05-03 22:42:17

Marjorie
Member
From: Teignmouth, UK
Registered: 2019-06-09
Posts: 219  

Re: [SOLVED] How to change system to boot to text login instead of gui

I've now updated my earlier reply. It works with lightdm and hence with display managers that use lightdm. I think it was also present as a gludge in gdm. If you use something else (slim?) it may not work.

Offline

#6 2021-05-03 22:53:25

hdt551
Member
Registered: 2021-04-07
Posts: 10  

Re: [SOLVED] How to change system to boot to text login instead of gui

I am using slim and is most likely the reason why the grub command doesn't seem to work for me.

Just need to figure out how to disable it on startup (I don't want to completely uninstall it).

Offline

#7 2021-05-03 23:13:15

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,106  

Re: [SOLVED] How to change system to boot to text login instead of gui

I think debian configures all run-levels 2-5 the same, so you'll need to change one of them, say 3, to boot up without starting a display manager (slim).

There are many ways to do so. For example, you might install sysv-rc-conf and run that in a terminal so as to "untick" the box for slim at run level 3, and then reboot with grub set to use run level 3.

I haven't tried this myself but I believe it's sufficient to avoid slim at boot up.

Offline

#8 2021-05-03 23:16:30

hdt551
Member
Registered: 2021-04-07
Posts: 10  

Re: [SOLVED] How to change system to boot to text login instead of gui

It looks like:
update-rc.d slim disable
stops it from running on boot but I also don't get a login prompt.

I will try sysv-rc-conf and see now that goes.

Offline

#9 2021-05-03 23:17:04

MLEvD
Member
Registered: 2021-02-14
Posts: 140  

Re: [SOLVED] How to change system to boot to text login instead of gui

hdt551 wrote:

Just need to figure out how to disable it on startup (I don't want to completely uninstall it).

You mean on restartup or startup? For restartup, uninstalling the graphical greeter is perfectly acceptable. To change at startup you'd have to login as single user and uninstall or disable the greeter

A hack, to disable it, is to create a large file that leaves you with enough free disk space to boot but not enough to run the greeter. When you get your login, rm that file, and you can stay right there, or startx.

Offline

#10 2021-05-04 00:05:41

hdt551
Member
Registered: 2021-04-07
Posts: 10  

Re: [SOLVED] How to change system to boot to text login instead of gui

MLEvD wrote:

You mean on restartup or startup? For restartup, uninstalling the graphical greeter is perfectly acceptable. To change at startup you'd have to login as single user and uninstall or disable the greeter

By startup I mean when booting up. 
I found when I disabled slim, it did not go into graphics mode but it also didn't give me a login prompt.  It was still possible to ssh into the machine though.

It isn't possible to uninstall slim, when I try that, apt wants to remove most of the OS (or at least everything to do with graphics).

Offline

#11 2021-05-04 00:24:14

hdt551
Member
Registered: 2021-04-07
Posts: 10  

Re: [SOLVED] How to change system to boot to text login instead of gui

I tried this:

apt install lightdm
change line in /etc/default/grub to:
GRUB_CMDLINE_LINUX="text"
run update-grub
apt remove slim

On reboot, I see a [warn] message from lightdm saying it found 'text' in kernel command line and would not start.

Same result as before when I disabled slim, there is no login prompt so something is missing which gives the console login prompt.

Offline

#12 2021-05-04 00:37:32

hdt551
Member
Registered: 2021-04-07
Posts: 10  

Re: [SOLVED] How to change system to boot to text login instead of gui

I edited /etc/inittab and set the default runlevel to 3
On boot, it shows it is going into runlevel 3 but still doesn't give a console prompt.
However, if I ssh into it and run init 4 then init 3, the console then displays a login prompt.

Offline

#13 2021-05-04 08:12:06

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 582  

Re: [SOLVED] How to change system to boot to text login instead of gui

Hi, I wonder if when you are at the non-login point, what happens if you "ctrl-alt-F(1 to 7)? Do you get a login prompt?


pic from 1993, new guitar day.

Offline

#14 2021-05-04 09:32:19

bai4Iej2need
Member
From: Ortenau
Registered: 2021-04-25
Posts: 96  

Re: [SOLVED] How to change system to boot to text login instead of gui

Hi
If you dont get a login Prompt, check your /etc/inittab
look at these lines

...
# The default runlevel.
id:2:initdefault:
....
# Format:
#  <id>:<runlevels>:<action>:<process>
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6

the 6 lines shall not be commented out.

in Runlevels 4 5 you have only one text console !

b) avoid the graphical login
edit /etc/init.d/slim (i have lightdm so I show you what I did)
do with your editor
vi  /etc/init.d/lightdm
shift the "2" from line Default-Start to the line Default-Stop
result must look like this

#! /bin/sh
### BEGIN INIT INFO
# Provides:          lightdm
# Should-Start:      console-screen kbd acpid dbus hal consolekit
# Required-Start:    $local_fs $remote_fs x11-common
# Required-Stop:     $local_fs $remote_fs
# Default-Start:     3 4 5
# Default-Stop:      0 1 2 6
# Short-Description: Light Display Manager
# Description:       Debian init script for the Light Display Manager
### END INIT INFO

now do

update-rc.d lightdm remove
update-rc.d lightdm defaults

should apply similarly to slim
worked on my desktops

do

init 3 

to start your graphical login

BR

Last edited by bai4Iej2need (2021-05-04 09:40:06)


The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390

Offline

#15 2021-05-04 09:37:48

berni51
Member
From: Middle of Germany
Registered: 2018-12-20
Posts: 94  
Website

Re: [SOLVED] How to change system to boot to text login instead of gui

Simply disable your Login-Manager (xdm, lightdm, gdm, slim - whatever you use). Now your booting ends up at a non-graphical login. Alt+ctrl+F1/2/3... gives virtual screens, again without GUI.
If you want to start Xorg via startx, you may need the .xinitrc file. Link your .xsession to .xinitrc or create a new file. In the simplest case your .xinitrc contains only the call of  the window-manager of your choice, maybe "exec xfce4-session".


The good ol' days will not return, and the rocks might smelt and the sea may burn.

Offline

#16 2021-05-04 12:37:34

MLEvD
Member
Registered: 2021-02-14
Posts: 140  

Re: [SOLVED] How to change system to boot to text login instead of gui

Ah, not sure then, in that case. I've only ever installed full devuan with slim and devuan desktop once. Every other time it's either an ultra-minimal netinstall with lightdm and it's lightdm-gtk-greeter, or a conversion from LMDE 2 or 3, with lightdm being the default dm there, and using either slick-greeter or lightdm-gtk-greeter.

If you upgrade LMDE2 to LMDE3 and apt-mark hold sysvinit-core, you end up with dual boot where sysv manages to go graphical but systemd doesn't. Can't figure out how to keep this config through to buster/beowulf, sadly.,

Last edited by MLEvD (2021-05-04 12:38:11)

Offline

#17 2021-05-04 12:41:24

hdt551
Member
Registered: 2021-04-07
Posts: 10  

Re: [SOLVED] How to change system to boot to text login instead of gui

bai4Iej2need wrote:

....

b) avoid the graphical login
edit /etc/init.d/slim (i have lightdm so I show you what I did)
do with your editor
vi  /etc/init.d/lightdm
shift the "2" from line Default-Start to the line Default-Stop
result must look like this

#! /bin/sh
### BEGIN INIT INFO
# Provides:          lightdm
# Should-Start:      console-screen kbd acpid dbus hal consolekit
# Required-Start:    $local_fs $remote_fs x11-common
# Required-Stop:     $local_fs $remote_fs
# Default-Start:     3 4 5
# Default-Stop:      0 1 2 6
# Short-Description: Light Display Manager
# Description:       Debian init script for the Light Display Manager
### END INIT INFO

now do

update-rc.d lightdm remove
update-rc.d lightdm defaults

should apply similarly to slim
worked on my desktops

do

init 3 

to start your graphical login

BR

This did indeed work for slim also.

I also found the reason I was not getting a console login prompt was because I had added a rc.local entry and it was hanging, when I removed the entry the console login appeared as expected.

Thanks to everyone for their help.

Offline

Board footer