Before installing X.Org you have to configure a few important variables, namely VIDEO_CARDS and INPUT_DEVICES. These are alias for the x11-drivers/xf86-video-* and x11-drivers/xf86-input-* packages and, in the case of x11-base/xorg-server, act as “pull in” USE-flags. So setting these variables is a good idea as it will make the emerge include your drivers. If you copied the complete make.conf from the Installation section you should be all set since it has VIDEO_CARDS and INPUT_DEVICES set properly as well as all USE-flags required by X.Org/X11 enabled.
First emerge xorg to get the basic system up and running. Next emerge x11 to get the useful stuff. In order to be able to use the touchpad and the keyboard it is a good idea to install HAL (Hardware Abstraction Layer)1). Since you probably did at least one emerge world with the hal USE-flag enabled, you only need to make sure the HAL daemon starts at start up.
emerge -av xorg-server emerge -av xorg-x11 rc-update add hald default
Now reboot the computer before configuring the X.Org server to allow the HAL daemon to start. Now you can run the automatic X.Org configuration, which does a pretty good job by default. In my case it found the correct resolution and once the HAL daemon was running it had no issues with the keyboard, touchpad or external USB mouse.
Xorg -configure
Make sure you pay attention to the output once it is done and make sure it encountered no errors. Now you can test the default configuration and if all works fine, start the X window system.
X -config /root/xorg.conf.new startx
Right out of the box X.Org has a few issues.
Failed to initialize GEM. Falling back to classic.
Warning: Cannot convert string "nil2" to type FontStruct
This due to ISO8859 font types that are needed for my locale but not yet installed. The solution is emerge -av font-misc-misc, which will emerge the necessary fonts and makes the error disappear.
Setting up an external monitor is less of a problem today than it was a few years back. For starters you can use Xorg RandR and what is even better, when you use the netbook's nVidia graphics card, the provided nvidia-settings provide a nice, Windows-like GUI for setting stuff up. However, you need to pay attention, because the ASUS's Intel card can use only the VGA port and not the HDMI port. The nVidia card can use both, the HDMI and VGA ports. If you want to set up the monitor by hand, here are the relevant parts of the xorg.conf file:
Section "ServerLayout" [..] Screen 0 "Screen0" 0 0 Screen 1 "Screen1" RightOf "Screen0" [..] EndSection [..] Section "Monitor" Identifier "Monitor0" VendorName "ASUS" ModelName "N10J-A2 Screen" HorizSync 28-96 Vertrefresh 43-60 Option "DPMS" EndSection Section "Monitor" Identifier "Monitor1" VendorName "ViewSonic" ModelName "VX2435WM" HorizSync 24-82 Vertrefresh 50-85 Option "DPMS" EndSection Section "Device" Identifier "Card0" Driver "nvidia" VendorName "nVidia Corporation" BoardName "GeForce 9300M GS" BusID "PCI:3:0:0" Option "MonitorLayout" "LVDS,DFP" # HDMI connection #Option "MonitorLayout" "LVDS,CRT" # VGA connection EndSection [..] Section "Device" Identifier "Device1" Driver "nvidia" # or "intel" VendorName "NVIDIA Corporation" BoardName "GeForce 9300M GS" BusID "PCI:3:0:0" Screen 1 EndSection [..] Section "Screen" Identifier "Screen1" Device "Device1" Monitor "Monitor1" DefaultDepth 24 Option "metamodes" "DFP-1: 1920x1200_60 +0+0" # HDMI connection #Option "metamodes" "CRT-1: 1920x1200_60 +0+0" # VGA connection SubSection "Display" Depth 24 EndSubSection EndSection
The nVidia driver is programmed to obey the received EDID information from the monitor no matter what. However, sometimes, like in my monitor's case, this information is wrong - this can manifest itself by low default resolutions, the driver's inability to find your monitor's native resolution, or in a blurry/fuzzy image. I experienced the last symptom, the reason for which probably was that my monitor's EDID identified it as an HDTV and the nVidia driver, in an attempt to make the image clearer for the “TV”, made the image worse2) Googling this yields several solution attempts, most revolving around a custom EDID.
In order to get a good EDID connect your monitor to the netbook via the VGA cable (through it the image is crystal clear), dump the current EDID via the nvidia-settings tool, and save it on your drive. You can tell X-window - and the nVidia driver - to use a custom driver through the Option “CustomEDID” ”<monitor>:/path/to/edid”. The <monitor> part is either CRT-0/CRT-1 (analog connections), DFP-0/DFP-1 (digital connections), or TV-0/TV-1. For the netbook your native screen is at DFP-0 and anything you connect through HDMI will be DFP-1. Anything connected through the VGA port will be CRT-0. Unfortunately, and this had me stumped for a while, the location of the option within xorg.conf is extremely important! The option needs to be located in the very first Device section, but not the Device-Card0 section, but the Device-Device0 section. So an xorg.conf with a custom EDID would look like this:
Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce 9300M GS" BusID "PCI:3:0:0" Screen 0 Option "CustomEDID" "DFP-1:/etc/X11/viewsonic.edid" EndSection
When you start the X-window system with startx – -logverbose 6, the generated log located at /var/log/Xorg.0.log will tell you if the custom EDID has been found and is in use.
(EE) NVIDIA(0): Failed to initialize the GLX module; please check in your X (EE) NVIDIA(0): log file that the GLX module has been loaded in your X (EE) NVIDIA(0): server, and that the module is the NVIDIA GLX module. If (EE) NVIDIA(0): you continue to encounter problems, Please try (EE) NVIDIA(0): reinstalling the NVIDIA driver.
The reason is that X.Org is trying to use the “wrong” glx module instead of the nVidia one. Run eselect opengl set nvidia to fix the problem.
The Gentoo Wiki articles on HAL and X.Org can provide more information if you need it. Also a good resource is The X Server Configuration HOWTO.
USE-flag, hal - again, if you just copied the USE-flags from the Installation section, you are good.1200p and not 1920×1200, which is what my XP-machine runs it at.