What is a virtual console and how do I make more?
Virtual consoles, put simply, enable you to have several
simultaneous sessions on the same machine without doing anything
complicated like setting up a network or running X.
When the system starts, it will display a login prompt on
the monitor after displaying all the boot messages. You can
then type in your login name and password and start working (or
playing!) on the first virtual console.
At some point, you will probably wish to start another
session, perhaps to look at documentation for a program
you are running or to read your mail while waiting for an
FTP transfer to finish. Just do Alt-F2 (hold down the Alt
key and press the F2 key), and you will find a login prompt
waiting for you on the second ``virtual console''! When you
want to go back to the original session, do Alt-F1.
The default FreeBSD installation has three virtual consoles
enabled, and Alt-F1, Alt-F2, and Alt-F3 will switch between
these virtual consoles.
To enable more of them, edit
and add entries for ``
# Edit the existing entry for ttyv3 in /etc/ttys and change
# "off" to "on".
ttyv3 "/usr/libexec/getty Pc" cons25 on secure
ttyv4 "/usr/libexec/getty Pc" cons25 on secure
ttyv5 "/usr/libexec/getty Pc" cons25 on secure
ttyv6 "/usr/libexec/getty Pc" cons25 on secure
ttyv7 "/usr/libexec/getty Pc" cons25 on secure
ttyv8 "/usr/libexec/getty Pc" cons25 on secure
ttyv9 "/usr/libexec/getty Pc" cons25 on secure
ttyva "/usr/libexec/getty Pc" cons25 on secure
ttyvb "/usr/libexec/getty Pc" cons25 on secure
Use as many or as few as you want. The more virtual terminals
you have, the more resources that are used; this can be important
if you have 8MB RAM or less. You may also want to change the
``The easiest way to disable a console is by turning it off. For
example, if you had the full 12 terminal allocation mentioned
above and you wanted to run X, you would change settings for
virtual terminal 12 from:
ttyvb "/usr/libexec/getty Pc" cons25 on secure
to:
ttyvb "/usr/libexec/getty Pc" cons25 off secure
If your keyboard has only ten function keys, you would end up with:
ttyv9 "/usr/libexec/getty Pc" cons25 off secure
ttyva "/usr/libexec/getty Pc" cons25 off secure
ttyvb "/usr/libexec/getty Pc" cons25 off secure
(You could also just delete these lines.)
Once you have edited ,
the next step is to make sure that you have enough virtual terminal
devices. The easiest way to do this is:
# cd /dev
# ./MAKEDEV vty12 # For 12 devices
Next, the easiest (and cleanest) way to activate the virtual
consoles is to reboot. However, if you really don't want to
reboot, you can just shut down the X Window system and execute (as
kill -HUP 1
It's imperative that you completely shut down X Window if it is
running, before running this command. If you don't, your system
will probably appear to hang/lock up after executing the kill
command.
How do I access the virtual consoles from X?
If the console is currently displaying X Window, you can use
Ctrl-Alt-F1, etc. to switch to a virtual console. Note, however,
that once you've switched away from X Window to a virtual
terminal, you may use only the Alt- function key to switch to another
virtual terminal or back to X Window. You do not need to also press the
Ctrl key. If you use the control key to switch back to X on some
older releases, you can find your text console stuck in ``control-lock''
mode. Tap the control key to wake it up again.
How do I start XDM on boot?
There are two schools of thought on how to start . One school starts xdm from
using the supplied example, while the other
simply runs xdm from or
from a /usr/local/etc/rc.d.
Both are equally valid, and one may work in
situations where the other doesn't. In both cases the result is the
same: X will popup a graphical login: prompt.
The ttys method has the advantage
of documenting which vty X will start on and passing the responsibility
of restarting the X server on logout to init. The rc.local method
makes it easy to kill xdm if there is a problem starting the X server.
If loaded from rc.local, A previous version of the FAQ said to add the
/usr/X11R6/lib/X11/xdm/Xservers file. This is not necessary:
X will use the first free
When I run xconsole, I get ``Couldn't open console''.
If you start with , the permissions on /dev/console will and not working.
This is because of the way console permissions are set by default.
On a multi-user system, one doesn't necessarily want just any user
to be able to write on the system console. For users who are logging
directly onto a machine with a VTY, the
file exists to solve such problems.
In a nutshell, make sure an uncommented line of the form
/dev/ttyv0 0600 /dev/console
is in and it will ensure that whomever logs in on
/dev/ttyv0 will own the console.
My PS/2 mouse doesn't behave properly under X.
Your mouse and the mouse driver may have somewhat become out of
synchronization.
In versions 2.2.5 and earlier, switching away from X to a
virtual terminal and getting back to X again may make them
re-synchronized. If the problem occurs often, you may add the
following option in your kernel configuration file and recompile it.
options PSM_CHECKSYNC
See the section on [
if you've no experience with building kernels.
]With this option, there should be less chance of synchronization
problem between the mouse and the driver. If, however, you
still see the problem, click any mouse button while holding
the mouse still to re-synchronize the mouse and the driver.
Note that unfortunately this option may not work with all the
systems and voids the ``tap'' feature of the ALPS GlidePoint
device attached to the PS/2 mouse port.
In versions 2.2.6 and later, synchronization check is done
in a slightly better way and is standard in the PS/2 mouse driver.
It should even work with GlidePoint. (As the check code has become
a standard feature, PSM_CHECKSYNC option is not available in these
versions.) However, in rare case the driver may erroneously report
synchronization problem and you may see the kernel message:
psmintr: out of sync (xxxx != yyyy)
and find your mouse doesn't seem to work properly.
If this happens, disable the synchronization check code by
setting the driver flags for the PS/2 mouse driver to 0x100.
Enter UserConfig by giving the ``-c'' option
at the boot prompt:
boot: -c
Then, in the UserConfig command line, type:
UserConfig> flags psm0 0x100
UserConfig> quit
My PS/2 mouse from MouseSystems doesn't seem to work.
There have been some reports that certain model of PS/2 mouse
from MouseSystems works only if it is put into the ``high resolution''
mode. Otherwise, the mouse cursor may jump to the upper-left
corner of the screen every so often.
Unfortunately there is no workaround for versions 2.0.X and
2.1.X. In versions 2.2 through 2.2.5, apply the following patch
to /sys/i386/isa/psm.c and rebuild the kernel. See the
section on [
if you've no experience with building kernels.
diff -u psm.c.orig psm.c
@@ -766,6 +766,8 @@
if (verbose >= 2)
log(LOG_DEBUG, "psm%d: SET_DEFAULTS return code:%04x\n",
unit, i);
+ set_mouse_resolution(sc->kbdc, PSMD_RES_HIGH);
+
#if 0
set_mouse_scaling(sc->kbdc); /* 1:1 scaling */
set_mouse_mode(sc->kbdc); /* stream mode */
]In versions 2.2.6 or later, specify the flags 0x04 to the PS/2
mouse driver to put the mouse into the high resolution mode.
Enter UserConfig by giving the ``-c'' option
at the boot prompt:
boot: -c
Then, in the UserConfig command line, type:
UserConfig> flags psm0 0x04
UserConfig> quit
See the previous section for another possible cause of mouse
problems.
When building an X app,
Imake.tmpl is part of the Imake package, a standard X application building tool.
Imake.tmpl, as well as several header files that are required to build X apps,
is contained in the X prog distribution. You can install this from sysinstall or
manually from the X distribution files.
How do I reverse the mouse buttons?
Run the command
How do I install a splash screen and where do I find them?
Just prior to the release of FreeBSD 3.1, a new feature was
added to allow the display of "splash" screens during
the boot messages. The splash screens currently must be a 256
color bitmap (*.BMP) or ZSoft PCX
(*.PCX) file. In addition, they must have a
resolution of 320x200 or less to work on standard VGA adapters.
If you compile VESA support into your kernel, then you can use
larger bitmaps up to 1024x768. Note that VESA support requires
the VM86 kernel option to be compiled into the
kernel. The actual VESA support can either be compiled directly
into the kernel with the VESA kernel config option
or by loading the VESA kld module during bootup.
To use a splash screen, you need to modify the startup files
that control the boot process for FreeBSD. The files for this
changed prior to the release of FreeBSD 3.2, so there are now
two ways of loading a splash screen:
- FreeBSD 3.1
The first step is to find a bitmap version of your splash
screen. Release 3.1 only supports Windows bitmap splash
screens. Once you've found your splash screen of choice
copy it to /boot/splash.bmp. Next, you need to
have a /boot/loader.rc file that contains the
following lines:
load kernel
load -t splash_image_data /boot/splash.bmp
load splash_bmp
autoboot
- FreeBSD 3.2+
In addition to adding support for PCX splash screens,
FreeBSD 3.2 includes a nicer way of configuring the boot
process. If you wish, you can use the method listed above
for FreeBSD 3.1. If you do and you want to use PCX, replace
splash_bmp with splash_pcx. If,
on the other hand, you want to use the newer boot
configuration, you need to create a
/boot/loader.rc file that contains the
following lines:
include /boot/loader.4th
start
and a /boot/loader.conf that contains the
following:
splash_bmp_load="YES"
bitmap_load="YES"
This assumes you are using /boot/splash.bmp
for your splash screen. If you'd rather use a PCX file,
copy it to /boot/splash.pcx, create a
/boot/loader.rc as instructed above, and
create a /boot/loader.conf that contains:
splash_pcx_load="YES"
bitmap_load="YES"
bitmap_name="/boot/splash.pcx"
Now all you need is a splash screen. For that you can surf
on over to the gallery at .