Friday, February 26, 2010

Dual Booting an HP Mini 210 HD with Windows and Ubuntu 9.10 64-bit


So you just bought an HP Mini 210 HD netbook, and want to shrink the Windows partition so you can install Ubuntu 9.10 64-bit, eh? Well, you've come to the right place! I'll walk you through the process from booting it for the first time to tweaking both OS installs. I'll include some of my favorite Ubuntu tricks, but I won't bore you with trivial details, like how to unpack it, and where the power button is... just the important stuff for someone with some prior Linux (preferably Ubuntu) experience.

(most of this is broadly applicable, not just to netbooks, so don't stop reading just because you don't have my exact netbook!)

Windows Stuff
  • First, of course, turn it on, and go through all the normal Windows configuration stuff. I entered a few different users, but later decided I just wanted one user for the whole family. I was able to delete the other users and set a password under Settings... Control Panel... User Accounts.
  • Remove HP's pre-installed "crap ware" under Add Remove Programs.
  • Finish setting up Windows to your taste, installing software updates, etc...
Installing Ubuntu
  • Download the Ubuntu 9.10 64-bit iso.
  • Burn it to a USB flash drive by following the instructions on this page.
  • Go to this HP web page to see all of the boot-hotkeys, but to get into the BIOS, boot the system while holding the F10 key. Change the first boot device to a USB disk. Then reboot with your flash drive inserted. The Ubuntu installation menu should greet you.
  • Choose to boot into Ubuntu rather than install right away.
  • Double click on the installer on the desktop, and during installation, be careful to select the dual boot option when prompted.
  • In the partition setup, drag the slider down (which will be a pain, see below) so Windows has as much space as you think it needs (I chose 40 gigs, but you could probably get away with 30). I recommend leaving the file system as ext4, unless you have a reason to do otherwise.
  • After installation, don't reboot just yet. Make sure you have an ethernet cable plugged in, and when prompted, click "Continue Testing". Click the hardware icon on the top panel to select hardware drivers. Activate the Broadcom STA driver, but not the b43 driver. (Full disclaimer: It was significantly more challenging than this, but after much research, trial, and error, I'm pretty sure if you do it this way the first time, its'll "just work", and you won't have to futz around with it as much as I did.)
  • You'll notice the trackpad buttons have some issues, which will make adjusting the slider in the above step a pain. To fix this, after installing Ubuntu, launch a terminal, and do this:
> sudo su
> echo options psmouse proto=exps > /etc/modprobe.d/psmouse.modprobe
> reboot
  • Upon re-entering your fresh Ubuntu install, now would be a good time to go into Synaptic (System... Administration... Synaptic Package Manager), do a "Reload", then "Mark All Upgrades" and "Apply". This first software update is pretty extensive, so you'll have to reboot.
  • To use your webcam, install "cheese" through Synaptic. Cheese Webcam Booth will then show up under Sound & Video.
Space Efficiency
  • I encourage you to take a moment to customize the UI to best optimize your relatively small screen. Under Appearance Preferences... Interface... choose "Icons Only" for "Toolbar button labels". I like to consolidate down to just a single panel on the bottom of the screen, like Windows, and I set it to "Autohide". This setting can be found under Properties after right-clicking on it.
  • I also like to get rid of the Menu Bar on the panel, and instead replace it with the Main Menu, which is just a single icon. There are lots of other optimizations you can do with the items on the panel, just poke around and see what options you have.
  • I recommend going into System... Preferences... Keyboard Shortcuts and setting up shortcuts how you like. I have a strong preference for "ctrl + alt + ..." shortcuts. I do recommend that you make at least two; 1) Fullscreen: "ctrl + alt + f", and 2) Open Main Menu: "ctrl + alt + u". I know the main menu one is already defined, but this keyboard shortcut will prove very useful in the next step.
Fix the Main Menu Delay
  • You will notice a delay when clicking on the Main Menu icon for the first time after rebooting or re-logging in. This is because it doesn't properly cache its icons, and has to reload them at the beginning of each session. It is snappy after this first click, however. If this annoys you like it annoys me, you can fix it by following the next steps.
  • Note that this is probably only applicable to Ubuntu 9.10 and earlier. I've heard rumors that it is fixed in 10.04.
  • First, install the X-Virtual Keybaord via Synaptic (xvkbd). This allows you to execute keyboard commands from within scripts, and we're going to create one which quickly opens and closes the Main Menu behind the black login screen during the login process. You'll never notice it!
  • To do this, open System...Preferences...Startup Applications
  • Then add a new command to execute this:
sh -c "sleep 6 && xvkbd -text '\C\Au' && sleep 0.1 && xvkbd -text '\[Escape]'"
  • Whala! Reboot and check it out. No more delay on first-click! You may, however, need to tweak it a bit (the number of seconds in the sleep commands). It needs enough delay for Ubuntu to have loaded your keyboard shortcuts, but too much delay, and it'll be visible. It seems like there needs to be a delay before hitting "escape" to close the menu, to give the menu enough time to open, and 0.1 seconds seemed to work well for me.
Firefox
  • Since this is a 64-bit install, rather than going through Synaptic to install Adobe's Flash Player, you'll have to install it manually... but its simple! Download it here. Extract it, then install it with this command:
> sudo cp libflashplayer.so /usr/lib/mozilla/plugins/
  • Restart Firefox, and you're set!
  • To further optimize your precious screen realestate, you should turn off the status bar (View...Status Bar), and install Tree Style Tabs, which makes much better use of the excess horizontal space available with the wide-screen display.
Multimedia File Support
  • To get movies and other multimedia files playing, do this:
> sudo apt-get install vlc ubuntu-restricted-extras
> sudo /usr/share/doc/libdvdread4/install-css.sh
  • I recommend using .iso files as your default movie file type. They are the raw binary data ripped straight from a DVD using Ubuntu's built-in DVD burning ability (right click on a mounted DVD on your desktop, then choose "Copy Disk", and copy it as an .iso file).
  • I then recommend setting VLC as your default movie viewer for .iso files by right clicking on a .iso file, choose Properties... Open With, then add VLC, and choose it as your default.
Customized Boot Menu
  • I like to customize my grub (boot) splash screen. To do that, I followed this guide.
  • I also like to reduce the grub menu timer to 5 seconds (instead of 10 seconds). You can do this by modifying the line "GRUB_TIMEOUT=10" to say "GRUB_TIMEOUT=5" in the file /etc/default/grub. Be sure to "sudo update-grub" after changing the file.
Install software not found in default repositories
  • To install Google Earth, follow the instructions found in my previous blog entry
  • A nice, screen-space-efficient browser alternative is Google Chromium. You can add the daily-build to your software repositories by following the instructions here.
  • If you have a digital camera and like to process RAW files, I recommend RawStudio. You can add the daily-build to your repositories here.
Conclusion

This stuff was pretty easy, eh? Not too technical, but there is a lot to do after a fresh install. It only takes a few hours, and should make your computing experience that much more enjoyable. Happy Ubuntuing!

PS: I've tested every last little bit of hardware on this netbook, and every single thing works.... the headset jack (for integrated microphone ear-bud hands-free headsets), the speakers, the wifi, the webcam, everything. I'm impressed. It can sometimes be a bit of a challenge to get everything working under 64-bit Ubuntu.

    Friday, February 12, 2010

    Spelling and Dictionary Lookups at Bash Command Line

    If you've ever wanted an easy way to look up a word in the dictionary, or spell check a word at the command line (in Linux), I've come up with a simple way to do it.

    First, make sure you have aspell and curl installed, then simply paste the following functions into your .bashrc file:

    function dictlookup
    {
    curl dict://dict.org/d:$1
    }

    function spellcheck
    {
    echo "$1" | aspell -a -c | grep "&"
    }

    Now you can do things like this:

    > spellcheck antecedant

    and:

    > dictlookup antecedent

    Enjoy!