Battery Charge Monitor
For the past few days, the battery charge monitor applet up in the notification area has been showing an all white icon at 0% charged, even though it has been connected to the AC power consistently. Hovering my mouse brings up the tooltip balloon which shows either:
Computer is running on AC power
Laptop battery charging (0%)
Battery charge time is currently unknown
or
Computer is running on battery power
Laptop battery discharging (0%)
Battery charge time is currently unknown
This problem persisted through multiple reboots and I finally got sick of it. I did some research and read through several bug reports before the obvious solution just donned on me. I shut down the computer, pull the battery and reseat it, boot up on battery power (AC adapter not hooked up), and there it is with the green charging battery icon at 89% charged. Now my tooltip balloon correctly shows:
Computer is running on battery power
Laptop battery 2 hours 15 minutes remaining (89%)
Battery discharge time is estimated
Return to Bluetooth
None of the updated guides for setting up bluetooth input devices (Apple Keyboard and Mighty Mouse) in Ubuntu 8.04 Hardy Heron worked for me, so I’m going to try the same method I used to get it working in Gutsy:
Turn on the keyboard and mouse, then in a terminal, scan for the devices:
$ sudo hcitool scan
The scan returns:
XX:XX:XX:XX:XX:XX ezkeys
YY:YY:YY:YY:YY:YY ezmouse
Where XX:XX:XX:XX:XX:XX / YY:YY:YY:YY:YY:YY are the hardware addresses of the devices, and ezkeys / ezmouse are the names of the keyboard / mouse. Then I need to add these devices to a bluetooth device configuration file:
$ sudo gedit /etc/bluetooth/hcid.conf
where I go to the end and add:
device XX:XX:XX:XX:XX:XX {
name "ezkeys";
auth enable;
encrypt enable;
}
device YY:YY:YY:YY:YY:YY{
name "ezmouse";
}
for good measure I enable HID support at startup:
$ sudo gedit /etc/default/bluetooth
Where I change
HIDD_ENABLED=0
to
HIDD_ENABLED=1
Then restart bluetooth with
$ sudo /etc/init.d/bluetooth restart
When the restart is done, connect the keyboard using
$ sudo hidd --connect XX:XX:XX:XX:XX:XX
and change the address to connect the mouse
$ sudo hidd --connect YY:YY:YY:YY:YY:YY
And yes, they both work. As always, I want to thoroughly test this, so I turn off both devices and reboot. At the login screen I switch them back on and, sure enough, I can move the mouse and type to login.
The keyboard part of this process used to be described on the MacBook Pro Community Wiki Page, but these steps have been superseded by the graphical setup. Of course, that way didn't work for me. So I referred to my archived copy of the instructions from that page, along with my archived copy of a very similar guide at Ubuntu Unleashed, which now shows Hardy Heron in the title, but still contains the same instructions that I used in Gutsy.
Sharing With Samba
To set up file sharing using the samba service, I’m following a howto guide on the Ubuntu Forums. Here’s the basic steps without all the exposition in the guide (with the assumption that I just want to share a folder /s with myself and no one else):
Install samba:
$ sudo apt-get install samba
Stop samba:
$ sudo /etc/init.d/samba stop
Backup samba configuration file template, then create and edit a new configuration file:
$ sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.template
$ sudo touch /etc/samba/smb.conf
$ sudo gedit /etc/samba/smb.conf
Paste in:
[global]
; General server settings
netbios name = ezmac
server string =
workgroup = WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
passdb backend = tdbsam
security = user
null passwords = true
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast
wins support = yes
printing = CUPS
printcap name = CUPS
syslog = 1
syslog only = yes
[s]
path = /s
browseable = yes
read only = no
guest ok = no
create mask = 0700
directory mask = 0700
force user = ez
force group = ez
Start samba:
$ sudo /etc/init.d/samba start
Add myself as a samba user and activate:
$ sudo smbpasswd -L -a ez
$ sudo smbpasswd -L -e ez
That’s all it takes to be able to login from other computers and have full access to the files in /s. But I also want to be able to mount shares being served from the other computers on my network. For that I run:
$ sudo apt-get install smbfs
then to mount a network share I run:
$ smbmount //XX.XX.XX.XX/share /path/to/mount/point
and unmount with:
$ smbumount /path/to/mount/point
where XX.XX.XX.XX is the local ip address of the server, share is the name of the network share, and /path/to/mount/point is obviously the path to the mount point. In gutsy I could use the server name instead of the ip address, but that is not working for me now. I did some research and tried some things, but nothing worked so I’ll just do it this way for now (fortunately all of my computers have static local IP’s anyway).
UPDATE: I am now able to access my shares by server name after adding the static ip address and server name to the file /etc/hosts. Not sure how useful that is, since I still have to know the ip address and it has to be static, but this does work.
In addition to the guide I was following, I looked at a review of the ‘create mask’ and ‘directory mask’ options here and scanned some parts of Using Samba, 2nd Edition by Jay Ts, Robert Eckstein, and David Collier-Brown (this book is an awesome resource, read it).
A New User
To further test the results of my last post about auto-mounting a hard drive partition in Ubuntu Linux, I’m going to add a guest user named ‘friend’ and see if it has access to the drive.
I’m gonna do it the graphical way:
System > Administration > Users and Groups : Unlock : Add User
I’m just leaving the default privileges and then logging in with the username ‘friend’. As planned, clicking on the /s folder tells me I don’t have permission to open it.
Unfortunately, though, I’ve stumbled upon a BIG problem. Switching between users is almost totally broken. Either the trackpad dies and becomes completely unresponsive, or the screen goes totally black. This happens when I use the ‘Switch User’ option or the ‘Log Off’ option. After attempting to switch users, my only recourse is to completely reboot. Luckily, almost no one else ever uses the computer, so fixing this isn’t a priority. After I get the things I do use working, I’ll revisit this problem.
UPDATE: I did some research and the only thing remotely helpful with that problem was a post on the Ubuntu Forums. I can use the ‘Lock Screen’ and then hit the ‘Switch User’ button that shows on the login box to get in as a different user. This seems to work a couple times back and forth before things go bad. This really sucks, but as I mentioned before, it’s not a priority for me.
UPDATE: As I realized that I need to log off and log back in frequently, this problem has been driving me crazy to the point that I decided to reinstall. My initial test before installing anything (except synergy and the wifi driver) results in no issues with logging in and out and having different users switch back and forth. I’m going to be testing this after each step in my setup, so that if the problem recurs, I might have some idea what causes it.
Mounting a Partition
I forgot to specify a mount point for my shared FAT32 partition when I installed Ubuntu Hardy. The result is that the drive doesn’t automatically mount so every time I want to access it, I have to choose it from the Places menu and enter a password. Then the drive mounts to /media/SHARE, which is not at all what I want. I want to make it fast & easy to access the drive from a terminal, so I’m going to manually configure the system to automatically mount the drive to /s whenever I start the computer.
To do this, I create the mount point in the terminal:
$ sudo mkdir /s
then I get some info about my drive by running:
$ sudo fdisk -l
which tells me what I need to setup the auto-mounting by editing the /etc/fstab file (first I create a backup – always good form):
$ sudo cp /etc/fstab /etc/fstab.BKP_07302008
$ sudo gedit /etc/fstab
where I add the line:
/dev/sda3 /s vfat defaults,umask=007,uid=ez,gid=ez 0 0
which tells the system to mount ‘/dev/sda3′ at ‘/s’ with the type ‘vfat’ (fat32) using the default options, but give only me and my group permission to access the drive. Then I just save the file, exit, and reboot to test.
On reboot, all is well.
I got help on this from the Ubuntu Forums. I read through an excellent guide by Nana Langstedt at Tuxfiles.org. The article is packed details about how to edit the fstab file and actually understand it.
VirtualBox Revolutions
Based on the (limited) information I found about the upgrade to 1.6 on the VirtualBox forums here, here & here, I should be able to just install the new version, and it will automatically replace the old one with a working result. It’s worth a try now that I know I can revert back to 1.5 if I need to.
The install went ok, and when I launch the program, it comes up with a message that the settings have been converted to a new format. I have the option to save the changes, backup the old files and then save the changes, or cancel and not auto convert the settings. I’m choosing to just save, since I already have backups.
Now, that’s more like it! The virtual machine shows up and starts right away when I tell it to. Guess I just got ahead of myself yesterday by jumping to the new version. I’ll take this as a lesson to always restore backups in the version of the program where the backups were made (if at all possible). This also illustrates the benefits of the practice I usually follow of archiving the installer files for all of the software I install from the web.
By the way, even though I followed the “magic” step in the tutorials that is supposed to enable USB, it doesn’t work. I did some research that indicates I can set permissions in the /etc/fstab file and maybe do some other things to get it working, but I don’t really need all that. I just have the /media attached to the vm as a shared folder, so I can access any USB drives (like external hard drives which are automatically mounted in /media) simultaneously in both the Ubuntu host and the XP guest. This is actually better than the intended behavior that requires switching the devices back and forth between the host and guest which only allows access in one or the other. I can see that being necessary for like webcams or other peripherals that work with software in the guest, but for me and my hard drives I prefer this way (there may be a performance hit, but hey, it works).
VirtualBox Reloaded
Well, I was able to get into my XP virtual machine by uninstalling VirtualBox 1.6.2 (through Synaptic) and reinstalling version 1.5.6, which I was using before (I knew there was a reason why I wrote down the version numbers of all my programs when I was backing things up). Thanks to Ubuntu Unleashed for giving me the terminal command to download & install it:
wget http://www.virtualbox.org/download/1.5.6 virtualbox_1.5.6-28266_Ubuntu_hardy_i386.deb ; sudo dpkg -i virtualbox_1.5.6-28266_Ubuntu_hardy_i386.deb
My first attempt at running that command failed on two missing dependencies libxalan110 & libxerces27, but I quickly found them in Synaptic and the second try went right through. I also had to replace the .VirtualBox directory in my home folder with the one the that I had backed up to my external drive. To make things even more interesting, VirtualBox automatically showed my vm but it was inaccessible because their shared folders didn’t exist. I had to go and create a dummy folder where the shared folder used to be. After all that, I was relieved to have it start right up to my Windows desktop.
Now I’m going to look into the proper way of upgrading to the new version.
VirtualBox
I’ve decided to put off the bluetooth bs for now. Instead I’m going to install Innotek VirtualBox and restore my backed up XP virtual machine (vm) so I can some play poker on Full Tilt (all work and no play makes Jack a dull boy).
I’m going to follow the guide at Ubuntu Geek because they have the most recent tutorial I could find (posted about 18 days ago). Since I’ll probably want to check for updated instructions if I have to do this again, I’ll just link to it rather than repost their directions.
Note: I am somewhat surprised (but not shocked) to see that Virtual Box now belongs to Sun. If I remember, I’ll look into the details of the acquisition later.
Before reinstalling Ubuntu, I backed up the .VirtualBox directory from my home folder. To restore my vm’s, I’m copying the vdi file (which contains the vm) from my backup drive into the .VirtualBox folder that was just created automatically by the program. I’ve never tried this before, but some people here said it would work, so I’ll give it a go.
At the main VirtualBox screen, I click New and follow the directions on the screen (there is an option to select my existing vdi file).
Ok, apparently this doesn’t work. Launching the vm gives me a blue screen, so I disable all of the hardware options, and get a message about a critical error. I guess I get two F’s for the day. I’m frustrated so I’ll be putting this one off until further notice.
I hate to do it (again), but I’m gonna give the Ubuntu setup a rest and just go play cards on my Vista machine. Maybe someday everybody will make a Linux version of their software and I won’t have to do this anymore!
Bluetooth
Much to my surprise, my Apple Bluetooth Keyboard and Mighty Mouse are working out of the box in Hardy… well, maybe not.
I was attempting to set them up, so I turned them on and right clicked on the bluetooth applet in the notification area and chose preferences. I clicked to highlight ‘input devices’, which was already checked, then clicked to add a device. Since nothing showed up, I decided to go the old fashioned way and run a scan in the terminal. I bumped the Mighty Mouse incidentally and low and behold the cursor on my screen moved with it. The mouse was indeed working so I checked the keyboard and I could type just fine. I got all excited at first, but quickly realized that scrolling on the mouse was non-responsive, and the volume keys on the keyboard did nothing.
I decided to reboot and try again, but this time, I’ve got nothing. The mouse showed up briefly now in the bluetooth applet, and seemed to connect, but still didn’t work. Checking for input devices again shows nothing.
So I guess I’ll fool around rebooting and trying again, but I’m thinking I’m gonna have to go with my original plan and do things the hard way.
Touchpad
Setting up the touchpad to work in Ubuntu Hardy like it does in OS X with 2 finger scrolling and 2 finger tap to right click is easy but the solution is not obvious. Back up then edit the X configuration file Xorg.conf:
$ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.BKP.07292008
$ sudo gedit /etc/X11/xorg.conf
Replace the Synaptics Touchpad InputDevice section with:
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "SHMConfig" "true"
Option "LeftEdge" "10"
Option "RightEdge" "1200"
Option "TopEdge" "10"
Option "BottomEdge" "370"
Option "FingerLow" "10"
Option "FingerHigh" "20"
Option "MaxTapTime" "180"
Option "MaxTapMove" "220"
Option "SingleTapTimeout" "100"
Option "MaxDoubleTapTime" "180"
Option "LockedDrags" "off"
Option "MinSpeed" "1.10"
Option "MaxSpeed" "1.30"
Option "AccelFactor" "0.08"
Option "TapButton1" "1"
Option "TapButton2" "3"
Option "TapButton3" "2"
Option "RTCornerButton" "0"
Option "RBCornerButton" "0"
Option "LTCornerButton" "0"
Option "LBCornerButton" "0"
Option "VertScrollDelta" "20"
Option "HorizScrollDelta" "50"
Option "HorizEdgeScroll" "0"
Option "VertEdgeScroll" "0"
Option "VertTwoFingerScroll" "1"
Option "HorizTwoFingerScroll" "1"
EndSection
Restart X using Ctrl+Alt+Backspace and it’s working. I’ve spent a great deal of time trying to get drag and drop working with the touchpad, but haven’t been successful. I know I can live without it, so I’m just giving up on it.
There is another small issue with the touchpad. It is extremely frustrating to have an accidental mouse click move your cursor while typing on the keyboard. To correct the problem, I need a startup program:
System > Preferences > Sessions
with the following line:
syndaemon -t -d
Thanks again to the authors of the community wiki page.