Thursday, 25 October 2007

Automatically Connecting to Wireless Networks

The Linux world still has the capacity to leave me shaking my head in bewilderment...

One of the things that Vista does really well is managing wireless network connections. Vista will automatically connect to an available wireless network without you having to do anything. If you look at a standard install of Linux, even an install of a "cutting edge" distro like Fedora 7, you would never guess that Linux offers the same functionality.

I have literally spent months looking for an easy way to connect to wireless networks. I looked at utilities like wlassistant and netgo; neither of which turned out to be much good. I even wrote my own bash script using iwlist to scan for available networks and iwconfig to connect. (This worked, but was let down by DHCP problems with dhclient when switching networks.)

The solution was installed on Fedora all the time. The only problem was that it was not enabled, and - worse - not visible. The solution is NetworkManager.

NetworkManager will automatically connect to an available wireless network. But that's not all it does. NetworkManager actively monitors your network connections so that if you plug in a network cable it will disconnect the wireless connection and use the faster wired connection instead; remove the cable and NetworkManager reconnects to the wireless network on the fly. Very, very, cool.

So how do you get it to work? To start NetworkManager manually you can just type the following on the command line:

/usr/sbin/NetworkManager

However, once you are happy NetworkManager is working for you, you will want to have it start automatically:

/sbin/chkconfig --level 345 NetworkManager on
/sbin/chkconfig --level 345 NetworkManagerDispatcher on
/sbin/service NetworkManager start
/sbin/service NetworkManagerDispatcher

Why was it so hard to find? Why isn't the Linux world trumpeting its existence? It is very strange. Perhaps the answer goes back to the issue of what Linux is for. Being a commercial rival to Windows doesn't seem to be what Linux is for- which is fine. So what are Redhat and Novell and Ubuntu doing?

There is more information on NetworkManager here and here.

Monday, 22 October 2007

VMWare - Bridging over Wireless

I couldn't get my VMWare Virtual Machines to connect to a network via my Fedora wireless connection. The solution is to use a patched version of the vmnet.tar file and then run vmware-config.pl again. vmnet.tar is located in /usr/lib/vmware/modules/source on my machine.

The patch is discussed here. It is available via the VMWare Communities page here.

Enabling Bluetooth

It's been a while since my last post. Mainly this is because Fedora 7 is working fine and I can just get on with my real job. I have to say it gives me a warm feeling to be using Linux: I don't have that nagging suspicion that I've paid to enter a pact where I'm allowed to use someone else's software in exchange for marketing my life. As a business desktop, Linux can best be described as practical. I've come to think of Linux as a screwdriver rather than an iPod.

Fedora has advanced in a few months to the point that it supports the D630's hardware natively; there is no longer a need to build the video and sound drivers, etc. One thing that I could just not get working however, was the Dell 360 bluetooth module. Finally, I found a discussion on an Ubuntu forum that explained that the problem only occurs on Dell machines with Vista pre-installed. (You may recall that Dell would not sell me a D630 without Vista installed.) The Vista bluetooth driver actually updates the firmware on the Dell 360 bluetooth module so that it can no longer be used by other Operating Systems, including Linux, but also XP. To fix the problem you need to install XP and downgrade the firmware by installing the XP bluetooth drivers.

So how to install XP? You can't install the XP drivers from a VMWare virtual machine, because the bluetooth module is obviously not visible to the host Linux OS, and so is not visible to the Guest OS. I don't have any unused space on my hard drive to create a new partition. How about installing XP on an external USB drive? Well it starts to install, but then won't boot because XP does not support booting from a USB drive. There is a way around this, however. You can craft a XP install CD to support USB drives: there are good instructions here if you need to do this. I didn't. I bought a second hard drive from Dell for £59 (about $120.)

Problem solved? Of course not. The D630 has a SATA hard drive and XP does not support SATA. What's more the Neanderthal XP installer allows you to install additional disk drivers only from the a: drive - and the D630 does not come with a floppy disk. To get around this one you need to craft another XP install CD to support SATA drives. This is not as onerous as it sounds. All you need to do is download the SATA drivers from the Dell website and then integrate them into the XP install image using the brilliant - and free - nLite Windows installation customizer. There are instructions here.

Once I had XP installed, I installed the XP bluetooth driver and that was it! When I restarted Fedora the Gnome Bluetooth Manager was showing the in notification area and running hcitool dev showed device hci0. All I need to do now is work out how to dial out...