Home
Username:
Password:
Unix System Administration Essentials Tutorials

Configuring X Windows / Troubleshooting X




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

Let's also take a moment to talk about troubleshooting X Windows. X Org or Xorg as you may call it, uses several configuration files and errors in any one of those configuration files could cause X Windows not to start at all or to behave erratically. Now, most of the files that you're going to be looking for that help configure X are in the /etc/ X 11 Folder. Now, one primary configuration file that you'll most likely be looking at more than any of them is the xorg.conf, X Org.Conf file. And you can actually go and edit that with a simple text editor. You can also regenerate that based upon system settings that have changed, such as you've changed hardware such as mouse, keyboard, video. You can recreate that file by running a simple utility, X Configure. There's another file as well that you might want to look at and we'll take a look at it as well and that's the /etc/rc.conf and we've seen that file before throughout. That's a very important file for helping us configure UNIX in general. And it has a couple of entries in there that you may want to pay attention to if you're having problems with X. Again, hardware configuration can contribute to issues in X so you don't want to limit your troubleshooting to just playing with these configuration files. You may have to go back and set hardware options such as resolution, refresh rate and so forth on your video or you may need to have another mouse driver or keyboard mapping in the system as well to help X run right. So let's go ahead and take a look at these files really quick. They show us how X is configured. We're in our Free BSD virtual machine and a couple of files I want to take a look at with you are the X.Config File, the Xorg.Config File rather and rc.conf and I also want to show you how to regenerate a new Xorg.Config File. What we want to do first is let's go Less on /etc/x11/xorg.conf and actually let's type this out a little bit differently. Big X. As you know, UNIX is very case sensitive. So we've got our file here and this is the xorg.conf file and it's broken up into sections and each section has a section header and a section footer and then an identifier, so it's a server layout files, modules, so forth. It's actually very easy to configure once you figure out how it's laid out. And we'll talk about the different input devices that you have to specify and pass for files. Sometimes you may have to change those depending upon if you install something in a different directory. Input devices basically tell you what keyboard and mouse you have and it'll define the protocol and which driver it uses so if you change drivers for a keyboard or mouse or a monitor, you may have to specify that here. There's some other different options too such as configuring your screens and displays and if you decide to play with this file, it'd be a good idea to read up on it and kind of figure out what each section does and what different parameters you're allowed to put in there. But essentially it's a very easy file to configure and view. Let's take a look at rc.conf for a second and there's two entries in here I want to point out to you. The Hal D Underscore Enabled equals yes and the D Bus Underscore Enable equals yes and those two entries actually can prevent, if they're not configured right and one of them is not, intentionally by the way, if those entries are not configured correctly, then you may not get your mouse and keyboard. Now, here we see a problem because it's Hal D Underscore Enabled and it should be Enable; no d there. So that would cause the X Windows to probably behave erratically. The other issue is if you don't see those two lines in there at all, if they're not in there at all you'd have to go in there with a text editor and add them in there: Hal D Underscore Enable equals yes and D Bus Underscore Enable equals yes. Those two entries need to be in there, at least in Free BSD UNIX and other forms of UNIX and Linux as well in order to get X Windows to work correctly. So now in order to fix something we'd have to go in and delete that D out of Enabled, with the Hal D line there and that might fix some problems. So keep an eye on these two entries for correct syntax and spelling and to make sure that even exist in there at all. Now, another thing I want to show you basically is how to generate a new xorg.conf file and what we want to do is go ahead and run a command called X Dash Configure and what X Dash Configure will do after you've replaced, after you've changed out hardware such as video card or a keyboard and mouse, Rewrite X Dash Configure is a good way to make sure those changes are picked up and put in the xorg.conf file, the configuration file. So we run X Dash Configure. It's going to generate us a new file and at the bottom you can see here that it told us that we have a new file. It is /root /xorg.conf.new. And if we test it, then we basically would test this and if it works, then we'd go ahead and take the file and rename it to xorg.conf and put it in the X11 directory. So in order to test this, we would say X Dash Config /root /xorg.conf.new and you might also want to add the retro switch on here to take into account earlier versions of X if you have them on your system or older hardware and that's just my opinion, of course. You don't have to run it with that. So if we run it, we're going to get a little bit of configuration there and we've got our video there. So that's what you want to get to test that file. We've got our mouse pointer and we've got just a gray screen that shows us that X is working. So in order to terminate that, we can switch back to our BTTY 1 Terminal and do a Control C on that. And so now we know that's working. Now of course we would just have to copy that xorg.conf.new to /etc/X11/xorg.conf. We would have that file in there now. So now we've looked at our xorg.conf file, we've checked our rc.conf file, we've made a couple of changes and now we have our X Windows up and running again. So any of those actions and looking at hardware would help you troubleshoot a faulty X Windows configuration and make sure it's up and running.

Tutorial Information

Course: Unix System Administration Essentials
Author: Bobby Rogers
SKU: 34153
ISBN: 1-936334-45-3
Release Date: 2010-08-12
Duration: 4.5 hrs / 57 lessons
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available