Virtualbox clipboard workaround

With Virtualbox OSE 1.5.2, host Kubuntu 7.10 and guest Win XP I have intermittent clipboard problems: Garbled text, often even from one Linux app to another.

I tried upgrading to VirtualBox 1.5.4 non-free but had network problems with it.

Finally I came up with the following workaround. The idea is to write/read the clipboard using a temporary shared file. Prerequisites:

  • Install xclip in Kubuntu.
  • Put the cat, pclip and gclip commands in the PATH of the Windows system.
  • Set up a Samba share that both guest and host can read and write to.

In my setup the share is /share in the guest and mounted as network drive S: in the guest. The temporary file will be in /share/clipboard/.

Create an application shortcut in Kubuntu with the Application command

xclip -o > /share/clipboard/clip.txt

and drag it on the taskbar so that you can execute it with one click. To avoid annoying startup notifications disable them in the “Advanced Options” in the “Application” tab of the shortcut. Now you should be able to copy the content of the X clipboard to the temporary file with one click.

In the guest system (Windows) you do the same thing in reverse but with a keyboard shortcut: Put a file clip-in.bat into a safe location (where you won’t accidentally delete it) with the following one line of code:

cat S:\clipboard\clip.txt | gclip

Create a desktop shortcut pointing to clip-in.bat and define a keybard shortcut for it (under right-click, Properties..), e.g. ALT-CTRL-C.

Now you should be able to mark and paste from the host to the guest system in the following way:

  • Mark some text in the host (Kubuntu) system
  • Click the shortcut in the KDE taskbar
  • In the host system press CTR-ALT-C and then CTRL-V (to paste)

The return of the console mailer: ALPINE

ALPINE start screenMany students had to use it at the university in the early years of the Internet: PINE, the text mode mail client. I was one of those students and I actually liked it and configured it to the maximum.

Somehow I later switched to Mozilla Thunderbird and haven’t used a text mode mailer since. But this week I discovered “ALPINE”. It is sort of “PINE reloaded”, as Open Source under the Apache License (think Apache License PINE).

I set it up for Gmail with IMAP (thanks to the author of this blog entry):

  1. Start ALPINE and type S L A (Setup > collectionLists > Add)
  2. Enter something like the following but replacing “id” with your gmail name:
  3. Nickname : Gmail
    Server : imap.gmail.com/ssl/user=id@gmail.com
    Path :
    View :

  4. Press CTRL-X and then E to save the setting.
  5. Type S C (Setup > Configuration) and set up SMTP to use the gmail server:
  6. SMTP Server = smtp.gmail.com:587/tls/user=id@gmail.com

I noticed that I had to install the package “ca-certificates” on my Kubuntu system. Otherwise I got a certificate error.

Learning Mac OS X

At my job I am now working to some extent with Mac OS X. My overall impression: Looks good but like Windows it is built on the assumption that “the user should not know how things work”. Some things are done quite elegantly but others are just too dumbed down for my taste.

On the command line the first thing that I noticed was that all the standard folder names start with a capital letter and are more verbose than on Unix. The default shell is bash which is nice for me since I am used to it and know it quite well from Linux.

The version of the Vim editor that comes with OS X is outdated and not very convenient to use. I installed a Vim 7.x build from macvim.org.

I learned about DMG images and that it’s not easy or sometimes even impossible to mount them on Linux. Otherwise mounting was pretty straightforward, for example the SMB share that I use to export my Linux home directory. I could have tried to do the same with NFS but SMB was just easier and I didn’t want to go into the details of uid and guid mapping. Plus, the SMB share is also accessible from the Windows that runs inside a Virtualbox.

One small thing that I don’t like on the Mac is the lack of a “Maximize window” function that maximizes the current window as much as possible. I guess I am not the only one.

Windows in a box

Until quite recently I did not use any operating system virtualization software. On my main PC I ran only Kubuntu and on my laptop I had a dual boot setup with the Windows XP installation that came pre-installed and Kubuntu.

VMware was not very appealing to me since it is proprietary software, not Open Source. A few weeks ago I gave VirtualBox a try. It is available as an Open Source Edition (OSE). There are packages included in the Ubuntu distribution so it was quite easy to install.

I must say that I am very impressed. The UI is intuitive, well documented and straightforward to use. I installed Windows XP Professional as a guest system and it worked without problems.

I had to realize, though, that “Shared Folders” are only supported in the Commercial Edition. That is not a problem since Folder Sharing can be done with Samba.

“Seamless mode” makes the experience even better: The windows from the Win XP desktop and the Kubuntu desktop appear as parts of one united desktop, with the taskbar and desktop background changing according to what window is currently active.

VirtualBox is developed by the German company InnoTek. Keep up the good work, guys!

Geeky stuff, here it comes!

This is my new dedicated tech blog. I will mostly write about Java programming, Free and Open Source Software (FOSS), operating systems and other geeky stuff …

I moved one post from my previous blog to this one and preserved the entry date. That’s why there is one seemingly “old” entry about Bugzilla whining.