Showing posts with label jaunty jackalope. Show all posts
Showing posts with label jaunty jackalope. Show all posts

Wednesday, February 10, 2010

Ubuntu 9.10, VMware Workstation 7: Failed to Open Sound Device (Workaround)

In previous posts, I tried fixing error messages that I was getting in a Windows XP virtual machine (VM) running on VMware Workstation 6.5.2 on Ubuntu Linux, version 9.04.  I didn't know, at that time, whether some of my problems stemmed from having done an upgrade rather than a clean install of Ubuntu.  Now I found myself facing the same problem again, after a clean install of both Ubuntu 9.10 (Jaunty Jackalope) and VMware Workstation 7.

The problem was as follows:  if I checked the "Connect at power on" option, then audio would not run in the VM until (in full screen mode) I went into VM > Removable Devices > Sound Card > Connect; but when I did that, I would get this error message:

Failed to open sound device /dev/audio: Device or resource busy.  Failed to connect virtual device sound.

One recent discussion seemed to suggest that the problem was that Flash Player and/or Alsa audio.  I suspended my VMs and rebooted the computer.  When it rebooted, I made sure that Firefox was not running.  I resumed the VM and audio played OK in IrfanView.  I started Firefox inside the VM (i.e., in Windows XP) and played a YouTube video.  The audio was still OK in IrfanView.  I started a second session of Workstation and resumed a different VM in that session.  The manual sound card connection went OK; and there, too, I could play audio without stuttering.  The audio in the second VM was not as good; it had some static.

With those two VMs open, I started Firefox in Ubuntu (i.e., not in a WinXP VM).  I played another YouTube video.  Now I got an error message, and audio would not play in IrfanView within the VM.  I tried the other VM; same thing.  The error message was "Failed to open sound device /dev/audio: Device or resource busy.  Sound will be disconnected."  I went back to Ubuntu and killed Firefox.  Now I was able to connect the sound card and play audio inside the two VMs, same as before, complete with mini-stutters in the second one.  I started Firefox again in Ubuntu.  The audio was still OK inside the VM.  If I was playing audio in IrfanView in the VM and then went into a YouTube page in Firefox, the audio would not play in the latter.  I had to restart Firefox to get its YouTube audio to play, and then, as before, I was not able to hear audio inside the VM.  It worked the same way if I played a YouTube video in Opera rather than in Firefox.  So it seemed that the problem (which has apparently been around for years) continued to be within VMware Workstation.

For the time being, the solution seems to be either (a) to watch videos and other webpages that use Flash, do it in a browser session that is running inside your VM, not in a browser running in Ubuntu, or (b) after watching a video or otherwise using Flash in Ubuntu, kill the program that used it (e.g., Firefox) and manually reconnect with your sound card inside the VM.

Tuesday, December 29, 2009

Ubuntu Linux, VMware, 64-bit WinXP Guest: Getting Online

I was using Ubuntu 9.04 (Jaunty Jackalope). On Ubuntu, I was running VMware Workstation 6.5.2. In VMware, I had just installed 64-bit Windows XP. I was now trying to get online.

At first, I thought the problem was with my Linksys WRT54GL Wireless-G 2.4GHz 54Mbps broadband router. I inserted the Linksys setup CD and ran through its setup steps. It said, "Checking your computer settings, Please wait." After a minute or so, it gave me an error message: "Setup Wizard MFC Application has encountered a problem and needs to close." It did this repeatedly. But when I connected the computer directly to my DSL modem, bypassing the router, I still couldn't go online. Anyway, a post I saw somewhere said that the Linksys setup CD was to set up the router, not the computer. The router had already been set up from a previous installation, so that didn't seem to be the issue. I was able to access the Internet in Firefox in the underlying Ubuntu layer, so the problem was just with getting Windows connected from within the virtual machine (VM).

In VMware, I went to VM > Settings > Network. I saw that it was set to Bridged. I believed it was supposed to be NAT, not Bridged, so I changed it. I did the same thing with Network Adapter 2. I saved that and tried again to go to a webpage in Internet Explorer, but once again got "The page cannot be displayed." I connected the computer directly to the DSL modem again. This didn't seem to make any difference, but I left it that way for the moment, just in case I had more than one problem.

It occurred to me that maybe I was supposed to restart VMware in order for the changes to take effect, so I suspended the WinXP VM, closed VMware, and restarted it. Just to test it, I started a different VM and tried to go online. Internet Explorer worked with no problems in that machine, but still wouldn't work in the new 64-bit WinXP VM. I dug out my AT&T Yahoo SBC installation CD -- I had forgotten that I had such a thing, but I got reminded of it when I ran Start > Settings > Network Connections > New Connection Wizard > Next > Connect to the Internet. All the hardware was already plugged in, so I moved pretty quickly to AT&T's Software Installation dialog. When I clicked there, I got a message, "You need to install an Ethernet adapter in your computer." So the problem seemed to be that Windows was not recognizing the VMware virtual network connector.

Looking again at the VM settings, I noticed that the working VM only had one Network Adapter. There was no Network Adapter 2 there. The VMware FAQs said there could be problems if you had two network interface cards (NICs), so I deleted Network Adapter 2. This didn't help with the AT&T installation; I was still getting the message that I needed to install an Ethernet adapter. A Google search for that message didn't turn up anything.

I went to Start > Settings > Control Panel > System > Hardware > Device Manager, as I should have done at the beginning. There, I saw a yellow question mark and a yellow circle with a black exclamation mark next to "Ethernet Controller." I right-clicked on it and said, Update driver. The Hardware Update Wizard couldn't find a driver. Someone said they had resolved this problem by installing a new WinXP x64 VM using the 64-bit rather than the default 32-bit WinXP setup. I powered down the VM and checked in VMware's "Edit virtual machine settings" option for that VM. It showed that, under Options > Guest Operating System, I had already indicated that the guest was Microsoft Windows, Windows XP Professional x64 Edition. This didn't seem like it was the problem in my case, so I posted a question on it.

Sunday, September 27, 2009

Installing a Brother MFC-7340 Multifunction Printer in Ubuntu 9.04

Brother provides a webpage to guide the process of setting up an Ubuntu 9.04 installation with certain Brother brand printers. This post describes the steps I took to set up my Brother MFC-7340 Multifunction device. I decided to work through one function at a time, starting with the MFC-7340's printer. First, I downloaded the printer drivers. It looked like I was supposed to get both the LPR driver and the cupswrapper driver, so I did. I chose the Debian rather than RedHat (.rpm) format for these and other downloads. The LPR driver installation instructions recommended using the CUPS driver rather than LPR, if CUPS was working. On my system, it wasn't. I took that as a cue that I should begin by trying to use the LPR driver instead, though possibly it should have told me that I should try again with CUPS, to see if I could get it to work. The LPR driver instructions told me to begin by attending to certain pre-installation requirements. On my 64-bit Ubuntu installation, this involved going into System > Administration > Synaptic Package Manager, where did a quick search for the ia32-libs package. It was already installed on my machine. If it hadn't been, I would have checked it and clicked on Apply. In Ubuntu's Applications > Accessories > Terminal, I navigated to the folder where I had put the LPR driver download. The easy way to navigate there was to find it in Nautilus (i.e., Places > Computer, what Ubuntu calls "File Browser"), copy its address from the Nautilus address bar, and paste it into a CD command (e.g., CD "/downloadlocation/folder/downloadedfile.deb"). In that folder, I entered the following command in Terminal:

sudo dpkg -i --force-all brmfc7340lpr-2.0.2-1.i386.deb
where everything after "force-all" was the name of the downloaded LPR driver. Note: this won't work if Synaptic or some other program updater is still running. Then, to test whether it worked, I typed this:
dpkg -l | grep Brother
which gave me something resembling a positive reply. Next, I edited the configuration file:
sudo gedit /etc/printcap
where the instructions told me to verify that, under the MFC7340 heading, the line beginning with ":lp" would say :lp=/dev/usb/lp0. Mine actually said :lp=/dev/usb/lp0:\ with an ending backslash, but I doubted this was crucial, so other than that it looked good. Now I needed to restart the print system by typing this:
/etc/init.d/lpr restart
But that appeared to be mistaken; I got "No such file or directory," and if I prepended "sudo" to it, I got "command not found." At this point, I plugged in the USB cable to the printer, realizing that there was probably no Ubuntu counterpart to the problem of screwing everything up by plugging in the USB cable before you've installed the drivers. And when I did that, something interesting happened. Ubuntu started looking for drivers, and wound up at a New Printer dialog that said, "Choose Driver." I chose the (default) "Select printer from database" option, and it defaulted to the Brother MFC-7225N BR-Script3, which it seemed to think was close enough to my MFC-7340. But it wouldn't proceed because it believed I was entering the wrong password for my local system, which I definitely wasn't. I couldn't get past that, so that was the end of the automated process. The "Printer configuration - localhost" dialog was showing a green circle with a check mark on an icon representing another, working printer that I had previously installed on this Ubuntu system, but there was no mention of this Brother printer. When I entered the command to print this page on which I am typing these words, I got a Print dialog showing options for that other printer, as well as a Print to File option and the nonworking CUPS PDF option, but this Brother printer did not appear there either. I decided to try the CUPS option. Its instructions seemed to continue on from where the LPR installation left off, so I had essentially completed the first several required steps to install CUPS. My next step, then, was to type this:
sudo dpkg -i --force-all cupswrapperMFC7340-2.0.2-1.i386.deb
where everything after "force-all" was the name of the CUPS driver I had downloaded. (Terminal was still parked in that same folder that I had navigated to earlier.) This gave me some error messages, including "Directory nonexistent." So then I ran this:
dpkg -l | grep Brother
and it gave me a list that mentioned both the LPR and the CUPS wrapper drivers. So it did look like they were installed. Next, in Firefox I went to http://localhost:631/printers." This gave me a cool HTML information webpage about my installed printers. Under the MFC-7340 entry, I went into Modify Printer and changed Device to "LPD/LPR Host or Printer" (an alternative would have been "AppSocket/HP JetDirect"). I left Device URI at "lpd" because this was a local printer, directly connected via USB. But it wouldn't let me go beyond that. The instructions said I needed to type this:
lpd://(Your printer's IP address)/binary_p1
So, OK, what was my printer's IP address? Someone suggested using nmap, so I installed that in Synaptic and typed "man nmap" at the Terminal prompt to view its manual. On the basis of what I read there, I concluded that I had no idea whatsoever how to use nmap. I probably spent an hour screwing around and ultimately tried this:
lpd://localhost/binary_p1
and that didn't work. My printer didn't seem to offer an option of printing a test page, or at least I couldn't find any reference to it in the manual. Only then did I realize that the cool HTML page (above) had already told me what the URI was: usb://Brother/MFC-7340. I don't know why the cool HTML page didn't just default to that, instead of giving me "lpd" on a line by itself. Now I was supposed to specify its model, but their list of options didn't include my model, so I chose the MFC-7225N BR-Script3 (see above). Then it was asking for a username and password, so I entered my ordinary Ubuntu username and password. But this was not what it wanted. So I tried again, entering nothing, and this gave me a completely blank page. I tried to print from the menu in Firefox in Ubuntu, and this gave me a dozen completely white pages. I tried with a different webpage and got 19 blank pages before I yanked out the paper tray - the Stop button on the printer wasn't stopping anything. I tried printing one page of a PDF and got the same thing. At this point, I had run out of time. I concluded that the Brother MFC-7340 was not, in practical terms, compatible with Ubuntu 9.04. Not to deny that people couldn't make it work. No doubt some could. But even with the devotion of a considerable amount of time, at present I could not.

Tuesday, September 1, 2009

Configuring 64-bit Ubuntu 9.04 with Vista Dual-Boot

I had a Compaq CQ60-420US laptop. It had come with Vista pre-installed. I didn't like that, so I wiped it off. This led to a whole ordeal in trying to get the hard drive to work with WinXP, for which I had developed lots of tricks and tweaks. That effort ultimately failed, and I wound up with Vista back on the thing after all. I had wanted to get away from dual booting, but I still needed some flavor of Windows for the occasional hardware interaction, e.g., updating the BIOS and other firmware. So for now, I was going to leave Vista in place and set up a 64-bit Ubuntu 9.04 (Jaunty Jackalope) dual-boot with it. This post describes the process of setting up that dual boot. A review of some guides gave me the general impression that installing a Vista-Ubuntu dual boot was much like installing a WinXP-Ubuntu dual boot, unless you used the wubi alternative. The approach I took was as follows:

  1. With Vista already installed, insert the Ubuntu program CD, reboot, and go through the ordinary installation sequence. If you do nothing, the CD will pretty much take you right to the Install icon. If your BIOS isn't set to boot from CD before hard drive, hit F2 or Esc or Del or F8 or whatever key it is that gets you into your BIOS setup, promptly after the computer first starts up, and adjust the boot priority there.
  2. You may find that the bootable Gparted CD provides a clearer view of hard drive partitions than does the partitioner in the Ubuntu installer. If the partitioning step leaves you dazed and confused, you may want to back up, download Gparted, burn yourself a CD, boot with that first, set up your partitions as you like, and then come back into the Ubuntu installation process. Note: if you're going to run Windows in a virtual machine, you may want to give it an NTFS partition somewhere, so you have a place to store data. Windows can't read Linux (e.g., ext3) partitions.
  3. After the initial installation, make sure that Vista starts up OK. No point spending hours refining a system that isn't ready for prime time. Then restart and go into Ubuntu, and make various adjustments, including these: (a) Nautilus > View > Show Hidden Files. (b) Nautilus > Edit > Preferences > Behavior > Always open in browser windows.
  4. Go through the steps described in my previous post on configuring Ubuntu 9.04 (including comments). That post updates the first part of an earlier post on how to configure 9.04. After running updates, type "sudo gedit /boot/grub/menu.lst" and put # symbols in front of each line (i.e., older Ubuntu kernels) that you don't want to appear in the GRUB menu.
  5. Before continuing with items in that earlier post (as explained in more detail there), I initially thought that the next step would be to install and configure Thunderbird (just plain old thunderbird, not mozilla-thunderbird) and Lightning-extension via Synaptic. But then I decided I would just use web-based e-mail and calendaring (probably via Gmail) on the laptop, and would download and archive my e-mails solely on my desktop, thereby sparing the need to synchronize the two computers.
  6. Now refer back to the earlier post, to install programs that came via individual downloads rather than through Synaptic. For me, these included Google Desktop for Linux, Adobe Reader, and VMware Workstation 6.5.3.
  7. I installed .deb files by double-clicking on them in Nautilus, and .bin and .bundle files by running "chmod +x [filename]" and then "sudo ./[filename]." I didn't have any .tar.gz and .tar.bz2 files to install this time, but if I had, I would have moved them to my /home/[username] folder, navigated there in Terminal, and then used a tar unpack command (e.g., tar -vxf [or tar xvfz] filename.tar.gz, or tar xvf filename.tar, or tar yxf filename.tar.bz2).
  8. To install Google Earth, continuing to follow my previous notes, I typed two lines: "wget http://dl.google.com/earth/client/current/GoogleEarthLinux.bin" and then "sh GoogleEarthLinux.bin." This gave me a Google Earth installation, but with flickering and basically nonfunctioning display. I tried System > Administration > Update Manager, and at first that program assured me that my system was up-to-date; but when I made it check again, it reported errors related to Wine and Opera. I ignored these for now, since they did not seem relevant. People seemed to be experimenting with the flickering video problem in Google Earth. There was a relatively complex tutorial that apparently fixed it in some cases, at the risk of messing up the system. Choosing instead an easy fix that seemed to work for some, I went to System > Preferences > Appearance > Visual Effects and downgraded from Extra to Normal. That didn't help. Following another tip, I downgraded further, from Normal to None (i.e., no visual effects), and also turned off the Atmosphere feature in Google Earth (View > Atmosphere). That fixed it.
  9. To configure Firefox, I went to another computer and used the FEBE extension to make a full backup of that machine's Firefox installation. I copied the folder containing the FEBE backup to the target computer (i.e., the one where I've been doing all this installation stuff). I installed FEBE in Firefox on the target machine, restarted Firefox, started to watch the tutorial on restoring with FEBE, turned to the instructions on manually restoring with FEBE, and then took these steps on the target machine: Close Firefox. Go to the FEBE backup directory (i.e., the one where I put the FEBE backup folder that I copied over from the other computer). Copy its .fbu file (in my case, profileFx3{default}.fbu) and rename the copy as a .zip file. I called it FEBErestore.zip. Extract the contents of the .zip file (creating, in my case, a folder called FEBErestore). Move the contents of the FEBE restore folder to the Firefox profile folder, which I found in Nautilus at File System/home/ray/.mozilla/firefox/[random name].default. In my case, for example, I moved the contents of the FEBErestore folder to this .default folder. When it told me that a folder already exists, I said Merge All, and Replace All for the "file already exists" message. During this process, I got an "Error while copying 'febe.jar'" message. The details of the error said "Permission denied." I canceled and tried again as root (type "sudo nautilus" and then do the move in the Nautilus session that opens that way). That worked. Then I closed everything else and started Firefox and, yeah, it looked like all the extensions were there, configured and everything.
This was the extent of my Ubuntu configuration for now. During these processes, I came across some miscellaneous issues:
  • I wanted to change login passwords. This, I thought, would be under System > Administration but no, eventually I found it instead under Applications > Accessories. Double-clicking on that did not work; I had to right-click and choose Change Password; but then the password that I changed it to did not work for login. I thought the problem might be that I hit Enter instead of clicking on the button after doing the change; that is, possibly the default was Cancel rather than Change. I could not tell; neither button seemed to be highlighted by default. So then it turned out that I had changed the password to unlock the keyring, rather than the password to log in. It looked like I had changed that properly, second time around; but still no.
  • As in other Ubuntu installations, panels did not readily allow me to move icons to the locations I would designate. Sometimes they would not move; sometimes they would not go exactly where I indicated. On the bottom panel, for example, I could not rearrange them in the far right corner. It turned out to be easier to move things *out of* the corner (where the Windows system tray would be) than to move them *into* the corner. It turned out that I had to unlock every item that I wanted to drag another icon past. Tooltips came up, irritatingly enough, when I was trying to move icons, making it difficult to see what I was doing.
  • The bottom panel failed to show icons or buttons for my currently running programs. The solution was to right-click on the bottom panel, choose Add to Panel, and choose Window List. But then, on reboot, it did not work again. I fixed it by right-clicking on the end of the Window List item on the bottom panel and checking Lock to Panel.
  • When trying to view the contents of some hard drive partitions, such as a partition I called DATA, I got "Cannot mount volume. You are not privileged to mount the volume 'DATA'. Following my previous notes, in Terminal I typed "sudo mkdir /media/DATA," thinking that perhaps I had not yet created the mount point, but this gave me "cannot create directory `/media/DATA': File exists." I typed "sudo nautilus," went to File System > /media/DATA > right-click > Properties, and verified that I (i.e., user "ray", not just root) had full permissions. I typed "sudo fdisk -l" (that's an L, not a one) to get a list of devices. That showed that the DATA partition was being recognized as an NTFS device at /dev/sda4. I typed "sudo gedit /etc/fstab" and saw that there was no line in the fstab file for /dev/sda4. Following some notes from a few months earlier, I typed "sudo ntfs-config." (Note that this was one of the programs I had installed from Synaptic, above.) This detected the VISTA programs partition (i.e., drive C in Windows), but not the DATA partition. I ran ntfs-config again. This time, it didn't mention the VISTA drive, but as before it did give me the option to enable an internal drive. I accepted that. Now I saw that there was indeed a line for the DATA partition as well. While I was here, I used blkid to find the UUIDs for each partition (e.g., "sudo blkid") and replaced that portion of the relevant line in fstab. For example, the line that previously read "/dev/sda1 /media/VISTA ntfs-3g defaults,locale=en_US.UTF-8 0 0" now began with "UUID=19142FAA142F8D35" instead of "dev/sda1." Following the format of other lines in fstab, I preceded this one with a line that said, "# Entry for /dev/sda1 : " and followed a similar procedure for the DATA partition. I rebooted and was now able to view the NTFS-formatted VISTA and DATA partitions. On second thought, I went back into fstab and removed the line for the VISTA partition, since I didn't expect to need it normally in Ubuntu and didn't want to expose it to accidental deletions and such.
This seemed to give me a basic working dual-boot 64-bit system. The next step, for me, was to configure VMware, so that I could run any Windows program within Ubuntu.

Tuesday, August 25, 2009

Installing Ubuntu 9.04 (Jaunty Jackalope): Update?

In a previous post, I detailed the steps I took to install and configure 64-bit Ubuntu 9.04 (Jaunty Jackalope). A few months later, I had an opportunity to install 64-bit Jaunty again - this time on a laptop. I used that previous post as an installation guide. This post refines and summarizes the steps detailed in that previous post.

First, in Ubuntu, choose these options: System > Administration > Update Manager > Check. (This one would ideally be postponed until you've done a couple of these other steps, but it may insist upon being run early in the process, in which case you may want to repeat it later.) Install updates. Restart if advised, and then run Check again, until there's nothing left to update. Applications > Add/Remove > Show All Available Applications. Then search for "restricted extras." Check the box next to "Ubuntu restricted extras." Click Apply Changes > Apply. System > Administration > Hardware Drivers. I was using an nVidia graphics card, and here I saw that my system was not using nVidia drivers, and that I did have a couple options to choose from. I chose to activate the recommended driver. I had to reboot before it would take effect.

System > Administration > Software Sources. Go to the Ubuntu Software tab > Download From > Other > Select Best Server > Choose Server. Also, go to the Third-Party Software tab, click Add, and type (or copy and paste) these lines, one at a time, from Launchpad's X-updates webpage into the "APT line" box:

deb http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu jaunty main

deb-src http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu jaunty main

(Each of those is a one-line command.) I had to click "Add Source" after each one in order to be able to install the next one. I also checked the boxes next to the two archive.canonical.com sources on that Third-Party Software tab. Then click Close. This called for a Reload of current software information. Before doing the reload, open Terminal and type these two lines:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [OpenPGP key id]

sudo apt-get update

The OpenPGP key id came from the same (in this case, Launchpad's) webpage. What appeared on that webpage was "Signing key: 1024R/AF1CDFA9." The part that I needed to paste into the "sudo apt-key adv" command (above) was the part after the slash, i.e., AF1CDFA9. (If you don't get a "Reload" option when you click Close, go back into Third-Party Software and unclick and then re-click some item and try again.)

Remove Partition Icons from Desktop. A mere tweak, but it's easy. Alt-F2 > gconf-editor > Run > apps/nautilus/desktop. Unclick volumes_visible. Close the Configuration Editor. System > Administration > Synaptic Package Manager. Search for each of these items and mark for installation when it comes up: boinc-manager; cups-pdf; fdutils (if you expect to be using a floppy drive); flashplugin-installer; gparted; ntfs-config; ntfsprogs; p7zip-full; pysdm; sun-java6-jre; and sysinfo. Also, optionally, uninstall evolution. (If numerous items come up in response to your search, click on the Package heading to sort them alphabetically. If some are already installed, no worries. Some of these may ask if you want to "Mark additional required changes?" Click "Mark" and go on to the next one.) Then click Apply > Apply. Then run System > Administration > Update Manager once more.

Optionally, move and/or reconfigure panels (i.e., the bars running across the top and bottom of the screen) and/or items on panels. Example: to make the bottom right-hand corner of the screen more similar to that of Windows, right-click on the left edge of the segment of the top panel that containts the date and time, unlock, move, and relock.

At this point, in a problem that had not come up during my previous installations of Ubuntu 9.04, I was not able to get the system to recognize my external USB hard drive. I have detailed the process of fixing that in a separate post. That problem ultimately involved wiping my hard drive and starting over with a new Vista-Ubuntu dual-boot installation.

Monday, August 10, 2009

Another Try with VMware Workstation and Player

In a previous post, I described how I was sometimes getting no audio from my VMware virtual machines (VMs), at times when my 64-bit Ubuntu 9.04 (Jaunty Jackalope) installation on that same computer was able to play the same files without a problem. I experimented with VirtualBox as an alternative, but that was coming along slowly at this point, so I decided to give VMware another try. I had been using 64-bit VMware Workstation 6.5.2 to run 32-bit Windows XP VMs on this computer. I now recalled that, lately, I had begun to use VMware Player instead of Workstation to run some of my VMs. I wondered whether Player was somehow messing up my audio settings or my VMs, such that only a reboot or restart of the VM, of VMware, or of the whole computer would fix it (and sometimes that didn't even do the trick). I think what got me wondering about this was one occasion when I was not able to play an audio file in a VM in Player; but then, without rebooting or restarting anything, I opened another VM in Workstation and was able to play audio just fine - and then the audio in Player was OK too. I hadn't really been paying attention, and therefore wasn't sure that this was exactly how the sequence had unfolded; but I thought it was worth a second look. About a day later, I got my first renewal of flakiness from VMware. I was running a VM in Player. I minimized it and went to work on a different VM in Player. When I went back to the first one, I couldn't find it. That is, there was no entry for it in the taskbar at the bottom of the screen. I had learned, by now, that this didn't mean it had closed down; it just meant it was hiding. On Ubuntu's top panel (i.e., the taskbar running across the top of the screen, which in my case I had moved to the left side of the screen because left-right real estate was less crucial than top-bottom real estate, on my widescreen monitor) I saw the icon showing that VMware was up and running. I clicked on that and, sure enough, there was the name of that hidden VM. I clicked on it. It opened up - but not in Player. It opened up in VMware Workstation. This had happened several times previously, but this was the first time when I was absolutely sure, when I was watching for it. I made it full-screen and resized a few windows in Workstation - it had resumed in less than full-screen mode, which meant (in VMware's way of doing things) that all of the windows I had running in that VMware session were automatically resized - and then I clicked on the top panel. Workstation vanished. I went back to that icon in the left-side panel and brought that VM back onscreen yet again. Fortunately, the audio was still working, so this was as far as my bug-hunt was able to progress at this point. But it did make me wonder, again, whether VMware Player was part of the problem. At present, my sense was that running each VM in its own session of VMware Workstation was the most stable way to go. Postscript: two weeks later, running only Workstation since writing this note, I conclude that Player was indeed the problem. This problem has not recurred for me in Workstation.

Tuesday, July 28, 2009

Installing and Using IrfanView for Audio in Ubuntu 9.04

I have an Olympus VN-960PC digital voice recorder (DVR). It saves its recordings in compressed .wav format files. When I listen to those recordings, I usually use IrfanView to listen to them. I have been using IrfanView for years, and have found it to be markedly more useful and flexible than any other program for many image editing, audio listening, file viewing, and other multimedia tasks. It is really amazing freeware.

I use IrfanView for this particular task because I have not yet found another program that allows me to move from one recording to the next so quickly. I listen to the notes I have saved on the DVR; I highlight some of them, one by one, in Windows Explorer, and then I cut and paste the selected recordings to subfolders for further use. I have developed the habit of beginning many of my recordings with a single word (e.g., "Monday" or "shopping"), so I know right away which folder it goes into. Sorting a number of audio recordings this way is very fast.
IrfanView was a Windows-only program. I could not find anything in the Linux world that could replace it, for my purposes, so I looked for ways to run it in Ubuntu. One possibility, which I used for a long time, was to run it in a virtual machine in VMware Workstation (or perhaps I could have used a freeware virtualization program) on Ubuntu. I was engaged in a long-term effort to move away from dependence on Windows, though, and sometimes virtual machines could be somewhat clunky.
Finally, at one point I reached a situation where I invested a bunch of time and still could not resolve a VMware audio problem. This seemed to be the opportunity to try running IrfanView, a Windows program, in Ubuntu. I planned to do so via Wine, which (in that wacky Linux way) is short for "Wine is not an emulator." The stable release of Wine at this point was 1.0.1, and that is the version that was available in Ubuntu's (System > Administration > ) Synaptic Package Manager. I searched for wine in Synaptic, marked it, and clicked Apply. It downloaded and installed the necessary stuff. Next, following the steps I had researched when I had tried Wine a year earlier, I proceeded as follows, typing these commands into Ubuntu's (Applications > Accessories > ) Terminal at the command prompt:
wget http://www.kegel.com/wine/winetricks
sh winetricks mfc42
Then, in Ubuntu's File Browser (Places > Computer), I navigated to the folder where I had saved the downloaded IrfanView program. This program was called iview425_setup.exe. I copied the Location of this folder from the address bar at the top of File Browser and put it, between quotation marks, after a cd command in Terminal, as follows:
cd "/media/CURRENT/Miscellany/Installation/Programs"
and then I typed the Wine command to install IrfanView:
wine iview425_setup.exe
This gave me the regular IrfanView Setup dialog, just as if I had been installing it in Windows. I told it to install a link on the desktop, and it did; but I could not get that link to run. So I used cd again, to get to where it had been installed (cd "/home/ray/.wine/drive_c/Program Files/Irfanview", where "ray" was my username), and typed wine iv_uninstall.exe. This removed everything except iv_uninstall.exe itself from that folder; I deleted that last file manually.
I decided to try an older, simpler version of IrfanView. I went to OldApps.com and downloaded IrfanView 3.0. Then, as above, I used cd to navigate to the place where the downloaded file was. In this case, the program (after extraction from the downloaded .zip file) was named i_view32.exe, so I used that instead of iview425_setup.exe in the installation command presented above, as follows:
wine i_view32.exe
Unfortunately, this installer did not run at all. About this time, I rediscovered Wine's reports on the various efforts people made to run different Windows programs under Wine. In particular, I found the reports on IrfanView. These, supplemented with the instructions and replies posted at Wine-Reviews.net, seemed to indicate that what I really needed was to use relatively recent versions of both Wine and IrfanView.
To get a version of Wine more recent than the one that was available in Synaptic (above), I had to modify Synaptic. That is, I had been using Synaptic out of the box, the way it came in the original Ubuntu installation; but Synaptic could be configured to look in additional places for more software. In this case, I wanted it to look in the WineHQ repository. So I went back into Synaptic and clicked on Settings > Repositories > Third-Party Software > Add. In the APT line box, following the WineHQ instructions for Ubuntu 9.04, I typed this:
deb http://wine.budgetdedicated.com/apt jaunty main #WineHQ
Then I clicked on Add Source. Next, while still there in Software Sources, I went to the Authentication tab and clicked on Import Key File. I didn't have the key file yet, so I had to go to the webpage that they call Scott Ritchie's Key to get it. I saved that page (in Firefox, the command is File > Save Page As). Its default name was Scott Ritchie.gpg, so I accepted that. So now, back in the Software Sources > Authentication > Import Key File window, I navigated to where I had saved Scott Richie.gpg and selected it. Then I clicked on Close > Close. Now, back in Synaptic, I clicked Reload. I could have done a Quick Search, there in Synaptic, to see that Wine now needed to be updated; but I decided instead to update everything on my system that might need to be updated at that point. So I closed Synaptic and went to System > Administration > Update Manager and installed everything it had for me.
Normally, it can be more convenient and/or easier to remember one's way around by using the Graphical User Interface (GUI), as just described. In this case, though, for some reason the whole thing about Scott Ritchie was a little weird and hard to remember (though not Scott Richie himself, oh, no, we'll never forget ol' Scott), and I would probably have found it simpler just to copy and paste these lines into Terminal from the bottom of the WineHQ instructions page:
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/jaunty.list -O /etc/apt/sources.list.d/winehq.list
sudo apt-get update
sudo apt-get install wine
but whatever. It was done, and I had my other updates to boot. Plus, I got a free opportunity to screw around with Synaptic. (Later, I discovered that I should have uninstalled the older version of Wine first. I also discovered that apparently I should have been doing my work in a folder dedicated to Irfanview.) Now, at any rate, I had some more recent version of Wine installed. To see which one, I went back into Synaptic and searched for Wine again. It was 1.1.26. This was more bleeding-edge than the 1.1.14 that they had used in that Wine-Reviews article. I wasn't sure how to get back to 1.1.14, though, and anyway that was a half-year earlier, and they were using Ubuntu 8.04, so maybe this was better for my purposes. The Wine-HQ report indicated that Sven Plaga had just recently used 1.1.25 with great success. The version of IrfanView that Sven had used was apparently 4.25. He had used it with a beta release of Ubuntu 9.10, which I wasn't up to yet; but if it worked now, I figured that might defer whatever updating I might otherwise have to do later.
So now I tried again to install IrfanView on this newer version of Wine. I had already done the whole winetricks and mfc42.dll routine (above), so this simplified the process for me. Following the Wine-Reviews and Wine-HQ instructions and comments (with some help from some older Ubuntu Community Documentation), I repeated the foregoing steps of navigating to the folder where I had stored iview425_setup.exe, and then I typed this:
wine iview425_setup.exe
The installer ran, but again I couldn't get IrfanView to start. This time, though, it was not surprising. According to the instructions, I next needed to go into the installation directory (in my case, /home/ray/.wine/drive_c/Program Files/IrfanView) and delete the i_view32.ini file. The comments indicated that IrfanView would replace it with a simpler i_view32.ini that would cause no problems. I had forgotten to download and install the IrfanView plugins, so I did that now:
wine irfanview_plugins_425_setup.exe
Now I had an embarrassment of riches, in terms of IrfanView launchers. There were three different Ubuntu icons on my desktop, and they all worked. I deleted the two that didn't have the Ubuntu red cat (or whatever that is) on them. I also saw that Wine had installed itself as an option under Applications on the Ubuntu menu, and under Wine > Programs I had an IrfanView menu plus an apparent freebie, a link to an actual working copy of Notepad.
The key question, now, was whether IrfanView would now function in Ubuntu as it had functioned in Windows, for purposes of listening to and moving through .wav files. I went into IrfanView's Options > Properties and adjusted the settings to my preference. Then I double-clicked on an audio file . . . and watched it open in Totem Movie Player. OK, so this was my opportunity to learn how to set the default application program in Ubuntu. I started to Google for some guidance, and then I realized this was probably somewhere under System > Preferences - and, sure enough, there it was: Preferred Applications. I went to Multimedia and indicated that I wanted to use a Custom multimedia player. I right-clicked on the IrfanView desktop icon and went into its Properties > Basic tab. I copied its Command line to Terminal, to try it out. It worked: IrfanView started. So then I copied that same command line into the Multimedia command box. But either way, with or without the "Run in terminal" box checked, it didn't default to IrfanView; I was still getting Totem. So yes, I had to Google the question after all. The answer was easy enough (apparently a lot easier than it had been a year earlier): right-click on a .wav file and select Properties > Open With > IrfanView > Close.
Ah, but now, when I double-clicked on a .wav file, I got an error message:
Error: Windows can't play this file! Windows error text: Invalid MCI device ID. Use the ID returned when opening the MCI device.. You can try to install additional video/audio codecs from this site: http://www.fourcc.org/indexcod.htm or try the DirectShow option in Properties->Video.
Weird thing: I got that same error message three or four times in a row. I'd click OK, and there it would be again. And then, when it stopped, I got a little "No Device" window and the audio file played after all. But then that No Device window wouldn't go away; I had to kill IrfanView to banish it. I went into IrfanView's Properties and tried clicking the DirectShow option as advised. Same result. Seeking truth, I went back to Google. And I could tell that I was at last getting close to the truth indeed, because this time my search turned up only a small number of results, none of which seemed relevant. Fortunately, I was able to revise my search into something even less helpful. As the day drew to a close, I posted a question on this at Wine-HQ. Someone there suggested that I should post it as a bug in Wine, so I did that. I didn't know how long it would take them to address and resolve this bug, if that's what it was, so I decided it was time to post this message as-is and think about other ways of getting Irfanview to work.

Sunday, July 19, 2009

Recognizing Partitions Automatically in Ubuntu 9.04

In Ubuntu 9.04 (Jaunty Jackalope), disk partitions normally remain unmounted until you mount them manually. One way to do this is to start Ubuntu's File Browser (also known as Nautilus). You can do this by choosing the Places > Computer menu option. In File Browser, just double-click on the drive you want to mount, and its name will appear under the File System > Media folder there in File Browser. You can also mount drives by typing commands into Ubuntu's command-line window (Applications > Accessories > Terminal). First, type "sudo mkdir /media/[drivename]" to create a mount point. After doing this for all unrecognized drives, type "sudo mount -a".
But instead of doing this sort of thing, I wanted the system to recognize my drives on bootup, so that I would not have to mount them manually each time I rebooted. In my first approach to this problem, I typed "sudo ntfs-config." This approach worked OK on one computer, where I was doing a clean installation -- where, that is, I had formatted the partition before installing 9.04 on it. But on another computer, I installed 9.04 on top of 8.04 without formatting the partition. This was advantageous in that it preserved lots of files and settings from before. The drawback was that I was running into funky problems with ntfs-config.
On this system, I got an error message when I ran ntfs-config. The message was, literally, "Error : An error occured when trying to configure [partition name], please retry. Thanks." (For those who are searching with the correct spelling, let me retype that error message: "Error: An error occurred when trying to configure . . . ." When I tried to examine the partition in GParted (i.e., System > Administration > Partition Editor (see above)), I got this: "Warning: Unable to read the contents of this file system!" The partition had been available a minute earlier, when I had booted into Windows XP, and I had shut down WinXP normally before rebooting into Ubuntu. So I didn't think the partition was truly hosed.
I found a very, very long thread on the subject, but post no. 2015 in that thread said the thread's advice was outdated for purposes of newer versions of Ubuntu. In another thread, someone said they got this error message after installing a newer version without formatting the partition, and solved it by deleting the mount points. I had a fresh backup of the partition in question, so I tried taking that approach. First, I opened File Browser and went to File System > Media > CURRENT. File Browser said that partition was empty. When I right-clicked on it, however, File Browser didn't give me an option of deleting it. Its Properties said it was owned by root, so I logged in as root (see above), typed "cd /media", typed "dir" to make sure CURRENT was there, typed "dir CURRENT" to make sure it was empty, and then typed "rm -r CURRENT" to delete it. I restarted the system, started File Browser, went to Computer (in the Tools bar), double-clicked on CURRENT, and it was there, with all its contents. CURRENT was formatted in ext3 (i.e., Linux). I had another partition that was having the same problem. It was formatted in NTFS (i.e., Windows). But now that I had rebooted, it too was available and looking fine.
I dropped this issue for the time being. Next day, when I rebooted, I found that, predictably, the various partitions were not mounted. In Terminal, I typed "sudo gedit /etc/fstab." My fstab file did not show the partitions I wanted to be mounted automatically. I reviewed one of my old posts on ntfs-3g. It seemed to say that ntfs-config was the solution. I tried running ntfs-config again. This time, it ran. It recognized two NTFS partitions. Now I just had two ext3 partitions to set up for automatic mounting. I went back into fstab and saw the lines that ntfs-config had added. I hadn't thought to save the fstab file from my previous installation; it would have been handy to copy over the relevant lines. From the previous post, I gathered that the trick was to write something like this in fstab:
/dev/sda3 /media/VMS ext3 defaults 0 0
for the VMS partition, and likewise for the other ext3 partition. I double-checked that I had the right device addresses by checking them in System > Administration > Partition Editor (i.e., GParted). I rebooted, but the ext3 partitions were still not automounted, though the NTFS partitions continued to be automounted nicely. I didn't know why the line just shown, for the VMS ext3 partition, did not work in fstab now; according to the old post, it had worked in Ubuntu 8.04. Ubuntu documentation said something about pysdm, so I looked into that. They suggested typing this into Terminal:
sudo apt-get install pysdm
but I saw it was available in Synaptic (i.e., Ubuntu's System > Administration > Synaptic Package Manager menu pick), so I used that instead to install pysdm. I typed "pysdm" at the Terminal prompt, but got an error message indicating that I had to have root privileges, so I tried again with "sudo pysdm." (Also available via System > Administration > Storage Device Manager.) That gave me a Storage Device Manager (SDM) window that listed some, but not all, of my partitions. I noticed that, if I started pysdm while I still had the foregoing /dev/sda3 line for my VMS partition in my fstab file, SDM would not give me an option of configuring the VMS partition; but if I deleted that line from fstab and then started pysdm and clicked on sda3, SDM would give me a "Configure now?" dialog with the message, "/dev/sda3 hasn't been configured. Do you want to configure it now?" I said OK. I told it to set the mount point to File System > Media > VMS. Then I clicked on the Assistant button and saw that the option was checked that said "The file system is mounted at boot time." I also checked the option that said, "Check file system at mount time" on the options dialog's Mounting tab. I didn't change any other options. When I checked OK to leave Assistant, I saw an error message in Terminal: "wrong fs type, bad option, bad superblock on /dev/sda3, missing codepage or helper program, or other error." I went back into Assistant and removed the "Check file system" option I had just checked. This time, when I left Assistant, I got Warning messages that said, "Unknown option: rw" and "nouser is not suitable for user" and "Unknown option: async." I clicked on the "Set defaults" button in SDM and then clicked Apply. This produced no additional Warning messages in Terminal. Trying once more, I just went into Assistant and immediately executed, and this did produce the same Warning messages, plus an additional one that said, "Unknown option: defaults." I tried just emptying out the Options box altogether in SDM. Then I clicked Apply. I did the same with the other ext3 partition that was not yet mounting automatically. I restarted the system.
It occurred to me that I may not have restarted the system previously, but may merely have logged out and logged back in. Ubuntu 9.04 seemed to require two steps to reboot, and it seemed that I had forgotten to take that second step last time around. This occurred to me right around the time when I tried to restart the system and found that it froze with a black screen. Evidently my fstab file was not presently in an acceptable form. I punched the computer's reset button and rebooted with the Ubuntu installation CD, chose the "Try Ubuntu" option, and edited fstab as above. (Note that there's an fstab on the CD too; make sure you're editing the one on the hard drive.) I saw that I had failed to add the preferred mountpoint for one of my ext3 partitions: it said "/media/sdc5" instead of "/media/CURRENT." I fixed that and rebooted without the CD. This time, the system booted OK. But those two ext3 partitions were still not automounted.
In File System > media (i.e., /media), I noticed that there was a mount point for the VMS partition, but it had nothing in it. I typed "dir" to make sure there was nothing there, and then typed "sudo rm -r VMS" to delete it. I also deleted the "sc5" mountpoint mentioned above. In File Browser, I clicked on the Computer button at the top and then double-clicked on each of these two partitions (i.e., VMS and CURRENT) to create mountpoints (i.e., /media folders) for them. I tried rebooting again. They still weren't automounting, and the mount points I had created for them were gone, as I should have expected. Incidentally, at this point I discovered that the custom was apparently to mount fixed hard drives at /mnt, and use /media for removable hard drives.
About this time, I discovered that I had commented out the lines added by SDM (i.e., I put # signs (also called hash marks) in front of each of those lines). I forgot. I had done that to troubleshoot fstab, and then didn't go that route after all, and forgot to remove them. So I removed the hash marks now and rebooted. But that wasn't the solution. I re-ran SDM, went through more or less the steps described above, and rebooted. This time, it worked: the partitions were automounted, and their contents were visible. Not sure exactly what was different this time, but something was. So I guess the conclusion is, if it doesn't work in SDM the first time, tinker around for a while, reboot a couple of times, try SDM again, and reboot.

Monday, May 11, 2009

Installing 64-bit VMware Workstation 6.5.2 on 64-bit Ubuntu 9.04

In 2008, I had gone through quite an ordeal to install VMware 6 on 64-bit Ubuntu. What a difference a year makes! By now, VMware was now up to 6.5.2, and Ubuntu was up to 9.04. Also, I had a much better idea of what I was doing. The installation was vastly easier as a result. After installing and configuring Ubuntu, I downloaded the latest version of 64-bit Workstation in .bundle form, copied it to /home/ray (where "ray" was my username), and installed by navigating to that location in Terminal and typing "sudo sh [filename].bundle." In this case, the filename was VMware-Workstation-6.5.2-156735.x86_64.bundle. (To uninstall, go to /home/[username] and type "sudo ./[filename].bundle -uninstall." Stop after the uninstallation portion of the program sequence.) I skipped the "Path to Eclipse directory" option. The installer ran. I got "Installation was successful." To configure Workstation, I typed "sudo /usr/bin/vmware." This opened Workstation as root administrator. I was then able to set Edit > Preferences. The next step was to set up virtual machines (VMs). I had two sources of VMs. First, I had a Windows XP installation that I wanted to convert to a VM. I had been using this installation every day for several weeks and had installed a bunch of software on it. Also, I had been having some weird freezes in Adobe Acrobat, and I wanted to see whether these were caused by the hardware on that particular computer. I figured that if I didn't get the crashes when I ran Acrobat on virtual hardware in a VM, then the physical hardware probably was the culprit. Second, I had some preexisting VMs that I had been using on my previous VMware installation. They had worked reliably, and they were also quite a bit smaller (and would therefore load and back up faster) than the 35GB I had allocated for this latest installation. So, first, to convert that WinXP installation, I booted into Windows, and downloaded, installed, and ran the latest version of VMware Converter. (At this point, that version was 4.0.0.) In this version, I clicked on "Convert Machine" to run it. The first time through, I then ran "Configure Machine" to make it bootable; but I don't believe I did run it when I tried again a second time. In both instances, I indicated that I was talking about VMware Workstation, not a VMware Infrastructure VM. In case it is indeed necessary to run the Configure Machine process, here are the steps in that processs. Configure Machine brought me a message that I needed Sysprep files. These came in different versions, depending on whether the computer had been updated for XP Service Pack (SP) 2 or SP3. (They were supposedly also available on the CD at \Support\Tools\deploy.cab. If you use the CD, remove it before proceeding with the following steps.) I had installed SP3, so I used the instructions for that service pack. For my purposes, the steps to install the Sysprep files were as follows:

(1) Save a copy of deploy.cab on the hard drive, so I wouldn't have to look for it if I didn't like my first VM and needed to recreate it. (2) Double-click on deploy.cab to open it up. (A .cab is a "cabinet," i.e., storage, file.) (3) Copy its files named sysprep.exe and setupcl.exe to a folder named C:\Sysprep. (4) In C:\Sysprep, double-click on sysprep.exe. Select "Don't reset grace period for activation" and set Shutdown mode to "Shut down." Then click Reseal. This should give you a "Sysprep is working" message. It didn't work right for me the first time, but after rebooting it did its deed in just a few seconds.
On the second run-through, I rebooted into Ubuntu, then continued with the following steps. I started Nautilus as root (i.e., "sudo nautilus") and changed the permissions (right-click > Properties) of the /home/ray/.vmware folder so that the user named ray (as distinct from root) had permission to create and delete files in that folder. Then I started the VM, but I got "Error: Cannot open file '/home/ray/.vmware/preferences': Permission denied. Unable to read user preferences." Fortunately, time heals all wounds. When I came back to the installation process at this point, a couple of weeks had gone by and I really had no idea what I was doing previously, but I could see that problem just described seemed to have gone away. So if this happens to you, the recommended solution would be to put your computer in a closet and go on vacation. When I got back to it, I had a new problem. The problem was that my CNN news report videos weren't playing. For this, the recommended solution was to install 64-bit Adobe Flash Player. I followed the instructions to download that. It was a tar.gz file, and this time, instead of using the "tar -zxf filename.tar.gz" command that I had used previously, I tried right-clicking and selecting "Open with Archive Manager." (Not sure if that option had existed in prevous versions of Ubuntu.) This showed me a file called libflashplayer.so. I right-clicked and extracted it to the desktop. I used Synaptic to completely uninstall nsplugin. In File Browser (Nautilus), I enabled "Show hidden files" and moved libflashplayer.so to the .mozilla/plugins folder in my Home directory. That worked for many people, but not for me. I tried again as root (i.e., type "sudo" at the Terminal prompt before any other command -- in this case, "nautilus") and moved it instead to /usr/lib/mozilla/plugins, as one commenter on that instruction webpage suggested. I also tried "sudo killall firefox." Still no luck.
Here, for posterity, were a couple of random notes that I made while I was attempting this installation:
As root, set VM > Settings. As root, in the VMs, type "/dev/audio" in place of "Auto Detect" in VM > Settings > Hardware > Sound Card.
To install VMware Tools in a VM, first use VM > Install VMware Tools. Then, in Windows Explorer, go to drive D and run Setup. May have to insert WinXP CD in the physical CD drive during this process. Better if you've copied the WinXP CD's i386 folder to the VM previously; can just point there for some installation files.
At about this point, I gave up on trying to get VMware to work on that machine. I turned instead to the machine where I had been running Ubuntu 8.04 with VMware Workstation for the past year. I did an upgrade installation of Ubuntu 9.04 on that machine and installed Workstation 6.5.2 there. I used pretty much the approach described above. The upgrade type of installation seemed to save a lot of steps, though; I went right into using Workstation without much delay at all.
I did continue to have a problem, in the new setup, that I had had on that same machine in Ubuntu 8.04. The problem was that if I ran more than one VM at a time, the whole computer would crash when I tried to suspend or close on of them. On the new installation, I didn't get crashes, but VMware became nonworking all the same. I would just get a mostly blank white screen. I couldn't figure out a solution, so I posted a question on this problem.
While I was waiting for someone to suggest an answer, it occurred to me that maybe I could open a separate session of VMware Workstation for each of my VMs. In early testing, at this point, it appears that having eight sessions of Workstation open at once (even if nearly all of the VMs themselves are shut down or suspended) does degrade performance in any given VM. I will be experimenting with how many VMs I can have open without too much of a performance penalty. This approach does seem, so far, to solve the problem of Workstation crashing or becoming unresponsive.

Friday, May 8, 2009

Configuring 64-bit Ubuntu 9.04 (Jaunty Jackalope)

In a previous post, I described my experiences with upgrading from Ubuntu 8.10 to 9.04. The previous post also provides some cautionary notes on upgrading from the ext3 to ext4 filesystems. This post describes the process of configuring 9.04 from scratch, after downloading the ISO file and burning it to CD. (For future troubleshooting purposes, you may also want to download and burn the "alternate" ISO file.) The basic installation was pretty simple: insert the CD, boot the computer, and follow the instructions. The main exception was the partitioning step, especially if the machine had several partitions. I defer to other websites that provide details on the basic installation. In my first try, I started by installing and configuring Firefox extensions, but that was very time-consuming, so I decided to save that for later, in case I would have to re-do my installation. What had forced me to start over in my installation was related to compiz, so I decided to start there, this time, and make sure that part was OK before proceeding with the rest. The specific problem I had run into had come up when I was following the advice at 10 Tips for After You Install or Upgrade Ubuntu. The gist of it is that I tried installing fusion-icon, wound up with the black screen problem that lots of people seemed to be having, went through a whole hassle (documented elsewhere), and decided not to use fusion-icon. On my next try, I also decided not to use compiz, which was also causing unexpected behavior in my system. I also wasn't using wine. Therefore, the 10 Tips, modified for 9.04 and combined with some other tips, so as to do things in the best order, came out as follows:

System > Administration > Update Manager > Check. (This one would ideally be postponed until you've done a couple of these other steps, but it may insist upon being run early in the process, in which case you may want to repeat it later.) Install updates. Restart if advised, and then run Check again, until there's nothing left to update. Applications > Add/Remove > Show All Available Applications. Then search for "restricted extras." Check the box next to "Ubuntu restricted extras." Click Apply Changes > Apply. System > Administration > Hardware Drivers. I was using an nVidia graphics card, and here I saw that my system was not using nVidia drivers, and that I did have a couple options to choose from. I chose to activate the recommended driver. I had to reboot before it would take effect. System > Administration > Software Sources. Go to the Ubuntu Software tab > Download From > Other > Select Best Server > Choose Server. Also, go to the Third-Party Software tab and add other stable repositories. (On that webpage, under the "Install packages" heading, where it says "Display sources.list entries for" choose "The Jaunty Jackalope." Then copy the lines from the text box immediately below that heading. For instance, I copied and pasted these two lines, one at a time, into the dialog box that said,"Enter the complete APT line of the repository that you want to add as source":
deb http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu jaunty main
deb-src http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu jaunty main
(Those are each one-line commands.) I had to click "Add" after each one in order to be able to install the next one. Then click Close. This called for a reload of current software information. If you don't get a "Reload" option when you click Close, go back into Third-Party Software and unclick and then re-click some item and try again.
Remove Partition Icons from Desktop. A mere tweak, but while we're doing the 10 Tips, it's easy. Alt-F2 > gconf-editor > Run > apps/nautilus/desktop. Unclick volumes_visible. Close the Configuration Editor. System > Administration > Synaptic Package Manager. Search for each of these items and mark for installation when it comes up: cups-pdf; firestarter; flashplugin-installer; gparted; ntfs-config; p7zip-full; pysdm; and sun-java6-jre. (If numerous items come up in response to your search, click on the Package heading to sort them alphabetically. Also install other related packages, if given the option.) Some of these may ask if you want to "Mark additional required changes?" Click "Mark" and go on to the next one. Then click Apply. (I initially installed, but decided not to keep, compizconfig-settings-manager and emerald. They appeared to be generating multiple problems for others and were not functioning well on my machine.) Some of these programs may already be shown as being installed on your system. If so, no problem.
Next, I closed that and ran Update Manager once more. I went to System > Administration > Firestarter to configure the Firestarter firewall. I had second thoughts after installing it; it seemed that some people had problems with it. It was also said to be a security risk -- something for special needs, not like a Windows firewall that would be highly recommended for general use. I thought about removing it via Synaptic or the command line, but it didn't seem to be bothering me now, so I let it alone.
Then it was time to install some Ubuntu programs that weren't available, or didn't install well, via Synaptic. Installing these called for use of Ubuntu's command line -- which, if you are an accurate typist, can be manageable. These programs were of two kinds. First, there was the previously downloaded program that was too big to download again unless necessary. An example of this was my copy of VMware Workstation 6.5, which was 340MB and had cost me $189.
Downloads typically came in some kind of compressed format, so I had to decompress them before I could use them. To decompress them, I had to run Ubuntu's Places > Computer menu pick. This opened File Browser, which worked like Windows Explorer. In File Browser, I navigated to the folder where I had saved my downloaded .bin file. File Browser's Location field gave me the path for this folder. I copied that path into Ubuntu's Terminal program (Applications > Accessories > Terminal). (If you're used to using Ctrl-C and Ctrl-V to copy and paste, you may have better luck by using the right-click options instead.) Once I was in the right folder in Terminal, I typed "cd [pathname]" which, in my case, was as follows:
cd "/media/CURRENT/Miscellany/Ubuntu Programs"
About quotation marks: in this post (indeed, in my posts generally), don't type them if they just bracket the command. In the previous sentence, for example, you would type the quotation marks in the indented command (i.e., cd "/media/CURRENT etc.), but not the quotation marks in the "cd [pathname]" example. I had to use quotation marks in the indented example because that pathname contains a space (between "Ubuntu" and "Programs"); this space would confuse the CD command otherwise.
At this point, in Terminal, I typed "sudo -i" so that I could execute commands as root (i.e., as administrator). Then the commands I used to decompress these files were as follows:
BIN Files. (The example used here is GoogleEarthLinux.bin, although this program is regularly updated and not that big, and is therefore better installed by a different method that brings you the current version, as described below.) For BIN files, I used this procedure: (1) Type "chmod +x" followed by the .bin filename. Example: chmod +x GoogleEarthLinux.bin. (2) Type "./" followed immediately by the .bin filename. Example: ./GoogleEarthLinux.bin. (If "./" doesn't work, try "sh" -- with no space after ./ but a space after sh). (3) Designate "/home/ray" (with your own username in place of ray) as the installation directory.
BUNDLE Files. Same steps as BIN files.
DEB Files. Right-click on the filename and use GDebi. Click on its "Install Package" button. It seems to know already where it wants to install the files -- not necessarily in or under the directory where the .deb file itself is located.
TAR Files. To install a TAR.GZ file: Copy to /home/ray (replacing "ray" with your username), navigate there in Terminal, and then use this command format: tar -vxf filename.tar.gz (or possibly tar xvfz instead). To uncompress the files (or to get the files out of a tarball), use this format: tar xvf filename.tar. If you have a .tar.bz2 file, use this format: tar yxf filename.tar.bz2.
To install Google Earth, I didn't use a previous download (see above). Instead, I typed this:
wget http://dl.google.com/earth/client/current/GoogleEarthLinux.bin
sh GoogleEarthLinux.bin
(That "wget" is supposed to be on the same line as the URL that follows it.)
I got an error message when I tried to start Google Earth:
Google Earth detected an error while trying to authenticate. Please check the following:
- your network connection (can you get to www.google.com?) - your firewall settings (are you blocking /opt/google-earth/googleearth-bin?) Error code: 29 For more information, visit: http://earth.google.com/support/bin/answer.py?answer=20717hl=en
That link didn't work for me. I did find advice to rename the libcrypto.so.0.9.8 file in the google-earth directory (which, by default, was /opt/google-earth) to something else, but that didn't solve the problem this time, so I changed it back to its original name. The solution, for me, was to type "sudo apt-get install lib32nss-mdns." The other problem was that I had to replace the entries in My Places in Google Earth; the ones that I had previously installed (which were still visible after the reinstallation) would cause the program to crash.
Next program: Firefox. Firefox was included with Ubuntu. Updating it depended on the situation. On one machine, I had wiped the partition and was installing Ubuntu from scratch. In that case, I had to fiddle with Firefox extensions. Before wiping and reinstalling, though, I had previously installed the InfoLister extension. This add-on had created an HTML file listing my currently installed extensions. I had kept a copy of that HTML file, and now I opened it. Although the HTML file contained links directly to webpages containing information and downloads for the various extensions, I had found that the fastest way to reinstall these extensions was just to open the Mozilla addons webpage and search for and install them one at a time. (It was not necessary to restart Firefox each time I marked an addon for installation.) I also went to the Categories > Plugins webpage, there at Mozilla, and downloaded the latest versions of the plugins I thought I would be needing. To get YouTube and other videos to play, I tried the alpha version of 64-bit Adobe Flash Player 10. One addon (Snap Links Plus) was available only in a manually installed .xpi form, so I went into Firefox and chose File > Open File and indicated that one for installation. To see what plugins I had installed, I typed "about:plugins" in the Firefox address bar (also accessible by Ctrl-L). I also had to configure the Preferences for a number of add-ons individually (Firefox Tools > Addons). On another computer, by contrast, I was installing Ubuntu 9.04 on top of 8.04, without first reformatting the partition. This kept a bunch of the things I had already installed, including my Firefox extensions. Some were not compatible with 9.04, but otherwise Firefox seemed to run pretty well.
Next, I wanted to make some adjustments to the system. First, I didn't want all those various prior Ubuntu kernels to be listed in the GRUB menu at startup. To edit this, I typed "sudo gedit /boot/grub/menu.lst" and put # symbols in front of each line that I didn't want to appear in the GRUB menu.
I also wanted Ubuntu to mount NTFS drives automatically at bootup. This involved a fair amount of screwing around, on the system where I had installed Ubuntu 9.04 without first uninstalling or formatting the partition where 8.04 was installed. I have detailed those efforts in a separate post.
That was pretty much it, for the update installation -- the one where I installed 9.04 on top of 8.04. For the installation from scratch, I had some additional problems. Here are some brief notes on those:
My dual-boot system was screwed up. When I booted, I got GRUB Error 12. The solution was to remove "makeactive" from the Windows XP entry in /boot/grub/menu.lst, and use GParted to give WinXP the boot flag.
If you may be rearranging your drive partitions (e.g., swapping hard drives), you may want to change the partition references in fstab to refer to UUIDs (which stay with the partition) rather than partition numbers (e.g., sda1) which will change when you rearrange partitions. To do this, open gparted (System > Administration > Partition Editor). Then, in Terminal, type "sudo blkid" to get UUID information for each drive. Type "sudo gedit /etc/fstab" to edit the fstab file. Change each line in fstab that refers to a fixed location, so that it refers to the device's UUID instead. For example, if fstab contains a line that begins with "/dev/sda5" and if blkid tells you that the UUID for that device is 500D33F91G01, then you might want to move the /dev/sda5 to a previous line as a comment, and replace it with the UUID. (Everything after the /dev/sda5 on that line would remain unchanged.) So the line that used to read like this:
/dev/sdaa5 /media/DRIVENAME ntfs-3g [etc.] might now look like this: # Entry for /dev/sdaa5 : UUID=500D33F91G01 /media/DRIVENAME ntfs-3g [etc.] Next: in Nautilus (i.e., File Browser), go to Edit > Preferences > Behavior and make sure the "Always open in browser windows" box is checked. I found a solution to a networking problem in which Ubuntu was unable to connect to the Internet. In one of my installation attempts, I also had to fix a keyboard problem. The solution was to use an alternate keymap code. Although I didn't actually use it, I got a tip that said I could designate programs to open automatically at startup by selecting System > Preferences > Sessions. In response to error: "Unable to lock the download directory," use "sudo pkill apt" OR "sudo killall dpkg."
There's no limit to the number of other things that can be installed and other tweaks that can be made. But the next big step, for me, was installing VMware.

Upgrading from Ubuntu 8.04 and 8.10 to 9.04

I had Ubuntu 8.04 (Hardy Heron) on one machine and 8.10 (Intrepid Ibex) on another. I discovered that 8.10 does, but 8.04 does not, permit an in-place update to 9.04 (Jaunty Jackalope). In other words, I would have to install 9.04 from scratch, using the installation CD, on the machine where 8.04 was installed; but I could update online, without doing a complete new installation with the CD, on the machine running 8.10. The online update was straightforward. Following advice, I took the following steps:

  1. Go to System/Administration/Update Manager
  2. Click the Check button to check for new updates.
  3. If there are any updates to install, use the Install Updates button to install them, and press Check again after that is complete.
  4. A message will appear informing you of the availability of the new release.
  5. Click Upgrade.
  6. Follow the on-screen instructions.
The difference here between 8.04 and 8.10 was that 8.04 would not give me that message informing me of the availability of the new release. That is, once you get as far as 8.10, all of your future updates can be done online. Note that the online installation process is much slower than the CD-based installation process. It tied up my machine for hours. By contrast, I was able to download and burn the ISO for the CD mostly in the background, while continuing to use the machine for other things. The advantage of the online upgrade is that you don't have to reinstall everything you had previously installed on Ubuntu. Websites advising on the upgrade process also provide information on upgrading from the ext3 to the ext4 filesystem. I did not thoroughly review this process before proceeding with that upgrade. It seemed to work fine, but then I was not able to reboot my system. I got Error 24. I tried reinstalling GRUB, but was not successful, and it looked like others had had the same experience. From what I could gather, it appeared that the upgrade causes problems only on the boot partition. Once I reinstalled from scratch, everything seemed OK; there did not seem to be any problems on any other newly upgraded ext4 partitions. There seemed to be two pieces of advice about upgrading from ext3 to ext4 on the boot partition: that it's not necessary, and that some programs are not yet ready for it. The next step for me was to install everything from scratch, now that I had wiped out my previous Ubuntu installation.