Tuesday, September 2, 2008

Reinstalling Ubuntu and VMware

I had been working, for much of the past two months, on the process of switching from Windows XP to Ubuntu. When it appeared that I would still be relying on a number of Windows programs for the foreseeable future, I decided to use VMware Workstation 6 to enable me to run Windows within Ubuntu. On that basis, I had installed Ubuntu 8.04 (Hardy Heron) on each of my two computers, and on the primary computer I had then installed Workstation and had set up some virtual machines. Now, however, as described in the immediately preceding post in this series, I was finding that my NVIDIA drivers were not operating correctly and did not seem capable of being repaired. After investing quite a bit of time and effort in that, and seeing that my secondary computer was meanwhile having no such problems, I decided that the most effective thing I could do would probably be to reinstall Ubuntu on the primary computer. I had tried using a previous backup that I had made with Acronis True Image; but while that restore process had succeeded, it appeared that the NVIDIA problems must have predated the backup, because they were still there. I had gotten some tips on what I could back up, on the present installation, to help make reinstallation of Ubuntu a little easier, and I had followed that advice. But now it was time to bite the bullet and do the reinstallation. My first question was whether it was necessary to wipe the Linux ext3 partition, or any particular folders within it, or whether Ubuntu 8.04 (I was using the 64-bit version) would take care of all that for me. Based on a couple of discussion threads I reviewed, it seemed I would be completely wiping out the existing installation. Well, I rebooted with the Ubuntu 64-bit CD and clicked on Install. When we got to the choice of guided or manual installation, I chose manual and directed the installer to use the 115.3GB ext3 partition. I clicked Forward. It said, "No root system is defined. Please correct this from the partitioning menu." I clicked Edit Partition, told it to make it ext3, and chose / as the mount point. I clicked Forward again. I got another question:

Do you want to return to the partitioner? The file system on /dev/sdb6 assigned to / has not been marked for formatting. Directories containing system files (/boot, /etc, /usr, /var, ...) that already exist under any defined mountpoint will be deleted during the install.
I felt that was OK, so I clicked Continue. I filled in my name and the other requested information and hit Forward again. Next was a "Migrate Documents and Settings" dialog. Apparently it was going to allow me to import documents and settings from the "ray" account that it found preexisting on that partition. This sounded very good. I checked the "ray" box and clicked Forward and Install. This was at 3:33 PM. At 3:44 PM, I was logging in, very pleased with how quickly that had gone. As soon as I entered my password, however, I got this:
User's $HOME/.dmrc file is being ignored. This prevents the default session and language from being saved. File should be owned by user and have 644 permissions. User's $HOME directory must be owned by user and not writable by other users.
A bit baffling. I clicked OK. Interestingly, I had the same customized desktop layout as before, with my top panel at the left side of the screen and both panels set as expandable. Had the installation not done anything? System > Administration > Hardware Drivers said I did now have "NVIDIA accelerated graphics driver (latest cards)" installed but not yet enabled. I enabled it. It needed a restart. I rebooted. Or at least I gave the instruction to reboot. It was not completely able to do so. After five minutes with a black screen and a blinking cursor, I punched the reset button. Same result. I tried again, this time using recovery mode and running dpkg but not xfix. Nope: No Signal, and then a black screen. OK, recovery mode again and xfix. I got that same message (above) about "User's $HOME/.dmrc file" being ignored. OK. Hardware Drivers showed the NVIDIA driver being "In use." It really looked like I had the same system as before, with even the same things on the Desktop as before; but on closer inspection the menu picks for Applications > Internet > Google Earth and Applications > System Tools > VMware Workstation were gone. So I did have, in some sense, a new installation, and was relieved that I might not have to do so much reinstalling of stuff as would have been necessary with a totally new system. First, the system was telling me that I had some updates to install. I clicked on that and looked at it. One thing they wanted to install was Firefox 3.0. I had found that to be inferior to Firefox 2.0.0.16 for my purposes. I ran Applications > Internet > Firefox and saw that it was checking my standard list of Add-Ons, which was another pleasant surprise: those, too, had not been wiped out in the reinstallation. But now it said that a half-dozen of them were disabled because they were not compatible with this version of Firefox. On second check, three of them could be updated to this version after all. But two of the most useful ones, Snap Links and Tab Mix Plus, were still disabled. Help > About said that this was version 3.0. I let Ubuntu go ahead and install its updates, but this was one program and update that I would be uninstalling. The full package of Ubuntu updates consisted of 111 updates (118.6MB), so this was going to take a while. It was done, and I rebooted as requested, at 4:50 PM. Now I had to take care of that $HOME message that kept popping up after every boot. I found several posts recommending two different versions of the same steps:
sudo chown -R [username] /home/[username] sudo chmod -R 755 /home/[username] sudo chown [username] $HOME/.dmrc sudo chmod 644 $HOME/.dmrc or sudo chmod 644 /home/[username]/.dmrc sudo chown [username] /home/[username]/.dmrc sudo chmod -R 700 /home/[username] sudo chown -R [username] /home/[username]
The second version was repeated on two separate webpages, so I tried that first. Its third line gave me an error message, "Cannot access `/home/ray/.gvfs': Permission denied." So I switched to the first version, above, and tried that. But its first line gave me the same error message. I tried it without the sudo and got "Function not implemented." I tried the third line of version 2 again without the sudo, and that seemed to work. I tried the fourth line of version 2 with and without sudo. With, I got "Permission denied." Without, I got "Function not implemented." This solution did not seem to be working for me. I rebooted anyway, just in case some of the other lines had done the trick. And, what do you know, that message was gone. Can't say which of the above lines did it, but apparently version 2 (with some tinkering as to when to use sudo and when not to) was the solution. Once that was out of the way, I consulted my previous notes on replacing Firefox 3 with Firefox 2. What seemed to have done the job, that time, had been to close down Firefox, search System > Administration > Synaptic Package Manager for every installed program that was Firefox-related and mark it for complete removal (but not totem-mozilla or xulrunner), Apply that. Then it was File Browser (i.e., Nautilus) > View > Show Hidden Files and then File System > home > ray and there, in /home/ray, delete the .mozilla folder. Firefox was no longer visible in Applications > Internet. Back in Synaptic, I searched for firefox-2 and installed firefox-2 and firefox-2-gnome-support. I started Firefox and, using the list of add-ons previously saved with Infolister, installed them and, where applicable, their saved profiles. I rebooted to make sure we were still on the same page, Ubuntu and I. All was golden. I realized I might have screwed up by forging ahead with Firefox when maybe I should instead have started with that dpkg thing that I had noted in a previous post. But as I reviewed the thread containing the advice, it looked like it would just mark packages for installation, and no harm done if I had already installed them. On second thought, did I want to reinstall the whole boatload of my previous programs? Most of them, I thought, had been installed by Ubuntu automatically. The ones I wanted to install would come to me, and most likely I would have to fight my way through them again, just as I had had to do the first time. So no thanks, I'll do it my way, is what I concluded on that. But now why was the NVIDIA driver once again marked as "Not in use" in Hardware Drivers? Maybe Firefox or one of its add-ons had disagreed with it? I enabled it and restarted again, as it requested. No Signal! Dead computer! Had I just spent several hours (it was now 6:26 PM) reinstalling Ubuntu, Firefox, and all that, for nothing? I ran recovery mode and xfix. (I had checked the last Ubuntu forum questions that I had posted, an hour or so earlier, and there had been no further comments.) Now Hardware Drivers said that the NVIDIA driver was in use. Confusing! I rebooted again, just to see if this was a fake-out. Maybe I had been misunderstanding this Hardware Drivers dialog. It said the driver was "In use," but the Enabled box was not checked, and when I checked it, I got a confirmation dialog; and when I said OK to that, I got a check-mark in the Enabled box. So, OK, now we were really in business. The system wanted to reboot again, and I did that. Dead computer again. WTF. After recovery mode and xfix, I decided to count my blessings and make an Acronis True Image backup. I had very nearly a bare-bones Ubuntu installation, with nothing added to it except ol' Firefox 2. If this installation couldn't work with my video card, then apparently I was going to need a new video card. Another possibility, which had just occurred to me, was that when I kept the previous "ray" profile during the Ubuntu reinstallation, maybe Ubuntu had kept the dpkg list of previously installed programs. Maybe that's why I had had 111 updates, whereas previously I thought there had been about 85 of them; maybe it was installing and updating those other packages too. And maybe in that process it was incidentally installing whatever package happened to be screwing up my NVIDIA driver. Maybe I needed to do a complete bare-bones reinstallation, with no reference to my previous account. If that wasn't correct, I now had the Acronis backup and could get back to this point pretty easily. First, though, after the Acronis backup, I tried installing Google Earth, since my previous attempt was the last thing that had prompted me to reinstall Ubuntu. If it worked, maybe I would think the world was OK, or at least OK enough to last me until October and the next version of Ubuntu, or whatever other reason I might eventually have to do another reinstallation. Following my previous experience, I first typed "sudo apt-get install googleearth-4.3," expecting that not to work; and when it didn't, I typed these two commands to enable the Medibuntu repository:
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
just like before; and then I tried that "sudo apt-get install googleearth-4.3" line again. It ran, it installed, and when I selected it, it first gave me the same Unknown Graphics Card error. I killed that and the program died. End of story. Time to shop for a new graphics card! Then I wondered if other people were having this problem with NVIDIA 7900GS graphics cards. Certainly one poster was: there, too, it looked like everything had been tried and nothing had worked. Several commentators said they had no problem using Envy to install NVIDIA drivers (via Synaptic) in Feisty (Ubuntu 7.10), but this user was using 64-bit Hardy 8.04, as I was. The more I looked around, the more I suspected it was a driver problem indeed, and that there was nothing else to be done. I decided to try once more with EnvyNG. I installed and ran it in Automatic Hardware Detection mode. I noticed that it was uninstalling nvidia-glx-new. It completed and it wanted to reboot, so I said sure. But, sadly, No Signal. Dead computer. Reboot & use xfix in recovery mode. Uninstall EnvyNG (and also nvidia-glx-new-dev-envy and nvidia-glx-new-envy; leave nvidia-glx-new and nvidia-settings installed. In Hardware Drivers, I still had the NVIDIA driver listed but not in use. I went into System > Administration > NVIDIA X Server Settings, but I got this error:
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 that, and got a message that "nvidia-xconfig can be found in the following packages," and one listed was nvidia-glx-new. I took another look at Synaptic and, oops, nvidia-glx-new seemed to have become uninstalled somehow. The system still wasn't ready to run nvidia-xconfig for me, though, and I had been to this territory before. I went to NVIDIA's "Help Me Choose" graphics card page. It said its GeForce 7, 8, and 9 series cards were all compatible with Linux AMD64. Baffling. I went back to the primary computer and prepared to reinstall VMware Workstation 6, following my previous steps. I figured if that would work, maybe I could postpone the NVIDIA graphics issue for a while. Then it occurred to me to check Synaptic in case it was possible to download the trial version of Workstation there. But no, it wasn't. Then I went to VMware's Workstation webpage, to see if I could get a slightly newer version, but there didn't seem to be any updates available. I noticed that Firefox's Session Manager add-on had not restored the last session I had been using before reinstallation, and then realized that was probably because my edited fstab file was no longer on the Ubuntu partition. I extracted that, using the same method as before, rebooted, and nothing had changed, apparently because I hadn't done it as root. I amended that error and tried again. Now the proper fstab file was back in /etc. But when I came back to the computer, a few minutes later, I was still not seeing all of my partitions mounted and listed in the left pane of File Browser > Computer. Had I not rebooted? I did it again. No, it definitely wasn't mounting them. I tried mounting one of them manually and got the message that I was not privileged to mount the volume. I logged in as root and tried again, and now I got, "Cannot mount volume. Unable to mount the volume 'VMS'." When I clicked Details, it said, "mount: mount point /media/VMS does not exist." Following a Psychocats article, it occurred to me to double-check the status of the partitions using GPartEd. I didn't find Partition Editor under System > Administration anymore, which suggested that my earlier hunch had been wrong -- that the Ubuntu reinstallation had actually not reinstalled my previously installed packages. I used Synaptic to install it now, and I checked the partitions on it. They were all there, though some partition names were not shown. Maybe they had been missing before. The partition names were visible to File Browser; it just couldn't load them. The only partitions it could see were on one of my three hard drives. I decided to try booting into Windows XP, there on the primary computer's dual-boot setup, and see what happened then. Windows was able to see the NTFS partitions though not, of course, the ext3 partitions. I rebooted back into Ubuntu and scratched my head. I posted a question on it. Then, proceeding backwards, something in the Psychocats article caught my attention. I reviewed my ancient notes -- a month old, by now -- and thought I might try sudo mkdir /media/CURRENT and so forth, for each of my partitions' names: sudo mkdir /media/VMS, and so forth. Then I rebooted. Now I had desktop icons for each partition, Firefox's Session Manager add-on was functioning properly, and I could return to the task of reinstalling VMware. The steps for installing VMware Workstation were: (1) Copy VMware-workstation-6.0.4-93057.x86_64.tar.gz (which I had already downloaded from VMware) to /tmp. (2) Go to /tmp in Terminal as root. (3) Type "tar zxpf VMware-workstation-6.0.4-93057.x86_64.tar.gz". (4) Type "cd vmware-distrib". (5) Type "./vmware-install.pl". (6) Accept the default (bracketed) options. And that's all there was to it. I ran Ubuntu's Applications > System Tools > VMware Workstation. Amazing! Despite reinstalling Ubuntu, all of my VMware configurations were in place, including VMware Tools, and the tabs were open for each of the virtual machines (VMs) that I had suspended when I had last finished using Workstation. This approach of reinstalling Ubuntu and opting to import your previous profile -- I liked it. This whole process seemed like the kind of thing that, so far, you could do in a couple of hours and be completely operational again -- which was far better than just installing native Windows XP and then having to install all of those programs and their updates from scratch. Here, my Windows programs were already encapsulated in the VMs, and were immediately ready to go. Very nice. At this point, I had not completed reinstalling or reviving all of the tweaks and programs that I had installed previously. I verified, in Hardware Drivers, that the NVIDIA driver was still not enabled. I thought, however, that possibly an earlier version of Google Earth would work, just as VMware seemed to work fine -- showing JPGs with very good quality inside a VM -- despite the lack of any NVIDIA driver. In Synaptic, I uninstalled googleearth-4.3, which was somehow still installed, and instead I installed googleearth-4.2. I ran Applications > Internet > Google Earth. It gave me a Suggested Update dialog mentioning 4.3. I clicked OK instead of downloading the update. Once again, I had "Google Earth is unable to identify your graphics card." Unlike 4.3, it did start and run, but it didn't show the Earth, so it was more or less useless. It was weird that the cheap little graphics card I had bought for the secondary computer was doing better than the expensive and more powerful one used in the primary computer. I decided to try again. A card that Newegg customers said was good with Ubuntu was the EVGA 256-P2-N751-TR GeForce 8600 GT. So I ordered one of those and hoped I could get a good price for my existing used card from some nice Windows user. I uninstalled Google Earth 4.2 and reinstalled 4.3 and left it at that for now. So at this point I believed I would get back to work and slowly continue to refine my Ubuntu and VMware system. The next steps on that are contained in a separate post.

0 comments: