Ubuntu 10.04 Lucid Lynx and Wacom Bamboo CTL460 (revisited with Q&A)

In my first post on this subject,  I demonstrated how to enable the Wacom Bamboo CTL460 on Ubuntu 10.04.   Since then, I have received a number of questions which gave me the impression that some items need a more thorough explanation.  Following the Q&A, I will repeat my steps from my previous post.  This time with a slightly newer version of the driver.  The steps are the same.

Wacom Bamboo

Wacom Bamboo CTL460

Questions and Answers

Question:  I tried your steps but my Wacom tablet model xxx doesn’t work. Can you help?

Answer:

If you have some other Wacom tablet besides the model CTL460, these instructions may not work for you.  You are welcome to try them.  Since I only have the model CTL460, I am limited in the amount of advice that I can give you for whatever model you have.  If you can’t figure it out and I’m unable to help, you should try contacting the maintainer of the linuxwacom project or the author of the driver.  (modinfo wacom | grep author)

Question:  My Wacom tablet used to work under Ubuntu 9.xx, or 8.xx.  Why won’t it work under 10.04?

Answer:

One myth that needs to be addressed, is that the Wacom CTL460 is supported by Ubuntu 10.04 and will work out-of-the-box.  That is not true. If you had a previous version of Ubuntu and your Wacom CTL460 worked out-of-the-box, you need to realize that it no longer just works out-of-the-box.  There have been some changes to xorg since then.  In addition, if you have been using instructions in the past (previous to 10.04)  which included making changes to /etc/udev/rules.d, you can throw those out.  Those instructions do not apply anymore.  Furthermore, you do not need to install the package xserver-xorg-input-wacom.  That package contains code that does not work for this tablet. You can remove it if you want since it has no impact on the rest of these instructions.

Question:  Your steps worked great but one day I rebooted and my tablet doesn’t work anymore.  Help?

Answer:

You recently ran Update Manager and one of the packages you updated was the kernel image package.  Not a problem.  This is normal and to be expected.  You need to follow the steps again each time the kernel image package is updated to reinstall a new driver.

Question:  I was trying to configure my table in Gimp but I did not see a wacom input device.  Help?

Answer:

Make sure that your tablet is plugged in and working before you start the Gimp application.

Question:   Help?  I was following your steps but I noticed the following message:

Note: this package only supports Xorg server older than 1.6.5.
You are running a newer version.
Please build xf86-input-wacom instead.

Answer:

Simply ignore it.  I did.

Question: When will the Wacom CTL460 be supported out-of-the-box?

Answer:

I don’t know.  Hopefully in the next version.

Instructions

Install the following packages:

sudo apt-get install build-essential libx11-dev libxi-dev x11proto-input-dev xserver-xorg-dev tk8.4-dev tcl8.4-dev libncurses5-dev

Download the source code for the wacom driver from Sourceforge.  The current version as this writing is linuxwacom-0.8.8-3.

tar jxvf linuxwacom-0.8.8-3.tar.bz2
cd linuxwacom-0.8.8-3/
./configure –enable-wacom
make
cd ./src/2.6.30
sudo cp wacom.ko /lib/modules/`uname -r`/kernel/drivers/input/tablet
sudo depmod -a
sudo modprobe wacom

That is all.  You can plug in your Wacom CTL460 Bamboo tablet and begin using it.

If you take anything away from this exercise please remember this

What we did was replace the wacom driver that comes with the kernel package.  We simple copied our newly built wacom driver in its place.  Whenever you update the kernel package, you need to follow these steps again.  Be sure to reboot first so that you are running the new kernel prior to rebuilding a new driver.

If you don’t want to download a new version from Sourceforge, you can keep the folder from above and reuse it.   In that case you just need to do the following steps (don’t overlook the make clean below):

reboot (so that you are running the new kernel)
cd linuxwacom-0.8.8-3/
make clean
make
sudo cp wacom.ko /lib/modules/`uname -r`/kernel/drivers/input/tablet
sudo depmod -a
sudo modprobe -r wacom
sudo modprobe wacom

Additional tips

  • When you run Update Manager, be on the lookout for updates to the kernel image.  After updating the kernel image, you should reboot.  You will then be required to reinstall a new wacom driver.
  • Unplug your Wacom tablet before you rebuild a new module.
  • Plug in your tablet after you are done installing the new driver.
  • Plug in your table before you start Gimp or any other application that will be using your tablet.
  • While your tablet is plugged in, you can verify that your driver is loaded by using lsmod | grep wacom
  • Become familiar with modprobe, udevadm, and /var/log/kernel.log for additional low level troubleshooting

Performing backups with netcat

In this post I will demonstrate how to perform a backup of a disk partition over the network using dd and nc (netcat).  I will also introduce the pv command, which may be new to you.  The pv command can be installed by “sudo apt-get install pv”.

Lets assume that I have a laptop that I use for testing different linux distributions.  It has multiple operating systems and multiple disk partitions.  I want to backup my Fedora 12 partitions before installing Fedora 13.  I will use dd and nc to copy the Fedora 12 disk partitions across my network to a fileserver.

  • My laptop:  192.168.140.64
  • My fileserver: 192.168.140.11

The partitions on the laptop that I want to backup are:

  • /dev/sda4  (Fedora 12 lvm, 14.7GB)
  • /dev/sda8  (Fedora 12 /boot ext4, 263MB)

If you are wondering how I obtained the partitions and sizes, I used “parted -l”.

We have all the information we need, now lets begin.

First we tell the fileserver to listen on an unused high numbered port.  I’m choosing port 12345.

On the fileserver:

$ nc -l 12345 | pv -b -p -s 263m > laptop_sda8.img

Next we tell the laptop to begin copying data to the fileserver.

On the laptop:

$ sudo dd if=/dev/sda8 | nc 192.168.140.11 12345

If you are unfamiliar with the pv command, it reports the amount of data written to a pipe.  We use it to give us a progress bar.  The -b and -p option tells it to show progress in bytes.  We use -s 263m to tell it that we are expecting to receive 263MB of data.  This is needed to display the progress bar.

Here is what you will see on the fileserver side while data is being copied.

When the data finishes copying, you can use md5sum to verify your data.  Run md5sum on the source and md5sum on the destination and compare the results.  The two resulting numbers should be identical.

On the latop:

$ sudo md5sum /dev/sda8
b37349506c8d20d0d6b21e4f38c374bc  /dev/sda8

On the fileserver:

$ md5sum laptop_sda8.img
b37349506c8d20d0d6b21e4f38c374bc  laptop_sda8.img

Now we do the same steps for the partion /dev/sda4.

On the fileserver:

$  nc -l 12345 | pv -b -p -s 14700m > laptop_sda4.img

On the laptop:

$ sudo dd   if=/dev/sda4 | nc 192.168.140.11 12345

Now a word about security.  Notice that I copied my data in the clear across the network.  If I am copying my data across my home LAN, this is an acceptable risk to me.  If I am copying data across the Internet or any network shared with other people, this is not an acceptable risk.  In that case, an ssh tunnel should be used.

Here is how.

On the fileserver start the listener.  Same as before.

$ nc -l 12345 | pv -b -p 263M > laptop_sda8.img

Let me explain a few things here.  In our next set of commands we will open two terminal windows on the laptop.  In the first window we will setup an ssh tunnel from the laptop to the fileserver.  We will keep this tunnel open, while we use the second terminal window to run our data transfer.

Open two terminal windows on the laptop.

In terminal 1, establish an ssh tunnel to the fileserver, using a valid username@fileserver.

$ ssh -N -L 12345:localhost:12345 neil@192.168.140.11

In terminal 2, copy the data as before but this time the destination will be localhost port 12345.  The data will be encrypted and sent through the ssh tunnel to the file server.

$ sudo dd   if=/dev/sda8 | nc localhost 12345

Repeat these steps for the next partition (/dev/sda4).

When the copy has completed, you can end the ssh tunnel by using ctrl-c in terminal 1.

The ssh tunnel is secure but you give up speed and it requires extra processing power.  That is why I only use the ssh tunnel when security is a concern.

Turnkey Linux

I’m often asked what is my favorite open source project.  My favorite open source project is Turnkey Linux.  They make virtual appliances that are prebuilt and ready to run.  These are turnkey solutions using the best names in open source software.

Just to name a few…

  • WordPress
  • Joomla
  • Drupal
  • MediaWiki
  • MySQL
  • PostgreSQL
  • Zimbra
  • Bugzilla
  • phpBB

Their virtual appliances are easy to install and configure within a few minutes.  Whether you are looking for a solution for your enterprise or just wanting to dabble and “try-out” a new product,  you are only minutes away from your next open source solution.

If you are interested in building your own virtual appliance, why reinvent the wheel?  Turnky Linux has a Core and a LAMP appliance that you can start with and outfit the way you want.

Running VirtualBox Guest VMs In Headless Mode

If you are new to VirtualBox, you might not be aware that you can run your guest VMs without having a console window to them on your desktop.  IOW, run your guest VMs in the background and unseen.  This is called headless mode.  I’ll show you how to do that and a little more.

In headless mode, your guest VMs run in the background and you have the option to connect to them using the RDP protocol should you need a console to them.  This is great for uncluttering your desktop particularly if you run many guest VMs and you don’t care to see their console.  I have one server where I normally run at least five guest VMs at all times.  Headless mode is great when you need to log  into your host server remotely using ssh and start a guest VM.  This can be handy if you are on the road, away from your server.

Here is an example to demonstrate some common tasks.

Log into your host server using ssh.  Get a list of all VMs.

$ VBoxManage list vms

Start a guest VM named mywiki with RDP enabled and listening on port 3390.  If you plan to run multiple guest VMs in headless mode with RDP enabled, you will need to choose a unique port for each to listen on.  If you don’t specify a port, the default port is 3389.

$ nohup VBoxHeadless -s mywiki -v on -p 3390 &

Now if you want to check that your guest VM is among your running VMs

$ VBoxManage list runningvms

If you should need to connect to the console on that running VM named mywiki.  Lets assume it’s IP address is 192.168.139.10.  We are going to use rdesktop, which is a good RDP client found in most linux distros.

$ rdesktop -g 1024x768 -a 16 -5 192.168.139.10:3390 &

That should open up an nice 1024×768 window to your guest VM.  If the resolution 1024×768 is too big for you, then adjust the size to fit your needs.  The rdesktop settings “-a 16 -5” use a 16bit color depth and RDPv5.  Those settings work well for me and look good.

To view the properties of your VM use the showvminfo option.  This is handy if you want to connect your RDP client to a running VM and you don’t remember which port your VM is listening on.

$ VBoxManage showvminfo mywiki

Ok, now lets assume you have a rogue guest VM that want to shut-down and it is not responding to your request for a normal orderly shut-down.  You can power it off using VBoxManage.

$ VBoxManage contolvm mywiki poweroff

One of the things I love about VirtualBox is the amount of control you have from the cmdline.  Pretty much anything you can do from the management console can be done from the cmdline.  That is great especially if you enjoy writing scripts and want to automate some of these VirtualBox tasks.

Hopefully this will be enough to get you going.

Converting vmdk files to vdi using VBoxManage

Lets say you want to convert a VMware vmdk disk image to a VirtualBox vdi disk image.  It’s super easy. First let me mention that VirtualBox already supports vmdk files and can use them as is.  However lets continue with the original idea of converting.  I assume you already have VirtualBox installed.

If your vmdk image file is already connected to a guest VM.

  • shutdown the VM
  • remove the vmdk file from the guest VM (you can’t convert it while it is attached to a VM)

From the cmdline, use VBoxManage.   It’s a swiss army knife type of program.  You will see it used for a variety of things.

$ VBoxManage clonehd --format VDI myserver.vmdk \
/srv/d1/VirtualBox/HardDisks/myserver.vdi

That is all there is to it.

If you merely want to make a copy of a vdi disk image file, you can leave out the “–format VDI” option.  The vdi disk image files contain a UUID.  The clone process will make sure that the new output file has a different and unique UUID from the original.  If you use “cp” to make a copy of the vdi image file, you will find that the output file is unusable because it contains the same UUID as the original file.  A duplicate UUID is not acceptable to VirtualBox.

Converting ogg/vorbis to mp3

This is a simple bash shell script to convert a folder of .ogg (vorbis) files to mp3 files.  I won’t get into the advantages of one format versus another.  You may have a device that supports only mp3 files.  Therefore, you have a reason to convert .ogg files to .mp3.  There are many scripts out there that will convert ogg to mp3 but with most of them you lose all of your tags in the process.  That can be a real pain.  My script will preserve the tags of my choice and write them to the mp3 file.

The tags that I am concerned about are:

  • Artist
  • Album
  • Title
  • Genre
  • Date (year)
  • Track #

If there are other tags that you care about, then adjust the script as needed.

The shell script depends on the following packages:

  • id3v2
  • vorbis-tools
  • lame

For Ubuntu users:

$ sudo apt-get install id3v2 vorbis-tools lame

For Fedora users:

$ sudo yum install id3v2 vorbis-tools lame

Without further ado, here is the script


#!/bin/bash
# convert *.ogg files to *.mp3 files

function addtag {

ARTIST=`cat $1 | sed -e '/^.*ARTIST/!d' -e 's/^.*ARTIST=//'`
TITLE=`cat $1 | sed -e '/^.*TITLE/!d' -e 's/^.*TITLE=//'`
DATE=`cat $1 | sed -e '/^.*DATE/!d' -e 's/^.*DATE=//'`
GENRE=`cat $1 | sed -e '/^.*GENRE/!d' -e 's/^.*GENRE=//'`
TRACK=`cat $1 | sed -e '/^.*TRACKNUMBER/!d' -e 's/^.*TRACKNUMBER=//'`
ALBUM=`cat $1 | sed -e '/^.*ALBUM/!d' -e 's/^.*ALBUM=//'`

echo "artist: $ARTIST"
echo "title: $TITLE"
echo "album: $ALBUM"
echo "genre: $GENRE"
echo "date: $DATE"
echo "track: $TRACK"

id3v2 --artist "$ARTIST" --album "$ALBUM" \
--song "$TITLE" --genre "$GENRE" \
 --year "$DATE" --track "$TRACK" \
"$(basename "$1" .tag).mp3"

}

for a in *.ogg
do
ogginfo "$a" > "$(basename "$a" .ogg).tag"
oggdec -o - "$a" | lame -h -V 5 --vbr-new - "$(basename "$a" .ogg).mp3"
addtag "$(basename "$a" .ogg).tag"
rm "$(basename "$a" .ogg).tag"
done

I named the script ogg2mp3.sh.  I chose to leave the *.ogg files rather than delete them after converting them to *.mp3 files.  To use the script, I cd to a folder that contains *.ogg files, then I run the script.


$ cd ~/Music
$ ./ogg2mp3.sh

You can make the script as elaborate as you want. Hopefully it was simple enough to give you a feel of how to use the other utilities together: ogginfo, oggdec, id3v2, and lame.

Using tmpfs for high performance I/O

When you need high performance I/O, one thing to consider using is tmpfs.  tmpfs allows your to mount a folder of your filesystem in your system’s RAM.  Before using tmpfs there are somethings you must be aware of.  You need to have enough additional RAM available to hold your data.  Your data will be stored in memory which means that it is volatile.  If your system crashes or restartts then you will  lose everything stored in tmpfs.  With that in mind, use tmpfs at your own risk.  If you intend to keep your data save it to disk when you are done using tmpfs.

To mount a folder as tmpfs


$ sudo mkdir /mnt/tmp

$ sudo mount -t tmpfs -o size=1500m none /mnt/tmp

Every file that you put in /mnt/tmp will actually be stored in system RAM.  Reading and writing to those files will be extremely fast.

I’m going to create an image of a 1GB SD card in /mnt/tmp and use it with my Android emulator.


$ mksdcard -l stick1 1024m /mnt/tmp/sd_card_1g.img

$ emulator -sdcard /mnt/tmp/sd_card_1g.img @fakeDroid

This boosted the performance of my Android emulator because it’s using RAM for its SD card.  When I am finished with my Android emulator I will copy my data back to disk for safe keeping.


$ cp /mnt/tmp/sd_card_1g.img ~/sd_card_1g.img