Subject: How to arrange for booting to console

From: Harry Putnam <[email-masked]>
Date: Sun, 11 Sep 2016 17:04:51 -0400

How can I arrange to boot to console mode rather than X.   With the
ability to startx when I feel like it.

I'm not familiar with grub2 and the debian vm I'm using on a solaris
host appears to be using grub2.

Can anyone stear me to the files I'd need to edit?

---

From: [email-masked]
Date: Sun, 11 Sep 2016 21:54:23 +0000 (UTC)

If using systemd, these look relevant:

> How can I arrange to boot to console mode rather than X.

  https://www.freedesktop.org/wiki/Software/systemd/TipsAndTricks/#changingthedefaultboottarget

  # ln -sf /usr/lib/systemd/system/multi-user.target /etc/systemd/system/default.target

> With the ability to startx when I feel like it.

  https://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions

  # systemctl isolate graphical.target

---

From: Lisi Reisz <[email-masked]>
Date: Fri, 16 Sep 2016 12:35:37 +0100

>   # systemctl isolate graphical.target

Debian does not by default have an available multi-user CLI run level.

Lisi

---

From: Michael Biebl <[email-masked]>
Date: Sun, 11 Sep 2016 23:44:44 +0200

> Can anyone stear me to the files I'd need to edit?

Assuming you use jessie (and systemd),

systemctl set-default multi-user.target

should do the trick. You can get the current default with

systemctl get-default

It's typically graphical.target.

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

---

From: The Wanderer <[email-masked]>
Date: Sun, 11 Sep 2016 17:44:43 -0400

> Can anyone stear me to the files I'd need to edit?

Unless you actually want to be able to get to the graphical login
prompt, I don't believe you need to mess with GRUB, the bootloader, or
the initrd at all.

The way I usually do it is to uninstall gdm, kdm, xdm, et cetera; those
are the packages which hook in to provide a graphical login prompt. With
none of them present, what you get is the traditional text-mode login
prompt, and your configured shell after login.

From there, assuming other permissions are configured correctly (which I
seem to recall may take some tweaking, under the systemd paradigm),
'startx' should work normally. It may or may not pick up your desired
window manager; I believe the Debian Way to specify that is to select
one as the preferred alternative for the 'x-window-manager' link group.

If you do want to keep one or more of those packages present, or if you
want to do this more explicitly / manually, you'll probably need to look
at those packages and figure out what it is they do to hook themselves
in as the login prompt. I haven't investigated exactly what they change
in order to do that, so I can't directly help you there.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

---

From: Harry Putnam <[email-masked]>
Date: Sun, 11 Sep 2016 18:52:59 -0400

>> ability to startx when I feel like it.

[...]

> prompt, and your configured shell after login.

[...]

That sounds promissing.  Used one of the methods below and quickly
realized I was expecting a nice big framebuffered text console with a
much higher resolution than the standard. (Previously my OS of choice
was gentoo), But of course all that has to be setup.... as I recall it
is done with a few extra bits on the kernel line grub.conf....

Using grub2 I'm thoroughly lost what or where one would edit to allow
a console frame buffer.

> It's typically graphical.target.

Thanks, I actually used  your suggestion of
   systemctl set-default multi-user.target

Worked just as suggested.  I have the job running that was running out
of memory.. so I'll see if leaving X out of things is enough to allow
it to complete.  See above for some sniveling about the default
console.

>  # systemctl isolate graphical.target

Thanks, your suggestion is a little more complete version of Davidson
above.... again thanks.

---

From: David Wright <[email-masked]>
Date: Fri, 16 Sep 2016 08:38:31 -0500

I missed this reply until Lisi bumped the thread.
These are my opinions, based of the pathetically little I know.

On Sun 11 Sep 2016 at 18:52:59 (-0400), Harry Putnam wrote:
> That sounds promissing.  

It ought to. It's the display managers that start X. If they're not
there, you've to start it yourself with startx.

> Used one of the methods below and quickly
> much higher resolution than the standard.

But you got ... what?

If you want to know whether you're looking at a nice big framebuffered
text console, install fbset and type
$ fbset
If you see something like:

mode "1280x800"
    geometry 1280 800 1280 800 32
    timings 0 0 0 0 0 0 0
    accel true
    rgba 8/16,8/8,8/0,0/0
endmode

then you are.

BTW What's the "standard" resolution of which you speak?

> (Previously my OS of choice

I've yet to install a Debian system where the kernel didn't boot into
a console (VC1) running at anything other than the native/maximum
resolution. Now, maybe I'm lucky. Maybe I've had good fortune with
graphics devices, screens and everything else. But I would recommend
investigating exactly what you've got on booting up before you start
fiddling. Oh, and if you see your huge screen with a blurry 80x25
console on it, don't mistake font size for resolution.

Use   dpkg-reconfigure console-setup   to set utf-8, Latin1, the font
and its size. With a framebuffer you get more choice of size.
Note: don't ever run dpkg-reconfigure console-setup if X is running,
whether or not you're using it (eg by typing Ctl-Alt-Fn). It won't
have the desired effect and it might have you troubleshooting
problems of your own making.

As for systemctl set-default, no idea, never used it wittingly.
As for runlevels, well, as Lisi said, Debian doesn't use them in
the way some distributions do, which can cause confusion.
1 is single-user, 2 is normal. Apologies if that simplicity has been
abandoned in stretch since I last checked.

Cheers,
David.

---

From: Jude DaShiell <[email-masked]>
Date: Sat, 17 Sep 2016 02:34:11 -0400 (EDT)

On Fri, 16 Sep 2016, David Wright wrote:

> Date: Fri, 16 Sep 2016 09:38:31
> From: David Wright <[email-masked]>
> Reply-To: [email-masked]
> To: [email-masked]
> Subject: Re: How to arrange for booting to console
> Resent-Date: Fri, 16 Sep 2016 13:43:51 +0000 (UTC)
> Resent-From: [email-masked]
> 
edit /etc/default/grub then run grub-mkconfig to apply your changes like 
this:
grub-mkconfig -o /boot/grub/grub.cfg

hth.

--

---

From: David Wright <[email-masked]>
Date: Mon, 19 Sep 2016 14:48:35 -0500

> >>Using grub2 I'm thoroughly lost what or where one would edit to allow
                                    ↑↑↑↑↑↑↑↑↑↑↑↑↑
> >>a console frame buffer.
[snipped my response which was not grub-related]
> >
> edit /etc/default/grub then run grub-mkconfig to apply your changes
> like this:

That's the "where"; what's the "what" ?

Cheers,
David.

---

From: Jude DaShiell <[email-masked]>
Date: Mon, 19 Sep 2016 16:23:05 -0400 (EDT)

On Mon, 19 Sep 2016, David Wright wrote:

> Date: Mon, 19 Sep 2016 15:48:35
> Resent-Date: Mon, 19 Sep 2016 19:48:54 +0000 (UTC)
>                                    ?????????????
Almost forgot, after doing edit as root run update-grub as root and you 
should be good to go.

--

---

From: Lisi Reisz <[email-masked]>
Date: Mon, 19 Sep 2016 21:28:58 +0100

On Monday 19 September 2016 21:23:05 Jude DaShiell wrote:
> >>>>> The way I usually do it is to uninstall gdm, kdm, xdm, et cetera;
> >>>>> those are the packages which hook in to provide a graphical login
> >>>>> prompt. With none of them present, what you get is the traditional
> >>>>> text-mode login prompt, and your configured shell after login.
> >>>>
> >>>> [...]
> >>>>
> >>>> That sounds promissing.
> >>>

That still isn't the "what"!!!

Lisi

---

From: [email-masked]
Date: Mon, 12 Sep 2016 05:57:29 +0000 (UTC)

> Using grub2 I'm thoroughly lost what or where one would edit to allow

Maybe OP will find this thread helpful:

  "Debian Jessie : regular console instead of a hi-res one!"
  https://lists.debian.org/debian-user/2016/09/msg00127.html

---

From: The Wanderer <[email-masked]>
Date: Sun, 11 Sep 2016 19:03:37 -0400

On 2016-09-11 at 18:52, Harry Putnam wrote:

>>> How can I arrange to boot to console mode rather than X.   With
>>> the ability to startx when I feel like it.

> realized I was expecting a nice big framebuffered text console with
> a much higher resolution than the standard. (Previously my OS of
> choice was gentoo), But of course all that has to be setup.... as I
> recall it is done with a few extra bits on the kernel line
> grub.conf....
> 
> Using grub2 I'm thoroughly lost what or where one would edit to
> allow a console frame buffer.

AFAIK, the GRUB2 menu is defined from /boot/grub/grub.cfg; the headers
of that file say that it's generated from templates in /etc/grub.d/ and
settings in /etc/default/grub.

Based on a quick look in those locations, you probably want to adjust
one of the GRUB_CMDLINE_LINUX* settings in the latter file. I haven't
done much tweaking in that area myself, however (I only migrated to
GRUB2 within the last year, give or take), so I can't confirm that with
any certainty.

-- 
   The Wanderer

---

From: Tixy <[email-masked]>
Date: Mon, 12 Sep 2016 07:54:24 +0100

> GRUB2 within the last year, give or take), so I can't confirm that with

That's how I tweak grub to change things like the boot timeout and
kernel commandline. I.e. edit etc/default/grub and as that file says
"run 'update-grub' afterwards".

-- 
Tixy