Movatterモバイル変換


[0]ホーム

URL:


Wayback Machine
323 captures
18 Jan 2000 - 10 Jul 2025
AprMAYJun
Previous capture09Next capture
201520162017
success
fail
COLLECTED BY
Organization:Internet Archive
The Internet Archive discovers and captures web pages through many different web crawls.At any given time several distinct crawls are running, some for months, and some every day or longer.View the web archive through theWayback Machine.
Content crawled via theWayback Machine Live Proxy mostly by the Save Page Now feature on web.archive.org.

Liveweb proxy is a component of Internet Archive?s wayback machine project. The liveweb proxy captures the content of a web page in real time, archives it into a ARC or WARC file and returns the ARC/WARC record back to the wayback machine to process. The recorded ARC/WARC file becomes part of the wayback machine in due course of time.
TIMESTAMPS
loading
The Wayback Machine - https://web.archive.org/web/20160509152050/http://www.openbsd.org/faq/faq11.html

[FAQ Index]



Introduction to X

The X Window System (sometimes just called "X", other times, incorrectlycalled "X Windows") is the environment which provides graphics servicesto OpenBSD and other Unix-based systems.However, by itself, X provides very little: one also must have a windowmanager to present a user interface.Most of the "personality" one will feel from X will be due to thewindow manager, rather than X itself.OpenBSD ships with thecwm(1),fvwm(1)andtwm(1)window managers, although you may wish to use any of the others that areinports and packages.Search for "window manager" for a list of the many available options.

X is considered a "client-server" structured protocol, however theterminology is sometimes confusing.The computer with the graphics on the screen is the X server.The application which tells the X server what to put on its screenis the X client, even though it may be a much more powerful computerin a data center.This model can be used to have large, processor-intensive applications(X clients) running on a very powerful machine, using the X serverrunning on a small, low power machine on your desk for their userinterface.

It is possible to run X clients on a system without any graphical support.For example, one could have an application (the X client) running on anARM system, displaying its output on a SPARC's graphical display (the Xserver).Since X is a well-defined, cross-platform protocol, it is even possibleto have an X application running on (for example) a Linux machineuse an OpenBSD machine for its display.

The client and server can also be running on the same machine, and formost of this section, that will be the assumption.

Configuring X

Good news: In the vast majority of hardware in most platforms, X requiresno configuration at all.It Just Works.

The details of manual X configuration varies considerably from platformto platform.In all cases, there will be instructions and other platform-specificinformation in/usr/X11R6/README on the installed system.

Several platforms require thexf86(4)X aperture driver, which provides access to the memory and I/Oports of a VGA board and the PCI configuration registers requiredby the X servers.This driver must be enabled before it is used, either by answering"yes" to this question during install:

Do you expect to run the X window System [no]
or by changing the value ofmachdep.allowaperture to theappropriate non-zero value in/etc/sysctl.conf for yourplatform and rebooting the machine (this sysctl cannot be changedafter boot has been completed for security reasons).There are security implications to this, so do not do this if youdo not need it.

Starting X

There are two common ways to run X:

On Demand:

Log in to a console as normal, then runstartx(1).

Boot directly into X:

This is done usingxdm(1),the X Display Manager.xdm(1) is started as root, normally byrc(8),and presents a login prompt.Upon successful login, it starts an X session for that user.If or when that X session should be terminated (including by hittingCTRL-ALT-Backspace), xdm(1) will return, prompting the user to log in again.For this reason, do NOT attempt to start xdm(1) from/etc/rc.conf.local until you have verified X works as you wish,or your machine may become very difficult to manage!(worst case: boot single user, as if youlostyour password, and edit out thexdm_flags line in your/etc/rc.conf.local file.)

On some platforms, you will need to disable the consolegetty(8)to use xdm(1). This is not needed on amd64, i386, macppc or zaurus.

X won't start, I get lots of error messages

A common cause for X problems is the machdep.allowaperturesysctl(8)setting.Since this defaults to being disabled on OpenBSD, this is a fairly likelycause of the problem.

You need to edit/etc/sysctl.conf and setmachdep.allowaperture=2 (or1, depending upon your platform).This will allow X to access the aperture driver,xf86(4),upon the next reboot.It can not be made available after boot.This can also be set during install if you answer "Y" when you are askedwhether you expect to run the X Window System.

OpenBSD requires that the aperture driver be activated on amd64, i386,macppc and sparc64 platforms to control access to the video boards.Other platforms use a safer way to handle the video system, and do notneed this (and do not have it in their kernel).If you do not anticipate using X on your system, it is recommended thatyou not enable the aperture driver.

For more information about configuring and using X on your platform, seethe/usr/X11R6/README file on your installed system.

Customizing X

OpenBSD's default X environment is fully functional, but you may wish tocustomize it.You may wish to change the background pattern or color, or you may wishto change the window manager (the program that most defines your Xenvironment), or change the applications that are started when X starts.

The default window manager in OpenBSD isfvwm(1).Fvwm is a good, general purpose window manager, but it is hardly youronly choice; it isn't even the only window manager included with OpenBSD(seecwm(1)andtwm(1)).A large number of window managers are also available throughpackages and ports.

Similar to thesystem startup script,X has a process it goes through to set up the user environment.More accurately, it has more than one process; which process is useddepends on how youstart X.Understanding how X starts will help you understand how to customizeyour work environment the way you wish it to be.

Note that you can customize the environment on both a system-wide anduser level.It is probably best to do user level changes rather than to change thesystem defaults, as the user scripts are stored in the user's homedirectory, so you will have less merging of files to do when upgradingto a new version of OpenBSD.

startx(1) startup

startx(1) looks for the file.xinitrc in the user's home directory..xinitrc is usually a shell script, which can start as manyX "client" (applications that use X) programs as desired.When this script exits, the X server shuts down.Generally, most of the programs run by this script should run in thebackground, though the last one should run in the foreground (typicallythe window manager); when it exits, the script will exit, and X will beshutdown.

In the simplest case, this can be as little as just the name of thewindow manager you wish to invoke:

cwm
Or you can get a little more fancy:
xconsole -geometry -0+0 -fn 5x7 &oclock -geometry 75x75-0-0 &xsetroot -solid grey &cwm
That will start thexconsole(1),which provides a copy of any text that the kernel would have sent to theconsole (which is now covered by the graphical screen), an analog clock,oclock(1),and sets the background to a solid grey background withxsetroot(1),all before invoking thecwm(1)window manager.Note that only the window manager is not "backgrounded" with an "&"character.This means that X will stay running until cwm(1) exits.

If a user's home directory does not have a.xinitrc file in it,the system's/etc/X11/xinit/xinitrc file is used.This file can provide you some additional ideas for your.xinitrc script.

xdm(1) startup

xdm(1)is usually started by thesystem startupscripts, but for testing purposes (recommended, until you know yourhave your X config right!), it can be run as root.

xdm(1) has a lot of other functionality that won't be touched on here,but for our purposes, xdm will present the user with a login screen, getand verify a user name and password, and then give the user their Xenvironment.When X shuts down, either deliberately or accidentally, xdm will startit back up again.This is why you want to make sure X is configured properly before usingxdm(1), and certainly before having xdm(1) start at boot. Otherwise, youmay have some difficulty getting control of the machine.

When xdm(1) starts, it runs the/etc/X11/xdm/Xsession, whichwill check to see if the user has a.xsession file in theirhome directory.So, if you wish to change your default window manager, simply invoke it(and maybe other things) in.xsession.Again, any programs you want started with X (for example, maybe threexterms) can be placed here, but all should be backgrounded exceptfor your window manager, as again, when that exits, your X sessionwill be ended.In this case, xdm(1) will restart X and bring you back to a loginscreen.

Trying a new window manager

You can invoke a particular window manager when you load X withoutaltering any defaults like this:
$startx /usr/local/bin/fluxbox
Several window managers (including cwm(1) and fvwm(1)) offer the abilityto change window managers on the fly, without restarting X or any ofyour applications.Your new window manager replaces your old one; exiting the newly-loadedwindow manager terminates X. It does not return you back to yourprevious window manager.fvwm(1) allows you to start a different window manager by left clickingon the background ("root window"), chose "(Re)Start" and then pick yourpreferred window manager.However, note that you will need to add your alternative window managersto your.fvwmrc file (the system-wide default is/usr/X11R6/lib/X11/fvwm/.fvwmrc).cwm(1) allows you to invoke another window manager by hitting Ctrl-Alt-wand typing in the manager you wish to switch to.

Once you have found a window manager you like, you can set it as the finalprogram run by your startup scripts as described above.


[8]ページ先頭

©2009-2025 Movatter.jp