It seems there’s some mixed information about whether the wireless chip in this model works out-of-the-box with Ubuntu. I’ve tested with Karmic and the Lucid Beta (Netbook Remix versions) and for me it didn’t work. The chip in my model is the Atheros AR2427, which although not a new chip, seems to have an an unfamiliar hardware device ID of 002c, and so is not picked up by the ath9k wifi driver found in the kernel. The driver has been patched by the Linux Wireless developers but this patch has not worked its way into a kernel release yet, so the solution is to compile and install the latest bleeding edge wireless drivers, which is actually a pretty painless operation. It’s also a very safe operation, because the installer leaves the original kernel drivers intact and provides an uninstall script; but I have not needed to revert.
Archive for the ‘Linux’ Category
The Asus Eee PC 1005PE & Ubuntu
Call to undefined function imagetypes()
I came across this PHP error after installing the Wordpress plugin Contact Form 7 and then using Really Simple CAPTCHA. The exact error given was:
Fatal error: Call to undefined function imagetypes() in ... on line 201.
After searching around for a while, I found that the GD library is required on the server, and (on linux at least) it’s a simple case of installing the library from the repository. So on Ubuntu/Debian, run:
sudo apt-get install php5-gd
and on Redhat/CentOS, etc. sudo yum install php-gd should do the trick. This will install several dependencies, such as the underlying C Library itself.
Obviously if you don’t have full control over your server, you will have to ask your hosting company or administrator to do this for you.
mysqlslap for MySQL 5.0
mysqlslap is a very useful tool for emulating client load, something that would normally be very difficult in the real world (until you go live!). The binary is bundled into the MySQL 5.1 releases (still at Release Candidate stage) but not 5.0, so the only option is to compile from 5.1 source and then you can use it with your 5.0 server installation.
Fortunately when compiling you can save some time by configuring with the --without-server option, which will compile just the client tools (mysqldump, mysqlbinlog, mysql CLI, etc.). The following worked for me on an installation of CentOS5 64-bit, on the same machine that runs my 5.0 server.
1. Download the MySQL 5.1 source code in compressed tar format (.tar.gz). Go to the download page, or do a wget (in my case from the Mirror Service from the University of Kent, UK). Version 5.1.23-rc was current at the time of writing:
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.23-rc.tar.gz/from/http://www.mirrorservice.org/sites/ftp.mysql.com/
2. Unpack the archive:
tar -xvvzf mysql-5.1.23-rc.tar.gz
3. Install required development packages and compile:
cd mysql-5.1.23-rc
yum install glibc gcc libtool ncurses-devel gcc-c++
./configure --without-server --disable-shared
make
make install
The ‘make’ stage will take some time. Why configure with --disable-shared? I wanted my binary to be portable so I could share amongst a group of similar-spec machines, and I can’t be sure that the shared libraries are all in the same location. See the MySQL Installation pages for more details on configuration options; you may want to make use of --libdir=... instead.
4. Copy/move the mysqlslap binary (it will be in /usr/local/bin by default) to wherever the rest of your v5.0 client binaries are. For example:
cp /usr/local/bin/mysqlslap /usr/local/mysql/bin/mysqlslap
5. Test it out! Run something like:
./mysqlslap --user=root --auto-generate-sql --concurrency=100 --iterations=5
as a quick test, and check out the MySQL Documentation for a more detailed use-guide.
Since compiling I have thrown the binary around various other Intel machines (and VMs) running CentOS, without any problems. Read the rest of this entry »
Installing CentOS 5 on a Dell R200
This is the latest value rackmount offering from Dell. It’s a great spec for the price, but installation of CentOS 5 seems surprisingly difficult, thanks to the SATA DVD drive used in the unit. RHEL/CentOS doesn’t have the driver for the controller so can’t find the DVD during installation. I’m sure there are other workarounds (network install, USB DVD drive etc.), but eventually I got hold of a Redhat driver disk from Dell Support (it doesn’t seem to be on the Dell site btw).
I’ve uploaded the disk image here; just uncompress it and copy the .img file onto a USB key. At the installation command-prompt type ‘linux dd’ and then hit Enter. You’ll then be asked for the location of the driver disk image; just navigate to the USB disk, select the image, and you’re in business.
How to Access MySQL with an SSH Tunnel
This is a particularly useful method for gaining access to your remote MySQL databases, such as those held on a web hosting account where the MySQL port may not be open. You can use this method to gain access to other services too (SMTP, IMAP, FTP), but in this post I’ll explain how I use it in combination with MySQL Query Browser to administrate my DBs with a GUI. You need to have SSH access to your remote server (normally over port 22) for this to work. My instructions are for Ubuntu but it’s easily transferred to other distros, Mac OS X, and Windows (just download an SSH client).
Run sudo apt-get install ssh if it isn’t installed already, which will install several SSH connectivity tools (more info here). Query Browser is an excellent tool with which to run queries, updates, create views and stored procedures, and loads more besides. Run sudo apt-get install mysql-query-browser. Now to create the SSH tunnel by using port forwarding; here’s how I access a MySQL instance on my local network:
james@james-laptop:~$ ssh -L 3307:localhost:3306 root@192.168.1.211
root@192.168.1.211's password:
Essentially this forwards all traffic on port 3307 on the local machine (james-laptop) to port 3306 on 192.168.1.211. The general format is . Note that in my example I used localhost, but this is resolved after the connection has been made to 192.168.1.211 and so it refers to that IP address.
ssh -L localport:host:hostport
Effectively we can now access port 3306 (the default MySQL port) on 192.168.1.211 via port 3307 on james-laptop even though port 22 (the SSH port) is the only port open on 192.168.1.211. Keep the connection open (i.e. don’t close the terminal) and open Query Browser. In the connection dialogue set the hostname to 127.0.0.1 and the port to 3307 and enter a username/password as required. Hit connect and you should see a graphical representation of your database(s). Note that in *nix OSs (including Mac OS X) you must use 127.0.0.1 rather than ‘localhost’ or the connection will be made via a named pipe rather than TCP.
Installing Ubuntu Feisty on Santa Rosa
If you’ve recently bought a laptop with an Intel Core 2 Duo CPU, the chances are it’s running on the Santa Rosa platform. Having wiped off the unfortunate Windows installation, you’ll want to install some flavour of linux, such as Ubuntu Feisty. Unfortunately the installation process is not as smooth as you might as expect. In fact, it prooved so troublesome for me that in the end I decided that upgrading to Gutsy would be a better idea. But first I’ll talk you through how you can go about getting Feisty installed:
When booting from the Feisty Live CD, the first problem you’ll encounter will probably be something like:
/bin/sh: can't access tty: job control turned off
(initramfs)
and the OS will not continue to load. I’m not sure on the cause of this, but to get round it hit F6 at the boot menu and append break=top to the list of options. You should then see a slightly different error message, and underneath it you should type:
modprobe piix
exit
The LiveCD should then continue to load the OS. After a minute or so you’ll probably see a lovely blue screen with a “Failed to start the X server…” error message. Hit Yes or No (whatever you fancy) and you’ll be dumped at the command line where you should type:
sudo dpkg-reconfigure xserver-xorg
Remember the sudo bit or you’ll be reminded that you are not a superuser; no password is required. The Xorg configuration screen will appear and you’ll be asked (a lot) of questions. Keep the driver on “vesa” and continue through the questions, providing the default answers. At the bit where it asks you something about monitor config options and gives you the choice of “Simple”, “Medium” and “Advanced” I hit Medium and continued through. The vesa driver might not support your resolution if you have a widescreen aspect ratio (1280×800, 1440×900, etc.). Don’t worry about this for now and continue. Eventually you’ll be dumped back to the command line. Now type:
sudo /etc/init.d/gdm restart
and the Gnome desktop environment should start to load. From here you can perform your installation as required.
When you boot Feisty for the first time you’ll notice some more problems, such as the lack of an Intel graphics driver if your laptop uses the onboard Intel GMA965 chip, and non-functional sound & wireless. For me it was the lack of graphics driver that prompted me to upgrade to Gutsy, since the solution for Feisty involved upgrading the kernel to 2.6.22 anyway, which is the kernel version used in Gutsy (see http://ubuntuforums.org/showthread.php?t=494943 for more info). At the time of writing, Gutsy Tribe 5 has just been released and it seems to be stable. You can save yourself a lot of hassle where Santa Rosa is concerned by downloading the tribe 5 live CD which boots with no problems whatsoever for me, including desktop effects, wireless (my laptop has the 4965AGN chip) and sound. If you’ve already installed feisty you can upgrade to Gutsy by running “update-manager -d”.
How to Mount VMDK files in Linux
There’s various tools for Windows that allow you to mount VMware images, which offers a convenient way to transfer files to/from the Virtual Machine. The solution in linux seems to be a little less well-known, but it is effectve nonetheless, and I find it preferable to using SSH/FTP/NFS etc. to transfer files.
First you’ll need to download a copy of VMware server, which is free. You may be using VMware player to run your virtual machines, but unfortunately it doesn’t include the tool needed to mount VMware images. It’s not a major problem though; just unpack the VMware server archive you just downloaded and copy the files “vmware-mount.pl” and “vmware-loop” from its “bin” directory to your /usr/bin directory (or whatever directory you have VMware Player installed). There’s no need to install VMware Server if you already have Player. If you have neither installed then obviously you will need to install one of them. Now navigate to that installation directory and follow my lead:
jim@jim-desktop:/usr/bin$ ./vmware-mount.pl
This script requires 3 (not 0) mandatory argument(s).
Usage: ./vmware-mount.pl
-p : Print the partition table
disk : Name of the Virtual Hard Disk file
or
disk : Name of the Virtual Hard Disk file
partition : Number of the partition
[-t type] : Partition type
[-o options]: Partition mount options(s)
mount-point : Directory where to mount the partition
Here we see the usage instructions for the vmware-mount script. I’ll run with the ‘-p’ option so I can see the partition structure of my image:
root@jim-desktop:/usr/bin# ./vmware-mount.pl -p /home/jim/'My Virtual Machines'/windows.vmdk'
--------------------------------------------
VMware for Linux - Virtual Hard Disk Mounter
Version: 1.0 build-44356
Copyright 1998 VMware, Inc. All rights reserved. -- VMware Confidential
--------------------------------------------
Nr Start Size Type Id Sytem
-- ---------- ---------- ---- -- ------------------------
1 63 2097088 BIOS 6 FAT16
That tells me that the partition number I’ll need is 1, and it’s the only partition available. So to mount the image I run the following:
root@jim-desktop:/usr/bin# mkdir /media/vmware-image
root@jim-desktop:/usr/bin# ./vmware-mount.pl /home/jim/'My Virtual Machines'/windows.vmdk 1 /media/vmware-image
The script warns you about untested support for kernels > 2.4 and has a whinge about network block devices, but type ‘Y’ on both counts to continue and the image will mount to your specified location (in this case, /media/vmware-image). You can now open another terminal window and explore the image. In Ubuntu w/ Gnome I’m able navigate via Nautilus, and it even creates a nice image on the desktop for me. You may find additional switches such as “-o ro” to make the image read-only will come in handy.
Feisty – “No volume control GStreamer plugins and/or devices found.”
So suddenly I see “No volume control GStreamer plugins and/or devices found.” instead of the usual volume control tool in Feisty. I googled the problem and most of the solutions hinged around the system not detecting the soundcard, or the user forgetting that they didn’t have one =) But my sound had been working fine for a few months, so it had to be something else. In this case, careless use of the ‘usermod’ command; I used the command ‘usermod -G groupname’ to add my user to a group I had just created. Unfortunately it removed me from every other group, including the ‘audio’ group.
A quick gedit of /etc/group and I was back in business. The moral of the story: if your sound suddenly stops working, check that your user is still a member of the audio group. Oh, and use ‘usermod’ more carefully than I did.
Installing VMWare on Ubuntu Gutsy
Unfortunaltely the latest kernel included in Gutsy (2.6.22-10) isn’t supported by VMware yet, so you’ll run into a few problems when attempting to install VMware Server. If you’re running 64bit Gutsy and you haven’t already installed the ia32 libraries then you’ll probably see this message to start with:
The correct version of one or more libraries needed to run VMware Server may be missing. This is the output of ldd /usr/bin/vmware:
linux-gate.so.1 => (0xffffe000)
libm.so.6 => /lib32/libm.so.6 (0xf7f93000)
libdl.so.2 => /lib32/libdl.so.2 (0xf7f8f000)
libpthread.so.0 => /lib32/libpthread.so.0 (0xf7f76000)
libX11.so.6 => not found
libXtst.so.6 => not found
libXext.so.6 => not found
libXt.so.6 => not found
libICE.so.6 => not found
libSM.so.6 => not found
libXrender.so.1 => not found
libz.so.1 => /usr/lib32/libz.so.1 (0xf7f60000)
libc.so.6 => /lib32/libc.so.6 (0xf7e16000)
/lib/ld-linux.so.2 (0xf7fc6000)
This program cannot tell for sure, but you may need to upgrade libc5 to glibc
before you can run VMware Server.
which is easily remedied by running:
sudo apt-get install ia32-libs
The next error message occurs when the vmware-config script attempts to build the vmmon modules:
None of the pre-built vmmon modules for VMware Server is suitable for your
running kernel. Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]
Using compiler "/usr/bin/gcc". Use environment variable CC to override.
What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.22-10-generic/build/include]
Extracting the sources of the vmmon module.
Building the vmmon module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config1/vmmon-only'
make -C /lib/modules/2.6.22-10-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.22-10-generic'
CC [M] /tmp/vmware-config1/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config1/vmmon-only/linux/driver.c:80:
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or ‘...’ before ‘compat_exit’
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or ‘...’ before ‘exit_code’
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: warning: type defaults to ‘int’ in declaration of ‘_syscall1’
make[2]: *** [/tmp/vmware-config1/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config1/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.22-10-generic'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config1/vmmon-only'
Unable to build the vmmon module.
For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".
Execution aborted.
To get around this we need to apply a patch called vmware-any-any (see here for more info). I used version 113 as it seems to be the latest; it can be downloaded here. Extract the contents of the archive, navigate to their location and simply run:
./runme.pl
to install the patch. You’ll see the following:
Updating /usr/bin/vmware-config.pl ... now patched
Updating /usr/bin/vmware ... No patch needed/available
Updating /usr/bin/vmnet-bridge ... No patch needed/available
Updating /usr/lib/vmware/bin/vmware-vmx ... No patch needed/available
Updating /usr/lib/vmware/bin-debug/vmware-vmx ... No patch needed/available
VMware modules in "/usr/lib/vmware/modules/source" has been updated.
Before running VMware for the first time after update, you need to configure it
for your running kernel by invoking the following command:
"/usr/bin/vmware-config.pl". Do you want this script to invoke the command for
you now? [yes]
Hit enter to invoke vmware-config.pl and the rest of the installation should now run smoothly. Note that you will need a C++ compiler to build the vmmon modules. Enter the following to install such development tools:
sudo apt-get install build-essential
sudo apt-get install linux-headers-'uname -r'
The final message you should see is:
The configuration of VMware Server 1.0.3 build-44356 for Linux for this running kernel completed successfully.
and you should now have a fully-functional version of VMWare Server; launch it by typing ‘vmware’ at the command line, or from the menu entry.

