LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-01-2018, 03:14 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,886

Rep: Reputation: 55
How do I disable X at boot time so that the system boots in text mode?


Hi: When the booting sequence ends I find myself in the GUI, where a login prompt is presented me (Debian version 9). I would like to change this and be able to start X by myself if I like to do it. Any way to accomplish this?

I presume it is in one of the scripts started by inittab that X is called. But which one. There are plenty of them.

Last edited by stf92; 06-01-2018 at 05:52 PM.
 
Old 06-01-2018, 05:58 PM   #2
RandomTroll
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 956

Rep: Reputation: 157Reputation: 157
I always do this. Something in /etc/rc.d does it. I don't have it in mine, but rc.4 looks suspicious.
 
Old 06-01-2018, 06:04 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,886

Original Poster
Rep: Reputation: 55
Mine is
Code:
root@debian:/etc/rc4.d# v
total 0
lrwxrwxrwx 1 root root 17 May 30 14:57 S01anacron -> ../init.d/anacron
lrwxrwxrwx 1 root root 22 May 30 14:58 S01avahi-daemon -> ../init.d/avahi-daemon
lrwxrwxrwx 1 root root 26 May 30 14:53 S01console-setup.sh -> ../init.d/console-setup.sh
lrwxrwxrwx 1 root root 14 May 30 14:52 S01cron -> ../init.d/cron
lrwxrwxrwx 1 root root 14 May 30 14:58 S01dbus -> ../init.d/dbus
lrwxrwxrwx 1 root root 17 May 30 14:58 S01lightdm -> ../init.d/lightdm
lrwxrwxrwx 1 root root 25 May 30 14:58 S01network-manager -> ../init.d/network-manager
lrwxrwxrwx 1 root root 17 May 30 14:52 S01rsyslog -> ../init.d/rsyslog
root@debian:/etc/rc4.d#
the line containing connsole-setup.sh and the line containing lightdm look suspicious to me. I read somewhere one has to edit the /etc/default/grub file this way:
Code:
Find this line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Change it to:

GRUB_CMDLINE_LINUX_DEFAULT="text"

Update GRUB:
I did it but it had no result though it too said:
Code:
For systems that use systemd

This is an additional step for systemd releases, e.g. Ubuntu 15.04, the steps above for grub are still necessary.

You need to tell systemd to not load the graphical login manager:

sudo systemctl enable multi-user.target --force
sudo systemctl set-default multi-user.target

You will still be able to use X by typing startx after you logged in.
However, this is what I got:
Code:
root@debian:/etc/rc4.d# systemctl enable multi-user.target --force
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.
root@debian:/etc/rc4.d#

Last edited by stf92; 06-01-2018 at 06:09 PM.
 
Old 06-01-2018, 06:27 PM   #4
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,886

Original Poster
Rep: Reputation: 55
I did
Code:
systemctl set-default multi-user.target
and it all worked fine.
 
1 members found this post helpful.
Old 06-01-2018, 07:28 PM   #5
RandomTroll
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 956

Rep: Reputation: 157Reputation: 157
If that solved it, you can mark it as solved!(!!!). I answered because you profile sez Slackware. For Slackers taking the 4 out of the terminal inits in inittab seems to be the solution.
 
Old 06-04-2018, 09:17 AM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,374

Rep: Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978
I think you can also append 'init 3' to the kernel line in grub.
 
Old 06-04-2018, 11:26 AM   #7
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: Debian, Crux, LFS, AntiX
Posts: 2,140
Blog Entries: 5

Rep: Reputation: 931Reputation: 931Reputation: 931Reputation: 931Reputation: 931Reputation: 931Reputation: 931Reputation: 931
If your system uses sysvinit, then you just need to change the default boot level in /etc/inittab. Usually level 3 is the correct one for a text boot.

If it's systemd, you can set up a link /etc/systemd/system/default.target to point to /lib/systemd/system/multiuser.target
 
Old 06-05-2018, 12:54 PM   #8
petelq
Member
 
Registered: Aug 2008
Location: UK
Distribution: openSUSE(Leap and Tumbleweed) and a regularly changing third
Posts: 311

Rep: Reputation: Disabled
If you just want to do it as a one-off, then pressing 'e' at grub menu, adding '3' at the end of the kernel line and then f10 will log to a console. It reverts to normal boot next time.
 
Old 06-19-2018, 01:17 PM   #9
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by hazel View Post
level 3 is the correct one for a text boot
Runlevels 2 through 5 are identical in Debian (and correspond to multi-user mode).

A cursory search suggests that adding text as a kernel command line parameter will force a console boot in the absence of systemd but I haven't tested this (I use systemd in my Debian box).
 
Old 06-19-2018, 08:23 PM   #10
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 13,954
Blog Entries: 24

Rep: Reputation: 3745Reputation: 3745Reputation: 3745Reputation: 3745Reputation: 3745Reputation: 3745Reputation: 3745Reputation: 3745Reputation: 3745Reputation: 3745Reputation: 3745
I found this tutorial. http://ask.xmodulo.com/boot-into-com...tu-debian.html

I haven't tested it.
 
Old 06-24-2018, 03:57 PM   #11
engines
LQ Newbie
 
Registered: Jun 2018
Posts: 22

Rep: Reputation: Disabled
I would like to do this as well. So what all needs editing? I don't want to issue some command that mysteriously changes something if I decide to change it all back. Also do you just start x to start gui back up? Years ago with kde I think I just typed kde and enter to start it from terminal?
 
Old 06-25-2018, 01:24 AM   #12
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by engines View Post
So what all needs editing? I don't want to issue some command that mysteriously changes something if I decide to change it all back.
Test the change temporarily by pressing "e" with the Debian boot menu entry highlighted, add
Code:
text
to the end of the line that starts with "linux" and then press <Ctrl>+x (at the same time) to boot the modified entry.

To make the change permanent, add "text" to GRUB_CMDLINE_LINUX in /etc/default/grub and run `update-grub` (as root) to update the boot menu.

Quote:
do you just start x to start gui back up?
Yes.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
When Centos 6.3 starting,All services starting OK and starting Atd: OK .And stop scr. DeSouffle Linux - General 4 08-29-2013 12:46 AM
Starting FF from menu appears differently to starting from shortcut vdemuth Slackware 11 10-01-2012 11:34 PM
Gnome: Starting an app switches to a running instance instead of starting a new one SeppJ Linux - Newbie 0 05-28-2009 10:06 AM
starting xprogram without starting X server. bruse Linux - Newbie 9 04-26-2005 07:05 PM
Won't Boot - Starting Printer Service - Starting CUPS jeansond Linux - Newbie 0 10-11-2004 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration