Wednesday, February 28, 2007

Installing Parallels 2.2 on Ubuntu 6.10 (Edgy)

Installing Parallels Workstation on Ubuntu can be a bit of a challenge. There are a few minor (yet fatal) issues encountered whether using the Debian package or the install script which prevent Parallels Workstation from running. This article shall explain how to overcome these issues.

The biggest challenge between Parallels Workstation & Ubuntu is /bin/sh . If you open a shell in Ubuntu and type 'll /bin/sh' you'll see the following:

lrwxrwxrwx 1 root root 4 2007-01-29 10:19 /bin/sh -> dash
What this means is that sh is a symbolic link to dash. What's dash? Its a replacement shell for bash (a popular shell environment) which includes various enhancements over bash. However the scripts packaged with Parallels have compatibility issues with dash, and as a result encounter errors which prevent Parallels from running.

So to sort out this mess we'll make some minor edits to a few of the Parallels script files which will allow Parallels to successfully run.

In addition to the script issues discussed above, there are undocumented package dependencies. These dependencies are due to the manner in which Parallels configures its kernel modules -- running the command parallels-config essentially builds these modules specific to your environment.

So to complete the software build environment in preparation for building the Parallels Workstation kernel modules, these packages should be installed on your system:

sudo apt-get install build-essential
sudo apt-get install kernel-package

Install these before installing Parallels Workstation.

(Note that you are free to install Parallels Workstation first if you wish; however Parallels does not run a dependency check and will not alert you if these packages are missing. The first clue that you will see is that parallels-config will fail to build the modules due to missing header files. So it is simply best to just install these dependencies beforehand.)


For clarity, we shall assume installation using the Parallels Debian package. However the principles described here remain the same for those using the Parallels install script.

First step is to obtain and install the Parallels Workstation Debian package. This can be found on the Downloads page of the Parallels website.

If the package installed successfully, you likely received a message indicating that parallels-config must be run prior to running parallels. Don't do it just yet, as some changes must be made beforehand.

Exercise your sudo powers and edit these Parallels scripts:

In each of these files, do a search & replace for all instances of /bin/sh replacing it with /bin/bash. (Keep in mind there may be multiple instances of /bin/sh in each file.)

Once the above files have been updated and saved, launch the parallels-config command:
sudo parallels-config
This should successfully build the kernel modules. If it doesn't complete successfully, double-check that you captured every step above.

Otherwise if parallels-config successfully completes, launch Parallels Workstation and enjoy.

Modifying the GLSlideshow Screensaver settings in Ubuntu

UPDATE: This has been verified to work for 7.10 (Gutsy) as well as 7.04 (Feisty).

For whatever reason in Ubuntu the GLSlideshow screensaver settings are not accessible through the screensaver control panel. We're talking the basics here, like changing the filesystem path to the pictures to display, displaying more than one image (in true slideshow fashion), the duration to display a picture for, etc. So then how does one adjust these properties? This post answers that question.

GLSlideshow gets its settings from two files. The first is .xscreensaver, and the second is glslideshow.desktop. We'll tackle these one at a time.

Starting with .xscreensaver, this file should exist in your home directory; if it doesn't already exist go ahead and create it there. Add the following line to .xscreensaver, where the path represents the folder containing the images you wish to display (adjust the path appropriately for your environment):

imageDirectory: /home/username/Photos

Save this file and close it.

Next modify the settings in glslideshow.desktop to get GLSlideshow to perform as we would like. In Ubuntu this file is typically found here:

If this path isn't appropriate for your system, issue this command to locate this file:
slocate glslideshow.desktop

Edit gslideshow.desktop and look for the following entry:
Exec=glslideshow -root

Modify this line to instead read:
Exec=glslideshow -root -duration 15 -pan 15 -fade 5

  • duration represents the amount of time (in seconds) to display an image for
  • pan represents the amount of time (in seconds) to run the pan effect on this image
  • fade represents the transition time (in seconds) to fade between images
You are free to add additional options if you wish; see the manpage for glslideshow for more options.

Save this file, then activate the screensaver. GLSlideshow should now present a slideshow of images from the specified directory.


Monday, February 12, 2007

Ubuntu & wireless on a Vaio V505BX

I recently installed Ubuntu 6.10 (Edgy) on my Sony Vaio V505BX. The install went smooth and was done in less than an hour -- almost everything worked 'out-of-the-box' including the function keys for volume and brightness. However wifi/wireless wasn't working by default and required some digging. This post details how I was able to get it running.

What Didn't Work
Ubuntu recognizes the built-in card as an Intersil Prism 2.5 chipset; these details were found by using the lspci command.

Ubuntu ships with the hostap driver, the ornioco driver, and the prism2 driver, all of which should theoretically be capable of operating this card -- though despite my best efforts I could get none to work. The modules would all successfully load and the card could see access points; however association with an access point would either fail or be short-lived before the connection was dropped.

Something seemed amiss with these kernel drivers (hostap, prism2, orinoco), and some time spent web searching revealed others with similar Vaios were also having problems when running Ubuntu 6.10. The most common 'fix' appeared to be blacklisting the prism2 modules, which I also tried but without success.

I managed to get wireless working by instead using the ndiswrapper kernel module in conjunction with the WinXP drivers:

1.) Add these modules to the modules blacklist file (/etc/modprobe.d/blacklist):

  • hostap
  • hostap_pci
  • prism2_pci
  • orinoco
  • orinoco_pci
This will insure that none of the default modules will load and interfere with the workaround. Reboot to clear any of the above modules which may be currently loaded. (You could also try modprobe -r modulename though rebooting is just easier.)

2.) Locate the WinXP drivers.

When I installed Ubuntu, I already had WinXP installed and so I configured it as a dual-boot system. I booted into WinXP and checked the device manager to see the wireless card's details as well as the driver it uses.

XP lists the card as an Ambit LANExpress ieee802.11b miniPCI adapter. I noted the location of the drivers it uses (c:\Program Files\Ambit\...) and then rebooted into Ubuntu. Write down this location or copy the files to a thumb drive as you'll need access to them from within Ubuntu.

(Caveat - Sony provides the V505BX wireless drivers here:

However (!) these drivers are packaged into a Windows installer which won't extract under Wine as it fails to detect an XP system. So if you don't have an Ubuntu/WinXP dual-boot you'll need to find a WinXP system on which run the installer and copy the installed drivers or another method by which to extract the necessary files.)

3.) Install the ndiswrapper-utils package:
sudo apt-get install ndiswrapper-utils

4.) Load the WinXP drivers as well as the ndiswrapper module.

This guide covers these steps quite well:

When loading the WinXP drivers, reference the location of the Ambit drivers found previously. (On my system I mounted the WinXP partition and loaded the XP drivers (inf, sys) directly from the NTFS drive.)

5.) You should now be able to associate with an access point using iwconfig.

Test everything out. If its not working, retrace the above steps to insure everything was followed correctly. If/when it's working, continue to the next step.

6.) Once wireless is operating satisfactorily, you will need to make the ndiswrapper modules load during startup so that your wireless card is automatically enabled (rather than follow the steps here every time you reboot).

The following command stores the current configuration of the ndiswrapper modules into a config file so that the WinXP drivers will be loaded automatically when the ndiswrapper kernel module is loaded:
 sudo ndiswrapper -m
Next you will need to insure that the ndiswrapper kernel module gets loaded during boot. I added the following line at the end of /etc/rc.local to accomplish this:
 modprobe ndiswrapper
Ndiswrapper should now load the WinXP drivers the next time you reboot, enabling your wireless card automatically.

7.) I highly recommend following this guide to get Gnome network manager up-and-running as it makes using wireless much more convenient: