[sf-lug] virtual console switching, X, etc.

Michael Paoli Michael.Paoli at cal.berkeley.edu
Wed Oct 24 23:19:20 PDT 2007


> Date: Wed, 24 Oct 2007 19:19:21 -0700
> From: "Christian Einfeldt" <einfeldt at gmail.com>
> Subject: Re: [sf-lug] FWIW and :r! dig -t ns sf-lug.com
> 
> A
> virtual shell is important, because sometimes the eye candy that runs on
> top
> of Linux can get goobered up and locked and stalled, but Linux is still
> humming away happily underneath.  If your keyboard is responsive, sometimes
> you can get rid of the programs that are causing your computer to freeze
> up,
> without having to reboot the computer, which is a really useful tool.
> 
> So try depressing your cntrl and alt keys at the same time, and then touch
> the F3 key.  Your screen will go black, and you will get the virtual shell.

Actually, that's virtual console, not virtual shell.  LINUX supports
multiple (up to 63) virtual consoles, and the ability to switch among
them.  Precisely how many virtual consoles are present and enabled,
and how they're configured (e.g. text mode, or X) will vary depending
upon kernel and its configuration, and specific Linux distribution,
configuration, and run level.  Most distributions will typically
enable text login on tty1, typically X on tty5 or tty7 (at least if X
is enabled and active).

E.g. on my home systems I typically have tty1-tty4 and tty8-tty12
enabled for text login, tty5-tty7 for X login, and typically use tty8
for random stuff I may want to launch via startx (e.g.:
$ startx -- :3 &
) or where I want to dump stuff out to text (virtual) console that's
otherwise available and not in use ... but that configuration isn't
exactly my distribution's default configuration.

One can generally switch among the virtual consoles by using
Control-Alt-Fn
where Fn is one of the F1 through F12 function keys
(at last for up to the first 12 virtual consoles).
One can often just do:
Alt-Fn
instead, but that doesn't work in some/many cases (e.g. various X
window managers or applications within X may often bind various
Alt-Fn combinations to specific functions of the application or
window manager).

Note that if the display/keyboard gets sufficiently hosed (e.g. via
X), it may still not be possible to switch virtual consoles via
Control-Alt-Fn
even though the OS is still running and responsive.  Stopping and
restarting the X server may suffice in such cases, e.g.
try Control-Alt-Backspace to kill the X server
or if even that doesn't work, login remotely (if you can) and stop and
restart the X server (I had to do that about once or twice in the past
few months).
:.r !uptime
 22:59:00 up 76 days, 23:25, 19 users,  load average: 1.00, 1.01, 1.03
(and that's my personal *laptop* ... okay, so it doesn't travel all
that much) Some/many distributions also, by default, bind
Control-Alt-Delete to do an orderly shutdown of the system - which is
still a bit better than doing a hard reset or simply removing or
cycling power.

references:
console(4)
vi(1)
uptime(1)




More information about the sf-lug mailing list