Monday, February 21, 2011

VirtualBox Panel Indicator for Ubuntu

Big thanks to Michael Otto for creating an Ubuntu Indicator Panel applet! It has a drop-down menu that lets you directly launch any VirtualBox VM you have configured on your machine. Also props to the several kindly bloggers who gave instructions for installing this slick utility.

It's not part of the official Ubuntu repository (yet, I'm sure) so you need to add the correct repository and install it using apt. The command-line commands are:
sudo add-apt-repository ppa:michael-astrapi/ppa
sudo apt-get update
sudo apt-get install indicator-virtualbox
You can have it start automatically on log-in by adding it to the list of Startup Applications (System -> Preferences -> Startup Applications). The command to start it is:
indicator-virtualbox
This is so helpful it's bound to end up in the primary Ubuntu repository in the next release or two. Thanks again, Michael!

Saturday, February 19, 2011

Ubuntu Ambiance Icons for Dropbox 1.0

I found these icons for Dropbox that match the Ubuntu mono dark (ambiance) theme. The link includes instructions for installing the icons for Dropbox 0.8, but Dropbox is up to 1.0 now and the path and filenames have changed. The new path is:
~/.dropbox-dist/icons/hicolor/16x16/status
and the filenames have all been prefixed with "dropboxstatus-". With these minor tweaks, my Dropbox indicator now matches nicely with the rest of the Ambiance theme.

Saturday, February 12, 2011

Enabling DVD Playback in Ubuntu

Surprisingly, I've never done this before, but I needed to enable DVD playback on my wife's new netbook which she uses for her work. While I was at it, I also enabled it on my new laptop. We're both running Ubuntu 10.10 and loving it.

Because of Ubuntu's commitment to free / open-source software (and because of some licensing concerns), Ubuntu doesn't ship with the libraries to play mp3s, DVDs, or some other media formats. They are, however, freely (as in beer) available through the package manager / Software Center. Here's what I did to enable DVD playback:
  1. Installed Ubuntu Restricted Extras from the Software Center (ubuntu-restricted-extras if installing using apt or Synaptic).
  2. Verified in the Software Center that 'libdvdread4' was installed (it was for me, but you should install it if it's not).
  3. Ran the following command from a terminal to install the restricted DVD decryption codec (thanks to the Ubuntu Help site for this):
    sudo /usr/share/doc/libdvdread4/install-css.sh
  4. Installed 'VLC Media Player' via the Software Center. This may not be required, but Totem (Movie Player) crashed a few seconds into playing a dvd before doing this. After installing VLC, both VLC and Totem played the DVD fine. There are probably some codecs installed along with VLC that fixed the problem.
There it is. Both laptops are playing DVDs without any errors.

Wednesday, February 9, 2011

Disabling Ubuntu Swap Partitions

When installing Ubuntu on my wife's new netbook, the installation crashed mid-way through... after it reworked the partition table and added the ext3 and swap partitions. Some trial and error showed that Ubuntu had trouble recognizing the intended partitions when choosing to install alongside Windows again (it tried to cram everything into the space held by the shrunken Windows partition). So in order to get the partitions back to where they were, I tried to delete the new ext3 and swap partitions. Unfortunately, when booting to the Ubuntu Live USB stick, it mounted the swap partition on the main hard drive and prevented me from deleting it! Some googling showed me that I could force-disable all swap partitions via the command-line:
sudo swapoff -a
When running as the Live disk's default 'ubuntu' user, there is no password so there's no password prompt.

Turning off Bluetooth by Default in Ubuntu

The Ubuntu 10.10 install on my new laptop turns on the Bluetooth adapter by default, which is a minor battery drain. Since I rarely (if ever) use any Bluetooth devices, I'd rather turn off the adapter by default. Unfortunately, this is not as simple as changing an option in the Bluetooth panel application and requires some minor command-line tweakage.

Per this helpful post on the Ubuntu forums, I just had to edit the file '/etc/init.d/rc.local':
sudo vim /etc/init.d/rc.local
And add the following line:
rfkill block bluetooth
Although the post suggests putting the line at the end of rc.local, that didn't seem to work for me. So I added it near the beginning and all is well. Now, after booting up and logging in, the Bluetooth panel icon is happily grayed-out to show that the adapter is deactivated.

Friday, February 4, 2011

Remote Desktop (VNC) Refresh Problem in Ubuntu

I set up my main desktop computer to enable remote access to my desktop (System -> Preferences -> Remote Desktop). Then, when I access it from my laptop (Applications -> Internet -> Remote Desktop Viewer), I run into problems. I am able to make a connection, and see the initial screen state when I first connect. Any actions I take through remote desktop are visible on the desktop monitor, but my laptop's Remote Desktop Viewer doesn't get screen updates... it always looks as it did when I first connected.

This is apparently a known issue with a workaround. You just have to disable visual effects on the computer you're accessing (via System -> Preferences -> Appearance -> Visual Effects -> None). This is definitely not ideal as it does clunkify and de-prettify Ubuntu a bit on the target system, but I can live with it for now as I'll be using the laptop far more often.

Wednesday, February 2, 2011

Setting up a Mapped Network Drive in VirtualBox

I've set up a Windows XP virtual machine in VirtualBox to do .NET development. I want my work to be backed up by my host machine's backup software, but the 10GB virtual hard drives wreck havoc as the whole thing needs to be uploaded every time a single file on the virtual machine changes. To avoid this, I've set up a shared folder in the VirtualBox VM configuration, and in the VM I've mapped the share to a network drive. this way all the files on that mapped drive are stored on the file system of the host machine and can be backed up separately from the large virtual hard drive.

The steps were as follows:
  1. Create a folder on the host machine to serve as the VM's network share (all mine are under ~/VirtualBox/Shares)
  2. With the WinXP VM powered off, open up it's settings form the VirtualBox main console (right-click -> Settings)
  3. Under 'Shared Folders', click the 'Add Shared Folder' button
  4. Set the Folder Path to the folder you created above, note the Folder Name if you don't change it, and make sure the share is not marked as read-only. Click OK.
  5. Power on the VM.
  6. In Windows Explorer, open the 'Folders' side panel.
  7. Navigate to 'My Network Places -> Entire Network -> VirtualBox Shared Folders' and open the shared folder you configured above.
  8. Note (or copy to clipboard) the UNC path to the network share (probably something like "\\VBOXSVR\[folderName]")
  9. In Windows Explorer, choose "Tools -> Map Network Drive"
  10. Pick a Drive letter, and paste the UNC path from above into the 'Folder' text box. Ensure 'Reconnect at logon' is checked, and click 'Finish'.
Now you can open 'My Computer' and navigate to the drive letter you selected. The mapped drive will be there every time you start the VM.

Update 2/3/2011: Originally I removed the optical drive from the VirtualBox VM configuration so I could add the shared network drive as D: and move the optical to E:. But when I re-added the optical drive, the VM did not add the optical drive and had trouble mounting the network share to D:. After some tinkering, I ended up with the optical drive back on D: and mapped the network drive to E:. No trouble so far.