Archive for November, 2009

Changing the size of a VirtualBox disk image

November 28th, 2009

I use VirutalBox to virtualize a copy of Windows 7 on my Ubuntu machine. I use it for when I want to test sites in IE/Safari or when I need Visual Studio to do some .NET work. Naturally I want to keep the disk image as small as possible, but I often find that with all of the ginormous service packs that Microsoft is so fond of distributing, my guesses as to what a good size for the hard disk are usually too small.

There’s no easy way to resize a VirtualBox hard disk image, but it’s not that hard to do. Here are the steps:

  1. Get a copy of an Acronis Boot Rescue ISO.
  2. Create a new hard disk image of the size you want using the Virtual Box Virtual Media Manager.
  3. Attach the new hard disk image as a slave to the OS you want to grow.
  4. Boot the VirtualBox OS into the Acronis ISO.
  5. Use the Acronis tools to mirror the master disk into the new slave disk. The tools will automatically expand or contract the partition to match the size of the new disk.
  6. Toss the old disk image and attach the new one as the master. You’re done!

Things that used to work in Ubuntu Intrepid but broke in Karmic

November 11th, 2009

After a clean install of Ubuntu Karmic on my plain vanilla Dell Vostro 1400 laptop, I found that (as usual) a lot of stuff that used to work fine in Jaunty has broken in Karmic:

  1. My Broadcom wireless card is completely unrecognized. Hardy was polite enough to recognize it but let me know that there were no drivers. Intrepid recognized it and automatically installed the right drivers. So did Jaunty. Karmic, however, just plain old doesn’t see it. Not even in lspci.
  2. Resume from Hibernate hard crashes about half the time.
  3. The Firefox spell check dictionary defaults to en_AU instead of en_US. This is great if you live in Australia, but I happen to be from California.
  4. The famous IPv6 issues. DNS lookups take forever unless I specify a DNS server to use. With all of my traveling, the last thing I want to be doing is setting the DNS server for every single new wireless connection I encounter.
  5. I use a script to turn off my laptop’s screen when I want to save power (say if I’m playing music for a group at a hostel). I’ve mapped this short but handy script to ctrl+alt+shift+s:
    #!/bin/bash
    #turn the screen off after half a second.
    sleep .5 && xset dpms force off

    This used to work like a dream in previous distros. Now the screen turns off, but turns back on after a few seconds.

  6. My Intel GM965 (heinously borked in Jaunty, see this lovely section in the Jaunty release notes) now works at least, but with horrible slowness. Key presses and mouse clicks register slowly, there’s tearing when scrolling in any application, and things are generally dog slow. And I’m not the only one with this problem.

Come on, Canonical. How do you expect to be taken seriously when the OS you release next to Windows 7 has so many shamefully amateur problems? I can guarantee you that Windows 7 can at least resume from fucking hibernate and perform a fucking DNS request.

The thing that really pisses me off is that for a lot of these issues, we won’t be seeing a fix for another 6 months. That’s the pain of the fast release cycle: no time to do QA, so beta-quality software gets shipped. But no time to fix the problems, because to make the next release by the deadline, they have to start work yesterday.

Year of the Linux desktop? I’m not holding my breath.

How to stop the blinking wifi LED on Ubuntu laptops with Intel wireless cards

November 11th, 2009

Apparently Intel, in all of their brilliance, have decided that people using Ubuntu (and Linux in general) on laptops with an Intel wireless card simply must know when data is being transferred over wireless. It is of such paramount importance that you know this that Intel has decided to alert you by constantly blinking the wifi LED whenever data is being transferred. I think every other wireless card on the planet just has a solid LED light to indicate the wireless is on (or off, using the physical switch), but no, that’s not good enough for Intel. (Can you guess that the blinking light really annoys me?)

There’s no easy-to-find setting to change the LED to solid. But there is a solution: create a little script to change the LED to solid whenever you connect to a new wireless network. It’s pretty easy to do, too. Here we go:

  1. Create a new file using Nano:
    user@computer:$ sudo nano /etc/network/if-up.d/wifi-led-noblink
  2. Paste the following into your new file using ctrl+shift+v:
    #!/bin/sh
    #this script will prevent the wifi light from blinking when on.
    #to activate this script, create a soft link to it in /etc/network/if-up.d/
    echo none > /sys/class/leds/iwl-phy0::RX/trigger
    echo none > /sys/class/leds/iwl-phy0::TX/trigger
    echo none > /sys/class/leds/iwl-phy0::radio/trigger
    echo none > /sys/class/leds/iwl-phy0::assoc/trigger

    Press ctrl+x to quit Nano, then y to save your script.

  3. Make the script executable:

    user@computer:$ sudo chmod u+x /etc/network/if-up.d/wifi-led-noblink

That’s it! Next time you connect to a network, your wifi LED should remain solid. This works in Karmic. And next time you find yourself cursing the guys at Intel, just remember: at least you don’t have a Broadcom wireless card!

2010-07-21 Update!

As of kernel 2.6.34 this solution no longer works for me. However, commenter DM has suggested an alternative that does seem to work again.

  1. Create a new file using Nano:
    user@computer:$ sudo nano /etc/modprobe.d/wlan.conf
  2. Paste the following into your new file using ctrl+shift+v:
    #1 means do not blink
    options iwlcore led_mode=1

    Press ctrl+x to quit Nano, then y to save your script.

  3. Restart your laptop.

This different solution should work if the above solution doesn’t.