Tuesday, August 18, 2009

VirtualBox: Folder Sharing between Windows Host and Linux Guest

To start, you need to install the guest additions. I use Ubuntu Server 9.04 so I followed steps outlined in this post.

  1. install necessary tools for building kernel module by:
    sudo apt-get install build-essential linux-headers-`uname -r`
  2. Next, click on menu "Devices" -> "Install Guest Additions..." then mount the guest addition CD-ROM within the Linux virtual machine by:
    mount /dev/cdrom /media/cdrom0
  3. Finally, run the installation script:
    sudo ./VBoxLinuxAdditions-x86.run

If you do not have X server installed, you may see a warning message about the X driver will not be installed. Ignore this message and now we are ready to configure the shared folder.

  1. Create the a folder for sharing on the host Windows machine (say C:\Shared).
  2. Click on the menu "Devices" -> "Shared Folders..."
  3. Add a new machine level shared folder by clicking on the + icon on the right
  4. Enter "C:\Shared" for Folder Path and "shared" for the Folder Name.
  5. In Linux guest VM, create a folder /opt/shared and add the following line to the bottom of /etc/fstab:
    shared    /opt/shared    vboxsf    defaults    0   0
  6. Reboot the VM

Monday, August 17, 2009

Resolve Linux Hostname from Windows

The simplest solution is to install samba:

sudo apt-get install samba

According to this post, this is because SAMBA implements NBT (NetBIOS over TCP/IP) protocol, which broadcasts the Linux machine's hostname on the network. Microsoft Windows understands the NetBIOS protocol so it pickups the Linux machine's hostname.

Saturday, August 15, 2009

Fix Touchpad Scroll Area in Xubuntu 9.04

I have a 6 years old Compaq Presario X1000 that I use occasionally for web browsing and programming. I installed Xubuntu 9.04 on it the other day and found out that the scroll area is too wide for the touchpad.

As my usual trouble shooting procedure, I googled around for answers and I found pieces of information spread across several websites.

Step 1 - Enable SHMConfig

First of all, we need to enable the SHMConfig in order to determine the correct scroll area width with synclient. I am pretty sure I used to enable this from the X11 configuration file, however in Ubuntu 9.04 based distributions you are supposed to create a HAL fdi file for this.

sudo vi /etc/hal/fdi/policy/touchpad.fdi

Put this into the file

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="input.x11_driver" string="synaptics">
      <merge key="input.x11_options.SHMConfig" type="string">True</merge>
    </match>
  </device>
</deviceinfo>

Save and close the file then reboot the machine. You can read more about this topic on Ubuntu community wiki.

Step 2 - Determine the correct scroll area with synclient

synclient helps you to determine the correct scroll area offset and is pre-installed on my Xubuntu.

Run

synclient -m 1

Now if you try to touch the touchpad, you will be able to see the coordinate of your finger in following format

 time     x     y ...
0.000  5468  3475 ...

After you determined the correct boundary of the scroll area you can then test it with

synclient RightEdge=<your value>

On my laptop, when I move my finger to the right edge of the mouse movement area the x-coordinate is 5942 and it jumps to 8176 as soon as I touch the scroll area. So I tried:

synclient RightEdge=8175

but for some reason, it disabled the scroll area all together. After some head scratching, I found out that I had to use the x-coordinate right before the scroll area (i.e. 5942).

Final step

After figuring out your RightEdge value, you have to save it by adding it to the touchpad.fdi file created eariler. In my case:

<merge key="input.x11_options.RightEdge" type="string">5942</merge>

So the touchpad.fdi file now looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="input.x11_driver" string="synaptics">
      <merge key="input.x11_options.SHMConfig" type="string">True</merge>
      <merge key="input.x11_options.RightEdge" type="string">5942</merge>
    </match>
  </device>
</deviceinfo>

Save and close the file then reboot and your touchpad scroll should work correctly now.

Sunday, August 9, 2009

Installing FIrefox 3.5 on Ubuntu 9.04 Jaunty Jackalope

Firefox is slow in Linux compared to XP or even Vista on the same hardware. Do a quick google search for "firefox slow linux" and you see it's not just me who's saying this.

I tried a couple of tips from other users in discussion forums such as disabling visual effects and IPv6 but it didn't really help. That's why I started thinking about installing Firefox 3.5 on my Ubuntu 9.04 64-bits machine to see if it makes a difference.

At first I though I will have to download it directly from the Firefox website, however to my surprise I found the package in Synaptic. I am not sure which repository it came from but I can see the package "firefox-3.5" from the Synaptic package manager.

I went through the usual installation process and frankly it did not prompt me to remove existing firefox-3.0 packages. Instead, it installs the Firefox 3.5 alone side Firefox 3.0 under the name Shiretoko Web Browser in the Application -> Internet -> Shiretoko Web Browser.

Could be just my wishful thinking but Firefox 3.5 does seems to be a bit faster than 3.0.