Category Archives: Ubuntu

Bluetooth using the gui in Ubuntu

Bluetooth is of course a well-known mechanism for connecting mobile phones and pda’s to computers and laptops. It is low-power, easy to setup, and works out of the box on most systems. Until recently setting up serial over bluetooth in ubuntu/debian wasn’t a trivial task. I was by all means doable, but for many people meant creating and copying, downloading and tailoring some command-line scripts. This difficulty is mostly still noticeable when looking at the sheer amount of blogposts and articles and wiki’s about this setup. The tools are there (bluez has been in development for years) and work great, but setup is not for Joe / Jane Average.

When I revisited using my mobile phone’s GPRS modem on my netbook via bluetooth (an Acer Aspire One, running Ubuntu Intrepid, 8.10), I found hundreds of articles detailing the aforementioned edits… and a couple about achieving the same with a gui. The sysadmin-side of me prefers console solutions as these can be used over ssh (so I can set this up for others), my advocate-, user-and blogging-sides wanted a gui.

I found Blueman (http://blueman-project.org/). I first read about it last november (at version 0.6) and was impressed, at time of this writing it is now at 1.02 and working even easier than before, thumbs up!

In this article I’ll have a look at setting up Blueman “the easy ubuntu way”, i.e. mostly from a gui, with package signatures and without using a terminal (I will have to cheat though :-( ).
Continue reading

Pre-loading debconf values for easy installation

Debian’s configuration management might take some getting used to, but after you learn your way around /etc/{default,init.d,} it makes good sense.

Now when you have to do the same thing over and over again (ever said yes 25 times to Sun’s java license?), or you find that after a dist-upgrade your ldap configurations are gone because you pressed ‘enter’ one too many times…; you could either keep lots of tarballs or digg deeper. The latter could be done with debconf. Debconf keeps all answers to questions packages can ask during installation, both the ones you gave yourself and the implied or low-priority ones chosen by the packager.

You can set those values yourself quite easily, once you know how.
Continue reading

Ubuntu .local domain resolving issue’s and iptables prerouting

In the past few days I’ve been helping a new colleague at my current job with getting his development area setup in Ubuntu. Most of us work with Windows, including myself since I’m not working on my laptop but on a provided desktop, so helping someone with Ubuntu is nice for a change.

But  we ran into a problem that I couldn’t explain right away, if we tried to “ssh” to our svn repository it didn’t resolve the hostname, while “normal” host lookup programs had no trouble with resolving it at all. So I posted the problem on the Ubuntu forums. Unfortunately the first response was a bit disappointing: “does it work when you try to ssh via ip?”… So I thought lets call a friend who helps me out more often in cases like these. And indeed he knew the answer. It seems that avahi is causing this problem. I’ve not yet found out why avahi is doing this, but I guess it’s a bad idea to use avahi while you need to work with a “.local” domain.

I wanted to know why avahi did this, so I thought lets join the Ubuntu IRC channel. Unfortunately I didn’t get an explanation. But I got to see something about iptables that I didn’t know about before, prerouting. Someone asked the following question:

2008-11-11 21:53:48 < deus> It is possible to use the iptables to redirect http traffic to a proxy server, for example by using iptables -t nat -A PREROUTING -p tcp -i br0 –dport 80 -j DNAT
–to-destination <ip proxy>:3128 But how does the proxy server know which site he has to lookup since the destination is changed to its own address?

I didn’t know the answer to that, guess it works via the HTTP protocol itself, but well, perhaps I’ll find this out some other time. But while I was looking into this prerouting thingy I found a nice blog post about using prerouting for flash remoting. I’ve no use for this information yet, but you never know.

Followup on the Belkin F5D8053 and Ubuntu

Seems my previous blog post about the Belkin is found quite often when people search for how to get it to work on Ubuntu in general, also with ndiswrapper. Please note, my post is not about getting it to work with ndiswrapper (that worked fine in my case, but I’m on 32-bit Ubuntu, and didn’t try it on 64-bit). There are quite some posts about getting it to work with ndiswrapper (also posts about it not working, will drop him a comment). This one also explains how to unpack the windows driver if you don’t have a windows installation.

Anyway, so far about using ndiswrapper. Recently ralink released a new version of it’s native linux driver, 1.3.1.0 which can be found on their linux support page, and with this one I got the Belkin F5D8053 working. It doesn’t see the 5Ghz network I’ve over here, but well I don’t want to do normal Wireless over that network anyways, since that will decrease the speed of the Wireless to Wireless bridge I setup. I’m still blaming incompatibility between the Belkin USB stick and the Apple Airport routers for the Belkin not being able to find the 5Ghz network.

What I had to do to get it working.

1. make sure you can build kernel modules: sudo apt-get install build-essential linux-headers-generic
2. check if your Belkin USB id is listed in the driver: lsusb | grep Belkin | awk '{print $6}';, which returns 050d:815c in my case. Then use the id found in grep -i '0x050d,0x815c' include/rt2870.h if that returns a result, then skip step 3 since your device is already supported by the driver (please note the '0x' added before the 2 parts and the ',' in stead of the ':').
3. If it’s not there add it: edit include/rt2870.h Search for Belkin; Copy/Paste that line and change the usb id of your device to that you found in step 2.
4. Edit os/linux/config.mk and change the HAS_WPA_SUPPLICANT=n HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n to =y.
5. Edit Makefile and remove any line containing /tftpboot (still don’t know why they are in there, and running make as normal user fails if they are in there)
6. make && sudo make install
7. Edit (as root) /etc/modules and add rt2870sta to it (remove ndiswrapper if you used that before to get it working).
8. Either reboot or do modprobe rt2870sta to get it working (if you used ndiswrapper before you first need to run modprobe -r ndiswrapper). You will also need a /etc/init.d/networking restart if you won’t reboot.

That was all I needed to do.

Trying to get the Belkin F5D8053 v3 to work on Ubuntu Hardy without ndiswrapper

Update: I got it working now, see my new post about it.

If I look at the Windows driver for my new Belkin F5D8053 it is based on the RT2870 chipset. There is a native driver available for this chipset. Unfortunately so far I’m not able to get it to work. This version is already linux 2.6.24 ready so I don’t need to apply these patches. But even though I’m able to compile it, I’m not able to use it, yet. Side note: the warning in the Ubuntu forums about backing up any existing configurations in /etc/Wireless/RT2870STA is useful, since you need to put your configuration in there and it’s removed by the make install.

One strange thing in the make process is that it wants to copy the result to /tftpboot. I’m not sure why it wants to do that, and I’m almost certain it shouldn’t be a part of the make process…

The first problem I ran into was the fact that the USB Device id for my Belkin, 050D:815C, is missing in the driver (that could be a big hint about it not being able to work for it …) so I added that to the include/rt2870.h (I copied the line for the other Belkin device and changed the device id into mine).

With that added, my Belkin is detected by the driver as ra0. But even when I compile it with:

HAS_WPA_SUPPLICANT=y
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

I’m not getting my device visible in the gnome network manager, so I tried the command line configuration options.

First I tried only configuring the /etc/Wireless/RT2870STA/RT2870STA.dat. But if I had only that file configured, the activity light was turned off on an ifup ra0. So I guess that’s not right.

Then I tried to configure it in the /etc/network/interfaces as described on the Ubuntu forums. The light staid on when I did ifup ra0 but no DHCP lease. So finally I tried the “iwpriv” way described here. But still no DHCP lease.

So I guess I’ll have to contact ralink, to see if they are able to help me out here.

Using VMware player for testing Internet Explorer on Ubuntu

One disadvantage of developing websites/web applications on Unix (in my case Ubuntu) is that it’s hard to test things on Internet Explorer. Yes, you have IEs4Linux but that’s just not the same thing.

For real testing with the different versions of Internet Explorer Microsoft makes images available so you can test your websites/web applications in Microsoft Virtual PC. Unfortunately it’s not easy to use them when you develop on Unix.

So I wanted to see if I could convert these images into VMware images, since VMware player can run on Ubuntu. And it seems this is possible. Even though I’m not entirely sure I don’t break any EULA’s with this… To get it all working you need a Windows machine (with administrator rights) on which you need to unpack and convert the images. This conversion is not needed when you use VMware workstation. This conversion needs to be done every 6 months or so, since the windows version on the VPD has an expiry date.

Installing VMware player
Download VMware player tar.gz unpack it and run the installer as root.

When you are installing it you might get the following error (if you have a newer kernel):

include/asm/bitops_32.h:9:2: error: #error only <linux/bitops.h> can be included directly

But long live people who blog about their experiences, here is the solution for this problem. The writer forgot to put sudo before some of the commands and he assumes you came on his site after it failed and you didn’t try to remove the partially installed VMware player. Here are the steps with all the sudo’s:

  1. cd /usr/lib/vmware/modules/source
  2. sudo cp vmmon.tar vmmon.tar.orig (if you want to be able to undo your changes)
  3. sudo tar xvf vmmon.tar
  4. sudo vi vmmon-only/include/vcpuset.h
  5. change line 74 from: #include "asm/bitops.h" to: #include "linux/bitops.h"
  6. sudo rm vmmon.tar
  7. sudo tar cvf vmmon.tar vmmon-only/
  8. sudo rm -rf vmmon-only/
  9. sudo vmware-config.pl

Then you have a working VMware player.

Getting the Virtual PC Images
Microsoft makes VPC images available for IE6 and IE7, and now also the IE8 beta 1. Just download them and unpack them on a windows machine.

Converting the Virtual PC images
Get VMware converter to convert the free Virtual PC images to VMware images. Before you can convert them you first need to make a VPC image for the VHD. This can be done by running Virtual PC 2007. After that you can put the image in VMware converter and convert it into a VMware virtual machine. This is the part where I’m not sure if it’s legal or not. When converting the image, don’t forget to set the checkbox for the VMware tools.

Using the Virtual PC images
Because we use VMware player, we don’t have the VMware tools package. Lucky for us you can download the VMware workstation evaluation copy and unpack it. Then you need to copy the iso images in there to make sure that the VMware tools can get installed (you might get a message about inserting the windows xp sp2 cdrom, but if you just cancel those, the virtual machine still works good enough to test IE). You might wonder if this is legal, but according to this thread it should be ok. The following command I used to copy them, but you need to be in the directory below the one where you unpacked the workstation evaluation copy.

sudo cp -r vmware-distrib/lib/isoimages /usr/lib/vmware/

After that you are ready to use the Virtual PC images with VMware tools.

Other nice things to do

Using your existing windows partition
Other thing you can do is use your dual boot windows partition. For now no blog post about that, since I didn’t try that out myself. But here are some links about it:

When you use the same windows install from disk and from VMware, you will run into problems with the Windows hardware based activation. But also for that problem a a solution exists and is blogged about. It’s pretty simple, if you know it. It seems that windows activation creates two files that contain the activation information. If you just keep both versions of the activation information available and copy them into the right place at the right time, all should work well ;-)

Running things outside the VMware scope
If you want the Internet Explorer in a window outside your virtual machine, you can do that using rdesktop. Some information about that can be found on the following sites.

A side note
Unfortunately, while writing this post I encountered one problem with referring to other articles which contain the HOWTO for your problem. When you google for Run Existing Windows Installation on Ubuntu with Vmware Player you will find a lot of referrals to one specific article, which is no longer available. This is the main reason why I copy/pasted the steps to install VMWare player, in stead of only linking to them.

AMD64 and 32 bits applications

I wanted Skype on my laptop, stupid me thought it was nice to have 64 bit linux. Many applications don’t seem to be 64 bit ready, one of them is Skype. Good thing there is a –force-architecture flag in dpkg, but still not all applications work that way. Skype is one of them. But I found a good script called getlibs that helps installing the required libraries, once more on the ubuntu forums.

But even though these type of scripts can be found, I’m still going to switch my Desktop back to 32 bits. The support for 64 bits is not good enough, yet. And well, since I’m not using > 4 Gb’s of memory, I don’t really need 64 bits.

Dual screen with docking station using xrandr

A colleague of mine uses the same laptop as I’ve. But he didn’t like the fact that the build-in display is not used when it’s docked in the docking station. He wants to use his laptop LCD as secondary display when he’s at work.

Unfortunately I’m still on Feisty, but once more Prevu came to the rescue. I found a post about the order in which to build the packages to get xrandr 1.2 (the required version to get the thing to work properly).

And then I used this ubuntu forum post to configure my xorg.conf.

I added:

Viewport 1680 0
Virtual 3360 1050

to the “Screen” Section of my xorg.conf (SubSection “Display”), restarted X and could use the following command to get my display to be a second display and not just a clone:

xrandr --output TMDS-1 --right-of LVDS --mode 1680x1050

To switch back to the clone I use:

xrandr --output TMDS-1 --same-as LVDS --mode 1680x1050

Or you can just restart X again.

This was all.

P.s. If anyone knows how you can dock the D830 on Ubuntu while running, please drop a comment. It kinda hangs when I try to do that and the only thing left for me to do is a hard reset.

Dell Latitude D830 and Ubuntu Feisty (64 bit)

I recently got a Dell Latitude D830 to work on, since I’ll be travelling quite a lot and for that it’s useful to have your development environment with you on the road. The disadvantage is that you can have your development environment with you all the time.

To get Ubuntu, the development environment we use at magproductions, working on it I had to use the Alternative install, since the Feisty live CD didn’t work. The new Gutsy live CD does work though. Only with that one there is a sound issue, see this ubuntu wiki page for a way to solve that. And well, I’ll wait till Gusty is used in the wild a bit longer before I’m going to upgrade.

Anyway, finally I’ve got it working with my docking station. There was an annoying bug in the intel linux driver which made it impossible for me to work with Ubuntu using the docking station. But a while ago that was fixed in the Gutsy version of the xserver-xorg-video-intel package.
I had to use Prevu to get the display working properly. Good thing the ubuntu forums have a lot of information. I just wish information would be placed together, that’s why I’m making this post now.

For Prevu I first had to understand how that worked. If you get an python exception while tying to build a package you need to look for dependencies. And then you need to build the dependency using Prevu first, before you continue. After building the dependency I had to run prevu-update, so Prevu knew that the dependency was available.

In the end I’ve the following Prevu packages installed:

libgl1-mesa-dri
libgl1-mesa-glx
libglu1-mesa
mesa-utils
prevu
x11-common
xbase-clients
xorg
xprint
xprint-common
xserver-xorg
xserver-xorg-core
xserver-xorg-input-all
xserver-xorg-video-intel
xutils

I also tweaked the touchpad a bit, for example I don’t like it to respond on my thumb when I’m typing. And the default speed is just horrible. For that I used the defaults from another ubuntu forums post. I ended up with

Section "InputDevice"
Identifier      "Synaptics Touchpad"
Driver          "synaptics"
Option          "SendCoreEvents"        "true"
Option          "Device"                "/dev/psaux"
Option          "Protocol"              "auto-dev"
Option          "HorizScrollDelta"      "0"
Option          "SHMConfig"             "1"
Option          "FingerLow"             "30"
Option          "FingerHigh"            "40"
Option          "MaxTapMove"            "100"
Option          "TapButton1"            "1"
Option          "TapButton2"            "3"
Option          "TapButton3"            "2"
Option          "MinSpeed"              "0.15"
Option          "MaxSpeed"              "0.90"
Option          "AccelFactor"           "0.10"
Option          "VertScrollDelta"       "25"
Option          "HorizScrollDelta"      "30"
EndSection

Another problem was that the CDRom drive was not detected. I used yet another site to fix that. Update, that site doesn’t really show that information (anymore?), but this site describes the fix.

Now a list of helpful sites: