Sunday, August 31, 2008

VMware in Ubuntu: Dual Monitor Nightmare

I was writing a post on assorted fixes to make VMware Workstation 6.0 work within Ubuntu (version 8.04, also known as Hardy Heron). I came to the part that called for installing multiple monitors. That turned out to be a huge hassle. I wrote so much material on it that I decided to break it out into this separate post. See the beginning of that previous post for details on my two-computer system and other aspects of the setup on which I was attempting this installation. I had gotten the multiple monitor setup working briefly, once before, but hadn't tried since starting over, and now I wanted to be able to use that in my projects. I reviewed my log of the previous effort, undertaken about a month earlier, and saw that I had gone through a bunch of failed steps before finally hitting on the solution that would work with my 64-bit version of Ubuntu. This time around, I tried to cut to the chase. I started by using Ubuntu's System > Administration > Hardware Drivers to verify that my NVIDIA graphics card's proprietary drivers were still enabled and in use. Then I went to System > Administration > Synaptic Package Manager, searched for nvidia-settings, marked it for installation, and installed it (Apply). Next, it was System > Administration > NVIDIA X Server Settings. But at this point, I had to stop to explain something about my setup. I was using an IOGear GCS62 KVM switch that, for only $20, had enabled me to use one keyboard, one mouse, and one monitor with two different computers. Since switching to Ubuntu, I had mostly been using this KVM switch only for the keyboard and mouse; I had been just using one monitor dedicated to each computer. But now I plugged the second monitor into the KVM switch, and connected that switch to both computers. So my first monitor was still dedicated solely to the primary computer, but now the second monitor was doing double duty. I had previously tried using another KVM switch so that both monitors could go with both computers, but I had found I really didn't need that; I almost never did anything on the secondary computer that would benefit from having two monitors. Rather, I wanted to keep the first monitor fixed on what was happening on the primary machine, so I would stay in touch with my primary workspace. But now I changed things a bit more: I decided to use that second KVM switch for just the second monitor. This way, I would hit ScrollLock twice to switch the mouse and keyboard between computers, and I would punch a button on the second KVM to switch the second monitor between computers. This way, I could see what was happening on one computer when I was on the other, and I could also use both monitors on the primary computer if I so desired. With the second monitor now able to work with both computers, I hit ScrollLock twice. The second monitor was now showing a black screen. I went to the first monitor, connected to the primary computer, and in the NVIDIA X Server Settings dialog (which was presently showing only the primary monitor) I clicked Detect Displays. It showed the HIQ N91S secondary monitor as "(Disabled)." I clicked on that monitor and clicked Configure. It gave me a choice of Disabled, Separate X Screen, or TwinView. My previous notes seemed to say that Xinerama had been a superior solution, but it wasn't clear where I had found Xinerama. I searched Synaptic and saw that a bunch of programs seemed to refer to it, but I couldn't tell which of them (if any) I needed to install. The Wikipedia page I had cited last time said that Xinerama had problems and was being discontinued, and that's more or less what I got at the Xinerama official website too. The new thing seemed to be XRandR; but when I searched Synaptic, it seemed I already had that. Or at least I had installed libxrandr2 and x11-xserver-utils, which were two of the seven packages that Synaptic listed in response to my search. One that I didn't have installed yet was gnome-randr-applet, which was described as a "Simple gnome-panel front end to the xrandr extension." So maybe if I installed that, I would have a clickable icon somewhere that I could use to configure or run multiple monitors. I tried it. But it didn't seem to add anything anywhere. Ultimately, it seemed to come back to editing the xorg.conf file. My previous notes contained a printout of what my working xorg.conf had looked like, but I wasn't sure if it was applicable anymore, since this time I hoped to use XRandR rather than Xinerama. In Terminal, I typed "cd /etc/X11" and then "gksudo gedit xorg.conf." I compared it against what I had in my previous notes. It was really different, and I suspected much of the difference had been caused by Xinerama. I also compared it against an Ubuntu Wiki page. Closer, but still different. I decided to make mine similar to the Wiki. I saved xorg.conf. Nothing happened. Apparently I would have to reboot. I did. Or at least I thought I did. I went away and came back to a black screen on the first monitor. I punched my computer's power button and it shut off. I punched it again and the system booted. It showed "Ubuntu" on the screen, and it went through the part where the slider goes back and forth, indicating that Ubuntu is loading. Then the screen went black, said "No Signal," the hard drive light flickered a few times, and nothing further. I punched the computer's reset button, and this time, at GRUB, I selected Recovery Mode. There, I selected dpkg, "Repair broken packages," and xfix, "Try to fix X server," and then "Resume normal boot." But that did not do it; I still had a black screen. Reset button > boot from Ubuntu CD > "Try Ubuntu without any change to your computer." But what's this? Nothing there either. Still a black screen. I thought maybe the primary monitor was not supported by the Ubuntu Hardy Heron 8.04 boot CD, so I tried looking at the primary computer using monitor no. 2. That one was flashing weird colors. I tried the reset button again, this time with only the second monitor plugged in (as the primary monitor). This time everything went OK; this monitor was recognized. I opened File Browser and navigated to "115.3 GB Media" (that being the size of my Ubuntu programs partition) and then to /etc/X11/xorg.conf. Weird thing was, xorg.conf didn't seem to have changed. I had saved my changes to it before rebooting, but it didn't look that way. Instead, there was another file, named xorg.conf.20080830154959, and that was the one containing my changes. I had no idea why mine had gotten saved with that filename, but there it was. I thought maybe it was messing up the works, even with that weird name, so I opened up a session of File Browser as root (using "sudo -i" and then "nautilus" in Terminal) and moved that xorg.conf.20080830154959 file to another drive, far, far away. The comments at the top of xorg.conf said that you could recreate xorg.conf by running "sudo dpkg-reconfigure -phigh xserver-xorg." I was going to run that command in Terminal, just out of superstition -- xorg.conf didn't actually seem to be any different than it originally was before I started messing around with it -- but then I thought, no, why don't I try rebooting first, and see if getting rid of that weird xorg.conf.20080830154959 file fixes it. So I removed the CD and restarted Ubuntu from the hard drive. This time it restarted fine. I was back in my good ol' Ubuntu setup. I thought I should try to see whether maybe the presence of two different versions of xorg.conf had confused the system at bootup, so I swapped out xorg.conf to a different directory (renaming it as fnoc.grox -- which was xorg.conf spelled backwards -- because this experience with xorg.conf.20080830154959 suggested that Ubuntu might go looking for files even if their names weren't what they were supposed to be), replacing it with xorg.conf.20080830154959 renamed as simply xorg.conf in /etc/X11. Now, I had to switch my monitors back to their ordinary positions before rebooting -- that is, I had to make sure they were plugged into the appropriate sockets in back of the computer -- because xorg.conf would be telling the computer which monitor was left and right and DVI or VGA. After replugging, I rebooted the primary computer. Both monitors were showing the primary computer's bootup process for a while; but when we got to the Ubuntu login screen, monitor 1 said "No Signal" while monitor 2 showed a login screen that was skewed way to the right. All I could see of its "Ubuntu" lettering was just the left edge. So I thought maybe I was off by one monitor, like maybe left should have been right and vice versa. I tried swapping plugs on the two, but no, now I had nothing on either monitor. I replugged the monitors the right way. The thing was still skewed the same way, but I knew that I had to enter ID and then password to log in, so I did that, even though I couldn't see what I was typing -- it was far off the right edge of monitor 2. That worked, and suddenly I was at a normal Ubuntu desktop on monitor 2. Still nothing on monitor 1. I thought maybe I had not entered the right command for it in xorg.conf, so I sudoed my way back there and stared at it. I remembered that that one website had said,

The third [important thing to notice in xorg.conf] is the name of your device's output name. In the above, it is "Monitor-VGA-0", but it could be "Monitor-VGA0" or something. Look at the output of xrandr to see what name your graphics driver uses.
I had tried running xrandr in Terminal without any insights; but now that I looked again, I saw it was not even providing info on monitor 1. Lacking a clue, I tried the suggestion, typing "Monitor-DVI0" into xorg.conf, and then rebooted. That didn't make any difference. Then I realized that Ubuntu was recognizing that monitor just fine with the old xorg.conf, and all I needed to do was to refer to that monitor in the same way in the new xorg.conf. I looked at the old fnoc.grox (see above), but it didn't make sense to use exactly that same approach in the new xorg.conf. I thought maybe the webpage was not quite on target in its advice on how to edit xorg.conf. Another thread made me think that the missing piece was that I had not yet run EnvyNG, which I had done the previous time around to get the latest NVIDIA drivers. I did that now, starting with a search in Synaptic. It came back with three EnvyNG options. The thread had referred specifically to envyng-gtk, and that was one of the three, so I selected that. It said it also needed envyng-core, so that took care of two of the three packages offered. I went to System > Administration > NVIDIA X Server Settings > X Server Display Configuration. Next to the HIQ N91S monitor, it said "Acer AL2216W (Disabled)." So it did recognize both monitors. When I clicked on the box for the Acer, it said "Configuration: Disabled." While I was looking at NVIDIA X Server Settings, I went down to OpenGL Settings and set it to High Quality. Under "GPU 0 - (GeForce 7900 GS)," I saw that it referred to the HIQ N91S as CRT-0 and to the Acer as DFP-0. I clicked on CRT-0 and adjusted its Digital Vibrance because the Hyundai monitor was noticeably less bright than the Acer; I thought that might help a bit. I clicked on DFP-0 and saw that its resolutions were all listed as "Unknown." I tried changing the reference in xorg.conf to Monitor-DFP-0 instead of Monitor-DVI-0; and since that and the EnvyNG thing may both have needed a reboot, I restarted Ubuntu. Unfortunately, these steps had not helped at all. I looked at the xorg.conf shown in my previous post. It was really different from the one I had been working on. I hadn't paid any attention to it because I had thought I would be needing something very different, since I wasn't going to be using Xinerama. But now I noticed that its very first comment line said, "# nvidia-settings: X configuration file generated by nvidia-settings." I tried running nvidia-settings in Terminal, expecting some kind of magic. But, silly me, that just opened up a session of NVIDIA X Server Settings. There, I clicked on the Acer monitor and then on Configure. I clicked on TwinView. I didn't want TwinView, but I had seen a reference to it in the previous post's xorg.conf. I rearranged its position (Absolute, Acer left of Hyundai) and made it the primary display. I clicked Save to X Configuration File and then took a look at the xorg.conf. It said it was unable to create a backup, and xorg.conf did not seem to have changed. I thought maybe the problem was that I had not run nvidia-settings as root. So I did that. This time, it showed the Acer as being (Off), not (Disabled). All of the changes I had previously made in NVIDIA X Server Settings were still there except those under the X Server Display Configuration option, so I made those again and clicked Apply, which I had not done last time. And, whoa, suddenly I had one desktop spanning two monitors, with a big beautiful heron right in the middle. Excellent! I clicked "Save to X Configuration File" and took a look at xorg.conf. This time it made a backup with no problem, and it looked roughly like the xorg.conf that I had saved in the previous post, though I didn't do an exact line-by-line comparison. Here was the full text of it:
# nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings: version 1.0 (buildd@yellow) Thu Jun 5 09:27:12 UTC 2008 # xorg.conf (X.Org X Window System server configuration file) # # This file was generated by dexconf, the Debian X Configuration tool, using # values from the debconf database. # # Edit this file with caution, and see the xorg.conf manual page. # (Type "man xorg.conf" at the shell prompt.) # # This file is automatically updated on xserver-xorg package upgrades *only* # if it has not been modified since the last upgrade of the xserver-xorg # package. # # If you have edited this file but would like it to be automatically updated # again, run the following command: # sudo dpkg-reconfigure -phigh xserver-xorg Section "ServerLayout" Identifier "Default Layout" Screen 0 "Screen0" 0 0 EndSection Section "Module" Load "glx" EndSection Section "ServerFlags" Option "Xinerama" "0" EndSection Section "InputDevice" Identifier "Generic Keyboard" Driver "kbd" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "us" EndSection Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" Option "CorePointer" EndSection Section "Monitor" Identifier "Left Monitor" EndSection Section "Monitor" Identifier "Right Monitor" Option "Right Of" "Left Monitor" EndSection Section "Monitor" Identifier "Monitor0" VendorName "Unknown" ModelName "HIQ N91S" HorizSync 30.0 - 83.0 VertRefresh 56.0 - 75.0 EndSection Section "Device" Identifier "Configured Video Device" Driver "nvidia" Option "NoLogo" "True" Option "Monitor-DFP-0" "Left Monitor" Option "Monitor-VGA-0" "Right Monitor" EndSection Section "Device" Identifier "Videocard0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce 7900 GS" EndSection Section "Screen" Identifier "Default Screen" Device "Configured Video Device" DefaultDepth 24 SubSection "Display" Virtual 2960 1050 Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen0" Device "Videocard0" Monitor "Monitor0" DefaultDepth 24 Option "TwinView" "1" Option "TwinViewXineramaInfoOrder" "DFP-1" Option "metamodes" "CRT: nvidia-auto-select +1680+0, DFP: nvidia-auto-select +0+0" EndSection
Now I needed to know an easy way to switch it from spanning two monitors to just one, because as I was writing these notes on the secondary computer, the right monitor was no longer displaying the right half of the desktop on the primary computer. In NVIDIA X Server Settings, I tried setting Resolution to Off and clicked Apply, and that did it: now the whole desktop for the primary computer was contained in the left-hand (Acer) monitor. With these steps taken care of, the remaining thing was to get VMware Workstation to use the whole two-monitor desktop, so that I could have multiple PDFs and Word documents open at once and readily visible. The approach used in my previous post wasn't working now. When I clicked on the Full Screen option in Workstation's Console View, I got the disappearing toolbar at the top of the screen; but the icon that had said "Add a monitor to full screen view" in my previous installation was now saying (well, its tooltip was saying), "Cannot use multiple monitors; click for more info"; and when I did that, I got this:
This virtual machine cannot use multiple monitors for the following reasons: The virtual machine's Display setting must be "Use host settings" or specify more than one monitor with sufficient maximum resolution.
So back in Console View, I went to VM > Settings > Hardware > Display. But the option to change the number of monitors was grayed out. Evidently I had to do this by logging into Workstation as root. I did that, but it was still greyed out. Now I realized I should probably have closed down the virtual machines rather than just suspending them. I was curious whether that was the whole explanation. I killed Workstation and started it up again as just me, not root. I restored one of the VMs and, no, it was still grayed. So apparently I had to do both: power it down (not just suspend it) and also make the change as root. But no, correction: once the machine was powered down, I could make the change without running vmware as root. I tried the host settings option, hoping that maybe this would fix a problem I had had when attempting to run another program (Second Life) within a VM: I had gotten an indication that my drivers weren't up to the job, and had concluded that they were talking about Workstation's native drivers, not the latest NVIDIA drivers that Ubuntu was now supposedly using for me. Once I had set the Display option to "Use host settings for monitors," I powered on that VM and tried Full Screen again. For some reason, the collapsing toolbar at the top of the screen was not expanding. I think it was Ctrl-Alt-Enter that got me back to Console View. I tried Full Screen again. This time the toolbar was behaving properly. Maybe it had just been funky while the WinXP VM was loading. Anyway, there was an icon whose tooltip now said, "Add a monitor to full screen view." I clicked that and the screen flickered, but otherwise I saw no difference. Then I remembered to punch the button on my KVM switch. Yes, there it was: I was able to move a program's window (e.g., Internet Explorer) anywhere on either monitor. But (perhaps because my monitors were not the same size) the resolution on the second monitor was not right. I went back into NVIDIA X Server Settings and saw that the Hyundai (right-hand) monitor was now labeled as just CRT-0 with a resolution of only 1024 x 768. To give it exactly the same vertical resolution as the Acer (so that the Ubuntu bottom panel would not bleed off it, as I had noticed it did before), I changed the resolution from Auto to 1400 x 1050 (instead of 1280 x 1024) and clicked Apply. That didn't work too well, so I changed it to 1280 x 1024 after all. But now I was getting weird effects with windows. In Ubuntu, I moved the NVIDIA X Server Settings window to the right-hand monitor, and then found I couldn't get it back to the left side; and I opened a Terminal session and found that I could not drag it to the right side. And in VMware, I clicked the icon to "Add a monitor to full screen view," but it wouldn't let me drag Internet Explorer to the right-hand monitor. I tried shutting down the virtual machine, but leaving VMware running, and then dragging those other windows around. Still no good. I killed VMware and tried again. Nope. It seemed like telling Workstation to use the host settings had screwed up the host. I powered up VMware and changed that in Display: instead of saying "Use the host," I specified two monitors and the maximum possible resolution, and tried again. Now I got the "Cannot use multiple monitors" error again, but this time there was an additional reason: "The current arrangement of monitors is not supported." I guessed the reason why it also repeated the earlier error message, shown above, was that it did not see me as using multiple monitors because Ubuntu was treating the two monitors as one big monitor. It wasn't like in Windows, where each monitor functioned sort of like a separate desktop with its own wallpaper; here the one piece of heron wallpaper was stretched all the way across both monitors. This made me think that maybe the solution was back in NVIDIA X Server Settings, with a Separate X Screen (instead of TwinView) configuration. So I made that change. It wouldn't let me Apply it right then and there; it said I had to restart. So I clicked Save to X Configuration File. It gave me a bit of advice:
Multiple X screens are set to use absolute positioning. Though it is valid to do so, one or more X screens may be (or may become) unreachable due to overlapping and/or deadspace. It is recommended to only use absolution positioning for the first X screen, and relative positioning for all subsequent X screens.
So, OK, I canceled that, clicked on the Hyundai (CRT-0) monitor there in NVIDIA X Server Settings, clicked its X Screen tab, and changed position to "Right of." Unlike TwinView, the Separate X Screen option also gave me an "Enable Xinerama" option. Why were they giving me that option if, as someone had said, Xinerama was on its way out? I thought I'd try it without that first. I tried Apply again, that didn't work again, tried Save to X Configuration File again, and wasn't logged in as root again, so that didn't work again, so I quit NVIDIA X Server Settings again and logged in as root again and ran nvidia-settings again and made the changes again and saved to X configuration file again, and that worked (again). Then I rebooted. But this wasn't good: it seemed I had only monitor no. 2 again. Then I realized the problem was that nvidia-settings had designated monitor 2 as Screen Number 0 and monitor 1 as Screen Number 1, which was backwards. So when I started nvidia-settings, I got an "Invalid display device" error message in Terminal, which continued scrolling other error messages as I continued fooling around with NVIDIA settings until I had probably totally fubared the whole thing. At that point, it occurred to me that maybe I had to swap the cables on back of the computer again. That took three minutes, down there in the dust and darkness behind that computer, cursing the engineer who designed those DVI connectors. And this, truly, seemed like no improvement at all, because now both screens were black. Ah, but I thought, no doubt I must reboot in order to allow the machine to see the newly configured monitors. Did that via punch of reset button. But this made no difference, either in the priority of monitors upon reboot or in the X Server Display Configuration. Then the problem became clear: xorg.conf was designating the monitors in the wrong order. So I put the cables back where they were, with appropriate imprecations directed at the eternal soul of the aforementioned engineer; and after another punch of the reset button on the primary computer, I decided to take the advice proffered at the start of xorg.conf, namely, to run this command to reset the sucker and start over:
sudo dpkg-reconfigure -phigh xserver-xorg
which I did. Then I rebooted again. I got a "Mode Not Supported" error message from monitor 2 and an otherwise unusable machine. I rebooted with the Ubuntu CD. Mode continued to be not supported, as we now had a black monitor 1 and a weird flashing monitor 2. Deciding that the cables might have been more right the other way, I swapped them once more (remember, third time's a charm) and punched reset again. Upon CD reboot, I had the left monitor (no. 1) working properly, the right monitor flashing (apparently not supported yet), and the generic xorg.conf created by the command shown above. I tried to run nvidia-settings, but it hadn't been installed by the CD boot process. I checked my notes, above, and remembered to try removing the xorg.conf backups from /etc/X11. I did that and rebooted. It booted properly, and this time with monitor no. 1 behaving like monitor no. 1. I typed "sudo nvidia-settings" and got this error message:
You do not appear to be using the NVIDIA X driver. Please edit your X configuration file (just run `nvidia-xconfig` as root), and restart the X server.
I typed "sudo -i" and then "nvidia-config" and got a "VALIDATION ERROR":
Data incomplete in file /etc/X11/xorg.conf. Device section "Configured Video Device" must have a Driver line.
Well, I thought maybe nvidia-settings could help me with that. First, though, I had to figure out how to "restart the X server," since apparently that did not require an actual reboot of the system. According to one source, you would restart the X server by typing "sudo /etc/init.d/gdm restart." Unfortunately, that advice froze my screen after running some commands, ending with "Running local boot scripts" under "Starting VMware services." I found another source that said all I had to do to restart the X server was hit Ctrl-Alt-Backspace. That seemed easier. I punched the reset button (which seemed like another way to restart the X server) and now I got life only from monitor 2 -- and it was a distorted Ubuntu login screen underneath the monitor's self-generated "Mode Not Supported" message. I couldn't even see the Screen Resolution menu pick, to change it, but using the secondary computer as a guide, I counted down 12 (and that wasn't right) and then tried again with 11 items from the "Keyboard" menu pick and hit Enter, and that gave me the Screen Resolution option. The best resolution monitor 2 could support at that moment was 832 x 624, but it was enough. I made changes in nvidia-settings, but each time I would try to save them to xorg.conf, the settings program would disappear. Terminal reported a "Segmentation fault." I tried Applications > System Tools > EnvyNG and chose NVIDIA > Install the NVIDIA Driver (Automatic hardware detection). EnvyNG ran for a while. When it was done, I actually had to do the nvidia-settings thing a couple of times to get it to work through the changes, improve the resolution, etc., hitting Ctrl-Alt-Backspace each time to restart the X server. The second time, though, it didn't seem to have changed anything from the previous time. Meanwhile, I had a bunch of error messages in Terminal. There were too many, and I had no answer for them, so I did not attempt to log them all here. I tried going back into NVIDIA X Server Settings again, but again it vanished when I tried to make a certain change -- not sure which one -- and then I got another "Segmentation fault" error in Terminal. I looked for webpages on that, and didn't find any clear ones immediately. What I did find was a growing sense that I had really screwed up in attempting to reinstall. A webpage on NVIDIA drivers, and other pages I looked at, gave me the impression that installing and uninstalling stuff in Ubuntu was not at all necessarily a clean, precise process -- that it could be just as messy as in Windows, if not more so. By this point, plainly, I had a nonworking system, as far as the monitor was concerned -- and I couldn't get very much done without the monitor! One missing piece, as I gathered from the officially supported page on installing NVIDIA drivers, was to go to System > Administration > Hardware Drivers and make sure the NVIDIA drivers were enabled. I had done that previously, but somehow they had become disabled, and I hadn't thought to check. That called for a system restart. On reboot, the resolutions were not right. I had gotten a message, "Ubuntu is running in low-graphics mode," but the configuration options there didn't include my graphics card and monitors, so I just continued past that, and then the system loaded into a tolerable but not great resolution. Meanwhile, I belatedly noticed this advice on that webpage:
The Hardware Drivers tool may not work properly on machines that have previously used third party tools like 'Envy' or manual installation to install previous drivers. You should remove those drivers before attempting to install using the built in tool.
So I went to Synaptic, searched for EnvyNG, and marked for complete uninstallation the two packages there that I had installed. But before doing that uninstall, I went back to System > Administration > Hardware Drivers and disabled the NVIDIA accelerated graphics driver. I had to kill the Synaptic session to do that, and then I had to reboot, and on reboot I got back to the uninstallation of Envy in Synaptic. Then I went back and installed the NVIDIA driver again and restarted again. The problem was not fixed: resolutions were still bad. Another page advised trying System > Preferences > Screen Resolution, but no higher resolutions were available there. That page also advised a number of additional steps, but at this point I thought I might just try restoring an earlier backup of xorg.conf, one that identified two separate monitors and video cards with resolutions (since the researching and writing of code on monitor resolutions was included among the numerous steps they were advising on this webpage. On reboot, the bootup program ran a "Routine check of drives," and I still had lousy resolutions. I edited xorg.conf to reverse the two monitors, hoping that I was doing it right. On reboot, no improvement. Back at the FixResolutions webpage, I went with their autodetect option, which required these commands:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.custom md5sum /etc/X11/xorg.conf | sudo tee /var/lib/x11/xorg.conf.md5sum sudo dpkg-reconfigure xserver-xorg
The second of those commands produced a "No such file or directory" error. I double-checked the typing; I had entered it exactly as instructed. I ran the third command anyway, since it looked like something I had tried previously. It asked basic questions about the keyboard and such. When it was done, I tried Ctrl-Alt-Backspace again. As the webpage seemed to anticipate, this step was relatively easy but absolutely unhelpful. The next step they advised was to verify that xorg.conf contained horizontal and vertical monitor resolutions. It didn't, possibly because the previous steps had erased the xorg.conf that I had restored from backup. I restored it again and took a look at it. It looked roughly right. I did Ctrl-Alt-Backspace again to restart the X server. System > Administration > Hardware Drivers said I was using the NVIDIA drivers; but when I ran NVIDIA X Server settings, I got that message again:
You do not appear to be using the NVIDIA X driver. Please edit your X configuration file (just run `nvidia-xconfig` as root, and restart the X server.
I did exactly that. No improvement. Xorg.conf was still confused about the lines I had corrected previously -- it still had the monitors backwards -- so I tried again to fix that. This did not help. Following some advice further down that webpage, I tried nvidia-settings again, and again got the message that I did not appear to be using the NVIDIA X driver. Continuing with their advice, in Synaptic I searched for and installed xresprobe and then ran "sudo ddcprobe | grep monitorrange." This gave me horizontal (31-84) and vertical (56-77) figures, in that order, that should have appeared in xorg.conf. Those numbers matched the ones given for the Acer monitor in xorg.conf. I wasn't sure how to get the values for the Hyundai. But now I noticed that this webpage was telling me that maybe I hadn't understood how to restart the X server. According to them, I had to log out of the ubuntu session and then press Ctrl-Alt-Backspace in the login screen. I tried that. It was different, but it didn't make a difference. I had to conclude that the problem was in that error message indicating that I was not using the NVIDIA X driver, when Hardware Drivers said I was. Uninstalling and reinstalling had not fixed that. I disabled those hardware drivers again and went back to Synaptic and reinstalled EnvyNG. I went into Applications > System Tools > EnvyNG and installed the NVIDIA driver again. I rebooted, went into Hardware Drivers and enabled those drivers again. I rebooted and verified that it still just wasn't happening on either monitor. Sooo ... what was the fallback plan? What I would have done in Windows, at this point, might have been to restore a previous working system image using Drive Image 2002. More recently, I had made an Acronis True Image backup of my Ubuntu drive. What would happen if I just restored that whole thing? And was that necessary, or could I just restore or fix part of it? Was this what people were talking about when they were saying they had recompiled their kernel? Before jumping in over my head, I decided to solicit advice. I posted some of the above questions and went to bed. When I got up, I had a response. Basically, yes, you lose your installed applications if you reinstall Ubuntu, so try again on the NVIDIA thing before bailing out. They pointed me toward another thread which, in turn, pointed me toward a page on RandR -- which referred me to the XRandR manual for details. I will say that the RandR page had a helpful description of the different parts of the xorg.conf file. But that other thread ended with a couple of posts by a newbie who claimed to have tried everything exactly as prescribed and still wound up with unsatisfactory results. If I did decide to reinstall, the response also provided some advice on how to preserve a list of the programs installed, along with their basic settings. The risk of losing all installed applications made VMware seem like an excellent idea, of course, because the virtual machines, with all their Windows programs, would presumably be unaffected. I had to say, I did not like that Ubuntu could become so screwed up in its monitor resolutions, and so seemingly irreparable. This was Windows territory. No doubt it was my fault, in a dozen different ways perhaps. But I really had been trying to find the right instructions and figure out the next steps, and it hadn't worked for me, and it wasn't working for a number of other people. Ubuntu would continue to improve -- I was sure that even the next version, coming out in a little more than a month, would be an improvement, possibly in this area in particular -- and in that sense I had hope in Ubuntu that I did not have in Windows, which after all these years could still dump masses of people in Vista-land and leave them with systems that might not be much more workable than what they might have had with Windows 95. Nonetheless, this was discouraging. Having spent hours screwing around with monitor resolution fixes, I was inclined to try out the reinstallation or restore-from-backup approach. I started another post for that.



i agree with you about ubuntu's instability with multiple monitors and resolutions. Very frustrating. I could not get my setup to work, so back to the drawing board with a fresh install for me.