bradubuntu linux

My experience setting up a computer with Ubuntu linux

30 March 2007

New Ubuntu Beta!

The beta for Ubuntu 7.04 just came out, so I upgraded my laptop. I was going to just run the upgrade software, but it said it had to download about 1000 files and take about 2 hours. It was quicker for me to just download the beta LiveCD over BitTorrent (about 5 minutes), but the ISO file to a CD (about 5 minutes), and just do a fresh install (about 30 minutes). I know I lose all my current configuration files, but who cares. Apparently ubuntu 7.04 has better wireless support, although I'm going to have to reinstall the Windows drivers for my wireless card using ndiswrapper. It's not like I had any personal files on there anyway.

The install went smoothly and so did the subsequent partial upgrade. That's all I have time for right now.

18 March 2007

Downloading not-so open source software

Ubuntu only comes with completely free and open source software. Stuff like mp3 playback and True Type fonts don't fall under that category, so in order to download that stuff using the automatic package manager (which is quite nice by the way), I have to enable additional "software sources". There is a Software Sources control panel. There are two additional check boxes that need to be selected, "Community maintained Open Source software" and "Software restricted by copyright or legal issues".

There are two easy ways to install these types of software, Automatix2 and EasyUbuntu. Automatix does more installations, but Easy Ubuntu concentrates on codecs and file types rather than software. Automatix does everything that Easy Ubuntu does, so I chose that one. I'm pretty sure they work the same.

Wireless Setup: Part 3

After a few days, I've finally gotten ubuntu to connect to my secure wireless router at home. There were two pieces of software I needed: Network Manager and WPA Supplicant. Both are available using the automatic download package manager in ubuntu. The ubuntu website also has a page explaining how to get WPA wireless up and running. After installation, I am supposed to restart some program called "dbus".

sudo /etc/init.d/dbus restart

This doesn't change anything, but after logging out and logging back in, an icon appears in the top right corner of the screen. Clicking on it is supposed to list available wireless networks, but it only shows my wired ethernet. In order to get it to show available networks, I have to go into the Networking control panel and disable all my internet connections (not just unchecking them, I have to go into "Properties" and disable each one). Then right-click on the Network Manager icon and select "Disable Networking". Right-clicking again and "Enable Network" lets me see all the wireless networks nearby, except for mine. This is because my router doesn't broadcast it's SSID. Clicking on the Network Manager icon allows me to "Connect to other Wireless Network", where I can enter the SSID and password for my router.

Not surprisingly, this doesn't work. This is because I still need to set up WPA supplicant to do all the encryption. The first thing I need to do is figure out the hexadecimal passkey for my network.

wpa_passphrase NetworkSSID NetworkPassword

where "NetworkSSID" and "NetworkPassword" are replaced with the actual SSID and WPA password. This command will list the hex password. Copy this password for later. According to this page, I also have to create two text files for configuring WPA supplicant.

sudo gedit /etc/default/wpasupplicant

and add one line:

ENABLED=1

I think this allows other programs to use WPA supplicant, but I'm not sure. The other file is the real configuration file.

sudo chmod 600 /etc/wpa_supplicant.conf
sudo gedit /etc/wpa_supplicant.conf

and add the lines:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1

network={
ssid="NetworkSSID"
#psk="NetworkPassword"
psk=PasteHexadecimalPasswordHere
key_mgmt=WPA-PSK
proto=WPA
}

Other networks may also be listed in this file. Supposedly this configuration can be tested by the command

sudo wpa_supplicant -D ndiswrapper -i wlan0 -c /etc/wpa_supplicant.conf

Remember that my wireless card driver is ndiswrapper and my card is identified as wlan0. Of course this command didn't connect to anything for me. Then I saw some other webpages that WPA supplicant may have problems if your router doesn't broadcast its SSID (like mine). So I enabled SSID broadcast. WPA supplicant still doesn't connect, but now Network Manager does. Go figure. I don't know what's going on here, but at least I can connect to the internet. I just need to remember to turn on the SSID broadcast before I try to use this laptop at home. I think maybe I didn't have to do all the WPA supplicant configuration, and that all of my problems would have been solved right away if I had enabled SSID broadcast. Oh well.

16 March 2007

Wireless Setup: Part 2

My wireless card apparently works, but I can't connect to anything. My wireless router at home used WPA security, so I decided to take my laptop to ASU, which has a public wireless network. Using the Networking control panel, I can enter the SSID for the ASU network ("asu") but it still won't work. The website for ndiswrapper mentions that the wg511v2 driver interferes with another driver called mrv8k and I need to "blacklist" mrv8k from loading at startup.

rmmod mrv8k
cp /etc/modprobe.d/blacklist /etc/modprobe.d/blacklist_backup
sudo gedit /etc/modprobe.d/blacklist

and add

blacklist mrv8k

to the end of the file. After another reboot, I still can't connect. I don't even think mrv8k was there to begin with. I tried messing around with different Windows drivers and versions of ndiswrapper, but nothing was working. I couldn't even connect to a public network! So I reinstalled ndiswrapper 1.8 and the Windows 2000 driver, and all of the sudden the yellow light started blinking! Success! I don't know what changed, but the card started working correctly.

The little network connection icon on the top right of the screen still showed that I was disconnected. But it was for my unplugged wired ethernet connection (eth0). Right clicking on the icon and selecting "Properties" allowed me to monitor my wlan0 connection. It also showed a signal strength monitor as well. Pretty neat. But I still have to try and get it to connect to my secure WPA router at home.

Wireless Setup: Part 1

After the update, everything seems to be working fine so far. The next immediate hurdle is to get wireless working. I have a Netgear WG511 (version 2) PCMCIA card. It did not "just work" in Ubuntu. To get it working, the first step is to see if Ubuntu recognizes the card.

lspci

This command lists a bunch of devices, including the wireless card, but instead of "Netgear WG511v2" or anything like that is lists

02:00.0 Ethernet controller: Marvell Technology Group Ltd. 88w8335 (Libertas) 802.11b/g Wireless (rev 03)

This is actually the chipset used in the card. Searching the web I found this page that describes how to install the proper driver. Basically, a native linux driver doesn't exist, but a program called "NDIS wrapper" exists that can interpret regular Windows drivers for linux systems. The webpage says to use ndiswrapper 1.8 and the Windows 2000 drivers. I used the Ubuntu Synaptic package manager to install ndiswrapper. Then I put in the Netgear CD that came with the card and (using the terminal) navigated to the directory containing the Windows 2000 driver. Within that directory there were three files: TRANS.TBL, WG511v2.INF, and WG511v2.sys .

sudo ndiswrapper -i WG511v2.INF

checking the install using

ndiswrapper -l

displays

Installed drivers:
wg511v2 driver installed, hardware present

Then we have to load the driver into the operating system

sudo modprobe ndiswrapper

And now the green light on the wireless card blinks, but not the yellow light. To install the driver automatically each time the laptop is started up,

sudo ndiswrapper -m

My laptop now recognizes the card as a potential internet connection called "wlan0". It shows up as a wireless device in iwconfig. I can detect wireless access ports by

iwlist wlan0 scan

First Boot

Once I was able to log into Ubuntu, a prompt told may that I needed to install updates. All I had to do was click a few buttons and the update was underway. No need for the terminal at all! This is very user friendly and makes me very happy. The updates took a while to install, and required a second reboot.

12 March 2007

A New Install (6.10)!

I decided while I'm working on stuff over Spring Break that I'll try installing Ubuntu again. Right now it's up to version 6.10, although 7.4 is supposed to come out next month. Nowadays, the Ubuntu download is a LiveCD, meaning you put it in your CD drive and restart your computer and it boots up off the Cd. This also lets you know how well you're hardware is supported before you install.

Well, since I've got a new laptop, and so does Kelly for her new job, I now have an old unused laptop. It's a Gateway Solo 1450, Pentium III, with about 512 MB RAM. Booting up with the LiveCD, all the laptop hardware appeared to be supported except for my PCMCIA wireless card. The LCD displays at near full resolution (1024x768) and sound even works. But the wireless card will take a bit of work. A quick search of the web indicates that linux drivers don't exist, and proprietary drivers must be used. I'll talk about this in a future post.

Once I was satisfied that Ubuntu would play well with my laptop hardware, I clicked on the install icon on the desktop (making sure it was connected to my home wired network). At this point I haven't had to use the terminal or enter text commands at all. Every major software program or control setting are available on the desktop menus. This seems alot more user friendly than in the past. The first few screens of the installer asked for all the pertinent information (language, keyboard setup, time zone, etc.). There was a small hiccup at first when the time zone screen popped up. I selected Arizona time, but the time shown was 3:59 rather than 12:59. So I clicked the "set time" button and changed it. But this caused the installer to freeze. Since I'm a newbie, I don't know how to kill frozen programs in linux yet, so I just logged out of Ubuntu and logged back in. Running the installer again, the correct time was automatically adjusted. I think I just needed for the CD to run. A LiveCD session runs pretty slowly sometimes. Anyways, once that was out of the way the rest of the install went fine.

Once finished, I needed to restart the laptop. I took out the CD and booted from the hard drive. After a few minutes the Ubuntu login screen popped up and I signed in with my new username and password. ... "Incorrect username or password. Use the correct case." ... It appears I have locked myself out of my own computer. I'm pretty sure I know the correct username and password, but they just wont work. Luckily, there's a workaround, using the LiveCD. Once booted from the CD, I had to mount my hard drive. Some of the following commands require a "sudo" in front. First make a directory for it.

cd /mnt
mkdir /mnt/hda1

Then I can load up the hard drive (hda1)

mount /dev/hda1 /mnt/hda1

Then set that new directory as your home directory

chroot /mnt/hda1

Within the new directory, check the list of users (they each have home directories)

cd /mnt/hda1/home
ls

Since I have only one user, this just listed "bdegreg". So I knew my username was in there, but what about my password? Searching online, I discovered that a passwords file exists.

cd /mnt/hda1/etc
gedit passwd

This opened the password file. My entry was at the bottom:

bdegreg:x:1000:1000:Brad De Gregorio,,,:/home/bdegreg:/bin/bash

Unfortunately, the "x" after my names means the password is hidden. But I can always change it.

passwd bdegreg

This prompted me for a new password, and I chose a very simple one for now. After that, I was able to log in as myself for the very first time.