1. Trang chủ
  2. » Công Nghệ Thông Tin

x window system

54 363 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 54
Dung lượng 0,93 MB

Nội dung

7 X Window System CERTIFICATION OBJECTIVES 7.01 X Server 7.02 X Clients 7.03 Window Managers 7.04 Remote Display of X Apps ✓ Two-Minute Drill Q&A Self Test CertPrs8 / RHCE Red Hat Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 Blind Folio 7:375 CertPrs8 / RHCE Red Hat Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 Blind Folio 7:375 D:\omh\CertPrs8\485-1\ch07.vp Wednesday, September 18, 2002 9:55:57 AM Color profile: Generic CMYK printer profile Composite Default screen O ne of the most important aspects of getting a Red Hat Linux system up and running is configuring the user interface. For most nonadministrative users, this means configuring the X Window interface. The X Window System is the Linux graphical user interface (GUI). While the GUI plays an integral part of other operating systems such as Microsoft Windows, the X Window System on Linux is essentially just another application. Many administrators don’t even bother with the GUI; the command line interface is enough for most administrative purposes. However, regular users on a Linux workstation become more productive with the GUI and the multitude of X Window–based applications. If you are helping users migrate from Microsoft Windows to Linux, the X Window System allows you to provide a less intimidating environment. Some Linux systems simply don’t need the X Window System. For example, computers that are used as dedicated DHCP, DNS, or NFS servers generally don’t serve as workstations for anyone and therefore don’t need any sort of GUI. Many Linux gurus have a negative bias toward the GUI. While Red Hat and others have developed some helpful GUI tools, they are almost always “front ends,” or programs that customize one or more commands at the command line interface. But if you’re administering a network of Red Hat Linux computers, you’ll need to know how to administer the X Window System, a skill that requires a basic understanding of the available desktops and window managers. You need to know how to configure X Window, and how to configure your Linux computer for a specific graphical logon manager. CERTIFICATION OBJECTIVE 7.01 X Server The X Window System is designed as a flexible and powerful client/server-based system. In order to configure and troubleshoot the X Window interface, it is important you understand the client/server nature of the X Window System. As you might have guessed from the terms client and server, the X Window System is designed to work in a networked environment. This does not mean your Linux CertPrs8 / RHCE Red Hat Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 376 Chapter 7: X Window System D:\omh\CertPrs8\485-1\ch07.vp Wednesday, September 18, 2002 9:55:57 AM Color profile: Generic CMYK printer profile Composite Default screen system must be connected to a network in order to use X Window applications; the X Window System will work on a stand-alone system as well as a networked system. If your system is part of a network, not only can you run X applications on your system, you can employ the powerful network capabilities of the X Window System to run X applications on other computers on your network; graphical displays from those applications are sent to your monitor. In fact, X Window applications handle this task so well that, providing the network is fast enough, you really can’t tell from a performance point of view which applications are running locally and which applications are running remotely. Different Meanings for Client and Server X Window clients and servers use a different paradigm from the usual client/server relation. The X server controls the graphics on the local computer. The X server draws images on your screen and takes input from your keyboard and mouse. In contrast, X clients are local or remote applications such as xclock that you can run on an X server. X clients can run locally or remotely. Local X clients run on your workstation; remote X clients run on the local X server. When you run a remote X Window client application, you start the program on a different computer and send its output to use the X server on your local computer. Figure 7-1 shows a local X server with one local X client and one remote one. Before we can talk about running X client applications, we need to look first at getting an X server running on our system. Supported Hardware Getting the X Window System configured and working can be one of the most difficult tasks in setting up a Linux system. Fortunately, Red Hat Linux comes with tools and drivers that make this job relatively painless and easy. One of the most important steps you can take to ensure that you wind up with a working X Window configuration is selecting the proper hardware. Ironically, the latest and greatest video card or monitor is not always the best option. Many video cards and monitors include proprietary software; it may take some time before Linux developers are able to “reverse-engineer” a video card or a monitor. For the latest official information, check the Red Hat hardware compatibility list. X Server 377 CertPrs8 / RHCE Red Hat Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 D:\omh\CertPrs8\485-1\ch07.vp Wednesday, September 18, 2002 9:55:57 AM Color profile: Generic CMYK printer profile Composite Default screen 378 Chapter 7: X Window System CertPrs8 / RHCE Red Hat Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 Despite these limitations, Linux provides world-class support for graphics. Movie studios such as Dreamworks create the latest animated movies and special effects using Linux workstations. Even Disney has declared its intent to make movies using Linux. If you need more intensive graphics support, you may want to consider some commercial alternatives to XFree86. Two are Metro-X from Metro Link (www.metrolink.com) and Accelerated-X from X-Inside (www.xinside.com). Hardware: X Server Selection The X Window server program shipped with Red Hat Linux is an open-source X server program called XFree86. The XFree86 Server included with Red Hat Linux has support for hundreds of video cards and monitors. The best place to check to see whether your video card and monitor are supported is the Red Hat Hardware Compatibility List, currently available from http://www.redhat.com/support/hardware/ index.html. Alternatively, use the rpm -q XFree86 command to check your version of the XFree86 server. Navigate to the XFree86 Web site at www.xfree86.org to find the latest support information. FIGURE 7-1 You can run X Window clients from the local computer and/or remote computers on the same network. D:\omh\CertPrs8\485-1\ch07.vp Wednesday, September 18, 2002 9:55:57 AM Color profile: Generic CMYK printer profile Composite Default screen As of this writing, the latest version of Red Hat Linux will include only the XFree86 (4.2.x) server. There may be a few video cards that require the older XFree86 server, version 3.3.x. Hopefully these cases are now rare. If you find that you are unlucky in this way and cannot upgrade your video card, first try a standard VGA or VESA configuration. As a last resort, download the older XFree86 Server from www.xfree86.org. Servers and XFree86 The latest version of XFree86 includes modules for different video servers. Unlike the XFree86 3.x series, this one doesn’t require you to install different packages for each video server. Hardware support for most video servers is already there. If you learn of updates, changes are easy. Just add the module, and then point to it in the /etc/X11/XF86Config configuration file. If you are using an unsupported video card, support is also included for generic VGA devices. Most video cards and monitors will work with these X servers. Several recent versions of Red Hat Linux included an /etc/X11/XF86Config-4 file for the XFree86 version 4 server. As of this writing, Red Hat is removing support for XFree86 version 3.x servers; starting with Red Hat Linux 8.0, the Red Hat Linux X configuration file should be /etc/X11/XF86Config. Tools for X Configuration The preferred Red Hat configuration tool for XFree86 is redhat-config-xfree86. The configuration tool that ships with XFree86 is xf86config. Either tool can be used to configure your graphics environment, but you really need to practice using redhat- config-xfree86. You can install the X Window System during or after the Linux installation process. You can use redhat-config-xfree86 to reconfigure X Window at any time. The default Red Hat installation program runs in graphics mode if it detects a graphics driver. As discussed in Chapter 2, when configuring your graphics display, get the best information that you can on the make, model, chipset (clockchip), version, and video memory of your graphics card. You’ll also need the manufacturer, model, frequency range, and allowable resolutions for your monitor. X Server 379 CertPrs8 / RHCE Red Hat Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 D:\omh\CertPrs8\485-1\ch07.vp Wednesday, September 18, 2002 9:55:58 AM Color profile: Generic CMYK printer profile Composite Default screen 380 Chapter 7: X Window System CertPrs8 / RHCE Red Hat Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 redhat-config-xfree86 The redhat-config-xfree86 program is a stand-alone program that you can run at any time from the command line. The basic routines within redhat-config-xfree86 are also used by the Red Hat installation program if you choose to install and configure the X Window System at that time. The redhat-config-xfree86 program is a character-based menu-driven interface that helps you to configure your video hardware. It automatically probes your video card and tries to select the appropriate X server image for it. If redhat-config-xfree86 cannot determine the make and model of your graphics card, it allows you to select them from the list of supported video cards. If for some reason, redhat-config-xfree86 does not work, the surest alternative is the text-based xf86config utility. Running redhat-config-xfree86 Starting redhat-config-xfree86 is easy. Just type redhat-config-xfree86 at a command line interface. It provides a simple GUI, even if you start it from a regular text console. When you start redhat-config-xfree86, you’ll see the Display Settings window similar to that shown in Figure 7-2. You can use the arrow or PAGE DOWN keys to scroll through the welcome message. If redhat-config-xfree86 is successful at identifying your hardware, you’ll see it listed under the Display tab. In the case shown in Figure 7-2, nothing was detected; it’s an “Unknown monitor with Unknown video card.” You can now set the default resolution and color depth under the Display tab. redhat-config-xfree86 replaces Xconfigurator. It should theoretically work fine even from a text console screen. However, as of this writing, there are still problems associated with redhat-config-xfree86 and a few video systems. Using xf86config is still a viable alternative. Just remember to save the settings you create to /etc/X11/XF86Config. Next, you can configure the video hardware from a list. Click the Advanced tab, as shown in Figure 7-3. You’ll see options to configure your monitor and video card. Click the Configure button in the Video Card section. This should bring up the Video Card Settings dialog box shown in Figure 7-4. If the Probe Videocard option is active, redhat-config- D:\omh\CertPrs8\485-1\ch07.vp Wednesday, September 18, 2002 9:55:58 AM Color profile: Generic CMYK printer profile Composite Default screen X Server 381 CertPrs8 / RHCE Red Hat Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 xfree86 may be able to configure your card for you. Otherwise, search through the list of video cards. If you do not see your graphics card here, it may not be supported. In this case, you have several options: ■ Select a video card similar to your model. Alternatively, you may find a generic server such as VESA that is compatible with your video card. Test, and if necessary edit the /etc/X11/XF86Config file to complete your changes. ■ Check the Web for others who are running the X Window System with the same type of hardware. A useful database is available by searching through newsgroup messages at groups.google.com. ■ Use the Unsupported VGA-compatible X Window server. ■ Select one of the more generic cards. When you click the Custom Memory Size option, you can select the amount of memory associated with your card. FIGURE 7-2 redhat-config- xfree86 Display Settings, Display tab D:\omh\CertPrs8\485-1\ch07.vp Wednesday, September 18, 2002 9:55:58 AM Color profile: Generic CMYK printer profile Composite Default screen 382 Chapter 7: X Window System CertPrs8 / RHCE Red Hat Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 You can also add one of the many configuration options associated with /etc/ X11/XF86Config. For examples, see www.xfree86.org. ■ Go to http://www.xfree86.org and download the latest drivers. Once your selections are complete, click OK. This returns you to the Advanced tab. If your video card is so capable, you’ll be able to check the Enable Hardware 3D Acceleration option. Next, configure the Monitor. Click the Configure button in the Monitor section of the Advanced tab. You should see something like the dialog box shown in Figure 7-5. Move on to the monitor selection screen. If the Probe Monitor button is active, redhat-config-xfree86 may be able to probe your hardware. Otherwise, select the option that most closely matches your monitor. If you don’t see the make and model for your monitor, select one of the Generic monitors. You can then customize the Horizontal and Vertical settings per your monitor’s documentation. FIGURE 7-3 redhat-config- xfree86 Display Settings, Advanced tab D:\omh\CertPrs8\485-1\ch07.vp Wednesday, September 18, 2002 9:55:58 AM Color profile: Generic CMYK printer profile Composite Default screen X Server 383 CertPrs8 / RHCE Red Hat Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 FIGURE 7-4 redhat-config- xfree86 allows you to choose a card. FIGURE 7-5 redhat-config- xfree86 allows you to choose a monitor. D:\omh\CertPrs8\485-1\ch07.vp Wednesday, September 18, 2002 9:55:58 AM Color profile: Generic CMYK printer profile Composite Default screen CertPrs8 / RHCE Red Hat Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 Don’t select Probe Monitor if you have an older monitor. And don’t configure a horizontal sync or vertical refresh rate beyond the capability of your monitor. Otherwise, your video card may send signals that exceed the capability of your monitor. Especially on a laptop computer, the consequences can be rather costly. Laptops Configuring the X Window System to run on a laptop can be more challenging than configuring it to run on a desktop system. If you are planning to install Red Hat Linux on a laptop, a good source for tips and additional information is the Linux on Laptops Web site at www.linux-laptop.net. Using a Two-Button Mouse The X Window System was designed to work with a three-button mouse. Many PCs come with only a two-button mouse. With the mouseconfig utility, you can 384 Chapter 7: X Window System CertPrs8 / RHCE Red Hat Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 Configuring the X Window System Configuring the X Window System is one of the few places in the process of setting up a Linux system in which the choices you make could potentially damage your hardware. This fact pertains to the refresh rate for your monitor, which is the rate at which your graphics card redraws images on your screen. The refresh rate is expressed in terms of Hertz (Hz). A refresh rate of 60 Hz means that an image is redrawn 60 times in one second. Computer monitors have both vertical and a horizontal refresh rates. Some monitors, known as multisync monitors, support multiple vertical and horizontal refresh rates. In either case, refresh rates vary from monitor to monitor. When you specify the type of monitor you are using, what you are really doing is telling the video card what frequencies it can use to drive the monitor. If the monitor you configure does not match the type of hardware you actually have, it is possible for your video card to overtax your monitor, resulting in a blown monitor. This is a special concern with laptop computers. Laptop display screens are expensive; it is often more cost-effective to replace a laptop computer instead of replacing just the laptop display screen. FROM THE CLASSROOM D:\omh\CertPrs8\485-1\ch07.vp Wednesday, September 18, 2002 9:55:58 AM Color profile: Generic CMYK printer profile Composite Default screen [...]... /usr /X1 1R6/bin /X lrwxrwxrwx 1 root root XFree86 7 Jul 30 07:33 /usr /X1 1R6/bin /X ->> redhat-config-xfree86 normally writes its changes to /etc /X1 1/XF86Config When the XFree86 X server starts, it reads this file EXERCISE 7-1 X Server In this exercise, you will start your X server without a window manager You’ll then start an xterm X client application Some of the commands used in this exercise are D:\omh\CertPrs8\485-1\ch07.vp... /usr /X1 1R6/bin/startx: userclientrc=$HOME/.xinitrc sysclientrc=/etc /X1 1/xinit/xinitrc When you start the X Window System with the startx command, the xinit program looks for a file to run named xinitrc in your home directory If the startx command cannot find $HOME/.xinitrc, it will run the file /etc /X1 1/xinit/xinitrc This file, in turn, will run either the file $HOME /.Xclients or, if that file doesn’t exist, /etc /X1 1/xinit/Xclients... Linux Study Guide / Jang / 222485-1 / Chapter 7 X Window System EXERCISE 7-2 Multiple X Servers In this exercise, you will start two different X servers If the X Window System is not running, you can skip steps 1 and 3 1 If the X Window System is running, change to a text console by pressing CTRL-ALT-F1 2 If you see a login prompt, log in at the text console as root Otherwise, press CTRL-C to stop X Window. .. KDE display manager EXERCISE 7-4 startx In this exercise, we will start the X Window System using startx with a customized xinitrc file 1 If the X Window System is running, change to a text console by pressing CTRL-ALT-F1 2 If you see a login prompt, log in at the text console as root Otherwise, press CTRL-C to stop X Window 3 If you logged in at the text console, stop the current X Window server by typing... The X Window System needs fonts Linux manages fonts through the X Font Server Red Hat Linux manages the X Font Server with the xfs service script In most configurations, X Window needs the X Font Server before it can start Many different fonts are normally available in the /usr /X1 R6/lib /X1 1/fonts directory The X Font Server can be an Achilles’ heel for X Window A number of things can go wrong with xfs:... Linux GUI Otherwise, Red Hat will boot with a text-based console screen, and you can start the X Window System manually by using the startx command startx You use the startx command to start the X Window interface manually from a command line prompt Simply type startx at the Linux command prompt This starts XFree86 and switches your display into graphics mode If you run startx and the X Window System. .. Certified Engineer Linux Study Guide / Jang / 222485-1 / Chapter 7 X Window System 4 Make sure you’re in your home directory Use your favorite text editor to create a xinitrc file If you’re not sure what to do, use the sample file shown in Figure 7-10 5 Make sure the xinitrc file is executable by typing this: chmod a +x xinitrc 6 Start the X Window System by typing this: startx Your X Window session should... Linux Study Guide / Jang / 222485-1 / Chapter 7 X Window System FIGURE 7-6 X Window configuration files The default server is linked to the X command X is called up by the startx command Both of these commands are located in the /usr /X1 1R6/bin directory Examine the long listing for the X command You’ll see that it’s linked to the version 4 all-in-one server package, XFree86: # ls -l /usr /X1 1R6/bin /X. .. Linux Study Guide / Jang / 222485-1 / Chapter 7 X Server 387 covered later in the chapter If the X Window System is not running, you can skip steps 1 and 3 1 If the X Window System is running, change to a text console by pressing CTRL-ALT-F1 2 If you see a login prompt, log in at the text console as root Otherwise, press CTRL-C to stop X Window 3 If you logged in at the text console, stop the current X. .. DISPLAY=localhost:0.0 Then you can export that variable with the export DISPLAY command TABLE 7-4 Description xhost Show current security settings xhost + Disable security; allow connections from any system xhost - Enable security xhost + apps.xyz.com Allow connection from apps.xyz.com xhost -apps.xyz.com Using xhost to Secure Your X Server Command Disable connections from apps.xyz.com D:\omh\CertPrs8\485-1\ch07.vp . /usr /X1 1R6/bin /X ->> XFree86 redhat-config-xfree86 normally writes its changes to /etc /X1 1/XF86Config. When the XFree86 X server starts, it reads this file. EXERCISE 7-1 X Server In this exercise,. use X Window applications; the X Window System will work on a stand-alone system as well as a networked system. If your system is part of a network, not only can you run X applications on your system, you. /usr /X1 1R6/bin directory. Examine the long listing for the X command. You’ll see that it’s linked to the version 4 all-in-one server package, XFree86: # ls -l /usr /X1 1R6/bin /X lrwxrwxrwx 1 root

Ngày đăng: 05/07/2014, 21:27

Xem thêm

TỪ KHÓA LIÊN QUAN

w