External Display

July 31, 2008 at 7:42 pm (macbook)

The MacBook has a mini-dvi port, which I use to connect to external monitors both at work and at home.

At work, I use a mini-DVI to VGA adapter to connect to a 21″ Dell LCD. This works out of the box by automatically “cloning” the display to the resolution of the external monitor. This makes the laptop screen unusable, as only the upper left corner of the desktop shows and the rest runs off the bottom and right of the display, while the entire desktop shows on the external display at the full resolution (1600×1200). This is actually the behavior that I want, because my ThinkPad T61 is hooked up to a 21″ Samsung monitor and I want the Windows and Ubuntu desktops side by side on these 2 monitors (normally the ThinkPad uses both for a dual-screen Vista desktop).

In my home office, there is a different story. I want to use both the laptop screen and my external 19″ widescreen LCD for an extended desktop dual screen experience. Fortunately, this is easily accomplished with my mini-DVI to DVI adapter. I set this up with a little help from Ubuntu-Tutorials.com, where the author is using the same computer and the same size monitor that I have. He has a couple extra steps, though. All I have to do is:

Edit the X configuration file /etc/X11/xorg.conf:

$ sudo gedit /etc/X11/xorg.conf

and find the Section “Screen”:

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection

then insert the SubSection “Display” so it looks like:

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
SubSection "Display"
Virtual 2720 1700
EndSubSection
EndSection

where 2720×1700 is my virtual desktop size (1440×900+1280×800 = 2720×1700). Save the file, exit, log out, and log back in. With the mini-DVI to DVI adapter connected to the laptop and the monitor, I run the command:

$ xrandr --output TMDS-1 --mode 1440x900 --pos 1280x0

The screen will flicker a bit and then, like magic, the desktop will grow to fill both screens. I have created a launcher on my panel that will run the xrandr command so that I don’t have to type it in every time I want to use the extra screen.

More information about the xrandr command can be found at ThinkWiki.org where the author is configuring a different laptop with the same video card.

The only problem with this is that the Compiz desktop effects are automatically disabled and cannot be turned on while the ‘Virtual’ setting is present in xorg.conf. That line must be commented out in order to get the effects back, which of course means that I cannot use the external monitor and the effects at the same time. In Gutsy, I was constantly editing the xorg file and then logging off to switch back and forth, but eventually got tired of that and left the effects off all the time.

UPDATE:  I have come up with a way to make switching the Virtual setting off and on a little bit faster.  Rather than editing the xorg. conf file every time, I just maintain separate files, one with the Virtual line, and one without the Virtual line.  The files are called xorg.conf.v.on and xorg.conf.v.off, respectively.  Then I can use a shell script to copy the one I want over the active xorg.conf file as needed (I make a backup of the active file just in case).  I still have to log off after running the command, but at least I don’t have to edit the xorg file. I created panel launchers to run the following shell scripts:

Turn on the Virtual setting when I need to hook up my display:

#!/bin/bash
# Backup xorg.conf configuration file
# then overwrite with file containing desired settings
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.latest
cp /etc/X11/xorg.conf.v.on /etc/X11/xorg.conf

Turn off the Virtual setting when the display is disconnected and I want to enable desktop effects:

#!/bin/bash
# Backup xorg.conf configuration file
# then overwrite with file containing desired settings
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.latest
cp /etc/X11/xorg.conf.v.off /etc/X11/xorg.conf

Permalink Leave a Comment

My Own Menu

July 31, 2008 at 1:29 pm (Uncategorized)

Unlike the Windows and OS X counterparts, the Ubuntu menus are completely customizable. I like to go in and add some things that are hidden by default and maybe take out a few things that I’ll never use. Like it’s predecessors, Hardy Heron makes this painfully easy. I just right click on the Applications menu and choose edit menus. This brings up all of the menu possibilities in a kind of tree view where I can check or uncheck items as I see fit.

Permalink Leave a Comment

Battery Charge Monitor

July 31, 2008 at 1:12 pm (macbook)

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

Permalink Leave a Comment

Return to Bluetooth

July 31, 2008 at 10:31 am (macbook)

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.

Permalink Leave a Comment

Sharing With Samba

July 30, 2008 at 11:33 pm (macbook)

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).

Permalink Leave a Comment

A New User

July 30, 2008 at 9:51 pm (Uncategorized)

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.

Permalink Leave a Comment

Mounting a Partition

July 30, 2008 at 4:59 pm (macbook)

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.

Permalink Leave a Comment

VirtualBox Revolutions

July 30, 2008 at 3:21 pm (macbook)

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).

Permalink Leave a Comment

VirtualBox Reloaded

July 30, 2008 at 2:07 pm (macbook)

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.

Permalink Leave a Comment

VirtualBox

July 29, 2008 at 11:01 pm (Uncategorized)

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!

Permalink Leave a Comment

Next page »