Requested by: the FreeBSD Japanese Documentation Project Submitted by: Mitsuru Iwasaki <iwasaki@jp.FreeBSD.ORG>
270 lines
11 KiB
Text
270 lines
11 KiB
Text
<!-- $Id: x.sgml,v 1.1 1997-11-03 08:54:00 max Exp $ -->
|
|
<!-- The FreeBSD Documentation Project -->
|
|
|
|
<sect>
|
|
<heading>The X Window System and Virtual Consoles<label id="x"></heading>
|
|
|
|
<sect1>
|
|
<heading>I want to run X, how do I go about it?</heading>
|
|
|
|
<p>The easiest way is to simply specify that you want to run X
|
|
during the installation process.
|
|
|
|
<p>Then read and follow the documentation on the <htmlurl url=
|
|
"http://www.freebsd.org/cgi/man.cgi?manpath=xfree86&query=xf86config"
|
|
name="xf86config"> tool, which assists you in configuring XFree86(tm)
|
|
for your particular graphics card/mouse/etc.
|
|
|
|
<p>You may also wish to investigate the Xaccel server, which is
|
|
available at a very reasonable price. See the section on
|
|
<ref id="xig" name="Xi Graphics"> for more details.
|
|
|
|
<sect1>
|
|
<heading>Why doesn't my mouse work with X</heading>
|
|
|
|
<p>If you are using syscons (the default console driver), you can
|
|
configure FreeBSD to support a mouse pointer on each virtual
|
|
screen. In order to avoid conflicting with X, syscons supports
|
|
a virtual device called ``<tt>/dev/sysmouse</tt>''. All mouse events
|
|
received from the real mouse device are written to the sysmouse
|
|
device, using the MouseSystems protocol. If you wish to use your
|
|
mouse on one or more virtual consoles, <bf/and/ use X, the
|
|
following configuration is recommended:
|
|
|
|
<verb>
|
|
/etc/rc.conf:
|
|
moused_type=ps/2 # or whatever your actual type is
|
|
moused_port=/dev/psm0 # or whatever your real port is
|
|
moused_flags=
|
|
|
|
/etc/XF86Config
|
|
Section Pointer
|
|
Protocol "MouseSystems"
|
|
Device "/dev/sysmouse"
|
|
.....
|
|
</verb>
|
|
|
|
<p>Some people prefer to use ``<tt>/dev/mouse</tt>'' under X. To
|
|
make this work, ``<tt>/dev/mouse</tt>'' should be linked to
|
|
<htmlurl url="http://www.freebsd.org/cgi/man.cgi?sysmouse"
|
|
name="/dev/sysmouse">:
|
|
|
|
<verb>
|
|
# cd /dev
|
|
# rm -f mouse
|
|
# ln -s sysmouse mouse
|
|
</verb>
|
|
|
|
<sect1>
|
|
<heading>X Window menus and dialog boxes don't work right!</heading>
|
|
|
|
<p>Try turning off the Num Lock key.
|
|
|
|
<p>If your Num Lock key is on by default at boot-time, you may add
|
|
the following line in the ``<tt/Keyboard/'' section of the
|
|
<tt/XF86config/ file.
|
|
|
|
<verb>
|
|
# Let the server do the NumLock processing. This should only be
|
|
# required when using pre-R6 clients
|
|
ServerNumLock
|
|
</verb>
|
|
|
|
<sect1>
|
|
<heading>What is a virtual console and how do I make more?</heading>
|
|
|
|
<p>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.
|
|
|
|
<p>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.
|
|
|
|
<p>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.
|
|
|
|
<p>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 <htmlurl
|
|
url="http://www.freebsd.org/cgi/man.cgi?ttys" name="/etc/ttys">
|
|
and add entries for ``<tt/ttyv4/'' to ``<tt/ttyvc/'' after the
|
|
comment on ``Virtual terminals'':
|
|
|
|
<verb>
|
|
# 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
|
|
</verb>
|
|
|
|
<p>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
|
|
``<tt/secure/'' to ``<tt/insecure/''.
|
|
|
|
<p><bf/IMPORTANT NOTE/ if you want to run an X server you <bf/MUST/
|
|
leave at least one virtual terminal unused (or turned off) for it
|
|
to use. That is to say that if you want to have a login
|
|
prompt pop up for all twelve of your Alt-function keys,
|
|
you're out of luck - you can only do this for eleven of them
|
|
if you also want to run an X server on the same machine.
|
|
|
|
<p>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:
|
|
|
|
<verb>
|
|
ttyvb "/usr/libexec/getty Pc" cons25 on secure
|
|
</verb>
|
|
|
|
<p>to:
|
|
|
|
<verb>
|
|
ttyvb "/usr/libexec/getty Pc" cons25 off secure
|
|
</verb>
|
|
|
|
<p>If your keyboard has only ten function keys, you would end up with:
|
|
|
|
<verb>
|
|
ttyv9 "/usr/libexec/getty Pc" cons25 off secure
|
|
ttyva "/usr/libexec/getty Pc" cons25 off secure
|
|
ttyvb "/usr/libexec/getty Pc" cons25 off secure
|
|
</verb>
|
|
|
|
<p>(You could also just delete these lines.)
|
|
|
|
<p>Once you have edited <htmlurl
|
|
url="http://www.freebsd.org/cgi/man.cgi?ttys" name="/etc/ttys">,
|
|
the next step is to make sure that you have enough virtual terminal
|
|
devices. The easiest way to do this is:
|
|
|
|
<verb>
|
|
# cd /dev
|
|
# ./MAKEDEV vty12 # For 12 devices
|
|
</verb>
|
|
|
|
<p>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
|
|
<tt/root/):
|
|
|
|
<verb>
|
|
kill -HUP 1
|
|
</verb>
|
|
|
|
<p>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.
|
|
|
|
<sect1>
|
|
<heading>How do I access the virtual consoles from X?</heading>
|
|
|
|
<p>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.
|
|
|
|
<sect1>
|
|
<heading>How do I start XDM from the <tt>/etc/ttys</tt> file ?</heading>
|
|
|
|
<p>Starting <htmlurl url=
|
|
"http://www.freebsd.org/cgi/man.cgi?manpath=xfree86&query=xdm"
|
|
name="xdm"> via <htmlurl url="http://www.freebsd.org/cgi/man.cgi?ttys"
|
|
name="/etc/ttys"> is a <bf/Bad Thing/. I don't know why this
|
|
crept into some README file.
|
|
|
|
<p>Start it from your <htmlurl
|
|
url="http://www.freebsd.org/cgi/man.cgi?rc" name="rc.local"> (or even
|
|
from a <tt/X.sh/ script in <tt>/usr/local/etc/rc.d</tt>), and be
|
|
explicit about how it has to start. If this is your last action in
|
|
<tt/rc.local/, put a ``<tt/sleep 1/'' behind, to allow <tt/xdm/ to
|
|
properly daemonize before the <tt/rc/ shell exits.
|
|
|
|
<p><tt/xdm/ should be started without any arguments (i.e., as a
|
|
daemon).
|
|
|
|
<p><bf/NOTE:/ A previous version of this FAQ told you to add the
|
|
<tt/vt/ you want X to use to the
|
|
<tt>/usr/X11R6/lib/X11/xdm/Xservers</tt> file. This is not necessary:
|
|
X will use the first free <tt/vt/ it finds.
|
|
|
|
<sect1>
|
|
<heading>When I run xconsole, I get ``Couldn't open console''.</heading>
|
|
|
|
<p>If you start <htmlurl
|
|
url="http://www.freebsd.org/cgi/man.cgi?manpath=xfree86&query=X"
|
|
name="X"> with <htmlurl
|
|
url="http://www.freebsd.org/cgi/man.cgi?manpath=xfree86&query=startx"
|
|
name="startx">, the permissions on /dev/console will <tt /not/ get
|
|
changed, resulting in things like <htmlurl
|
|
url="http://www.freebsd.org/cgi/man.cgi?manpath=xfree86&query=xterm"
|
|
name="xterm -C"> and <htmlurl url=
|
|
"http://www.freebsd.org/cgi/man.cgi?manpath=xfree86&query=xconsole"
|
|
name="xconsole"> not working.
|
|
|
|
<p>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
|
|
<htmlurl url="http://www.freebsd.org/cgi/man.cgi?fbtab" name="fbtab">
|
|
file exists to solve such problems.
|
|
|
|
<p>In a nutshell, make sure an uncommented line of the form
|
|
|
|
<verb>
|
|
/dev/ttyv0 0600 /dev/console
|
|
</verb>
|
|
|
|
<p>is in <htmlurl url="http://www.freebsd.org/cgi/man.cgi?fbtab(5)"
|
|
name="/etc/fbtab"> and it will ensure that whomever logs in on
|
|
<tt>/dev/ttyv0</tt> will own the console.
|
|
|
|
<sect1>
|
|
<heading>My PS/2 mouse doesn't behave properly under X.</heading>
|
|
|
|
<p>Your mouse and the mouse driver have somewhat become out of
|
|
synchronization. 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.
|
|
|
|
<verb>
|
|
options PSM_CHECKSYNC
|
|
</verb>
|
|
|
|
<p>See the section on <ref id="make-kernel" name="building a kernel">
|
|
if you've no experience with building kernels.
|
|
|
|
<p>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.
|
|
|
|
<p>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.
|
|
|
|
</sect>
|
|
|