Dedicated to my late brave, beautiful and silly mummy, Debra Ross. I love you mumster.

Skip navigation

My kingdom for a bigger notebook hard drive

An ominous sign of things to come?
An ominous sign of things to come?

It’s crunch time: alas after months of neglect and with so many assignments and projects active and being worked on at any one time, my internal 149 gibibyte (aka 160 gigabyte) hard drive has finally been maxed out. Bummer!

Having used Windows, Linux, FreeBSD, NetBSD and Mac OS X on computers with drives that are nearing breaking point, I do appreciate how incredibly stable the BSDs and Mac are under capacity stress. By comparison the general wisdom with Windows (at least when I still exclusively used it before 2003) was that you must reserve at least 10% of your drive at all time to maintain stability, NTFS included. By comparison, this MacBook Pro has been close full for a while now and still only EyeTV and the slow as molasses Microsoft Office 2008 for Mac applications are capable of crashing it.

As I’ve discovered the hard way though, notebook computers present their own set of storage challenges! For most of my life I’ve been a desktop computer user; it was only in 2006 when I made the decision as a computer science student studying overseas that a souped up notebook computer would make more sense for taking around to different houses and around campus than a new desktop.

Of course the problem with said notebook computers is that you can’t just easily slide in an extra hard drive when your existing one starts to fill up! Sure you can buy external drives, but they still won’t match the performance of the internal drive. What happens then is I tend to backup material to the external drives, but projects I’m compiling, editing video for or otherwise working on end up staying on the internal drive.

VMware Fusion 2.0 beta 2 New Virtual Machine Assistant
What can I say, I love toying around and exploring operating systems!

This is also a problem for virtual machines which I spend lots of time using and writing about. To satisfy my own addiction and fanaticism for studying operating systems, as well as for my work which involves compiling and testing applications, I have multiple VMs on this internal drive. Running these virtual machines on an external drive is completely out of the question given the performance would really, really suffer. Having 12 virtual machines which combined take up 72GiB on a 149GiB notebook drive though is also completely out of the question!

With my desktops in the past I tended to dedicate a smaller drive with the fastest RPM for the operating system and two larger, equally sized drives mirroring each other (later using RAID instead of software) for the data. On my current desktop back in Singapore which I SSH and SFTP into from here in Adelaide I have FreeBSD 7.0 AMD64 on its own dedicated, 10,000RPM SATAII drive with 32MiB of cache shared with binaries, and two 7,200 RPM drives for the home directories, port collections, documentation and served data. Ideally I’d love to have another super fast drive just for /swap too!

On this laptop I’ve got everything under the sun on one drive. Perhaps partitioning the drive and assigning the /Users directory to a secondary partition might help to compartmentalise the information and improve performance. On BSD and Linux it’s trivial to assign the /home directory to a separate volume, on Mac OS X I’m not so sure. Seems like I have some homework ahead of me!

This much taken up, on a 149GiB internal notebook drive. Bummer!
This much taken up… on a 149GiB internal notebook drive.

Of course it probably wouldn’t hurt cleaning this drive out either. I have a few Ruby scripts which I run each afternoon which cleans up my desktop and puts files in the appropriate places, but it can’t determine what is safe to delete and what isn’t. I need an electronic secretary I think. Make someone sign a NDA, then go through my drive and get rid of things. No, wait… perhaps that isn’t such a good idea.

As my fabulous father always says after ringing me from his office in Singapore which has more paper, books, phone receivers, emails and blood pressure tablets than Parliament House: "All I need is a time machine Ruben… then I’d work just fine"

Google Chrome goodness!

It seemed less than 5 years ago after Microsoft’s dominance over Netscape that the browser wars were over and innovation was all but dead. What a glorious time to be alive now!

Ah yes the intertubes are all abuzz with Google’s release of it’s Chrome web browser. As soon as the initial reaction of "oh no, not ANOTHER browser to test documents in!" quickly faded, my curiosity and general love of Google products took over and I went to their website to download the first beta, and to see how it compares with my beloved Camino.

As far I as I can tell given the limited information available (and feel free to corrrect me if I’ve made a mistake!), Google Chrome is based on Webkit, the rendering engine Apple adopted from the KDE Konqueror project. This is of course the same rendering engine used in Apple’s Safari web browser and Nokia’s Symbian browser amongst others.

Google Chrome in the Mac OS X dock

Unfortunately for me, Chrome currently is for Windows only, and it has to be XP or Vista as well; my Windows 2000 virtual machine on my MacBook Pro couldn’t even feel the love. Given it is a very early beta that’s understandable though, and Google has stated that support for Mac and Linux is in the pipeline. As I’ll elaborate further below, whether this means the support of the latter OS and presumably X11 will mean I’ll be able to run it on FreeBSD or not will be interesting to see.

I’m going to come right out and admit it now: the user interface of the Chrome browser is just gorgeous. For the first time in a while, I’m ready to admit that another group or company has been able to beat Apple on appearance in a competing software product. Safari and Camino with the UnifyCamino plugin on Mac look swisher than Firefox, but Chrome looks even better!

Google Chrome running Mac OS X
Google Chrome running in Mac OS X

ASIDE: The above image is a shamefully misleading use of the Unity feature of VMware Fusion which allows applications running inside a Windows XP or Vista virtual machine to appear as though they’re running on the Mac desktop.

Chrome uses the same rough layout for the widgets and URL bar as Opera with the tabs positioned at the top. This has always made visual sense to me, because the displayed URL would obviously be different for each tab! In place of a menu bar, the Google folks opted for two discreet buttons on the right hand side which expose lists of options and functions. While I think the layout of these popup menus are a bit on the cluttered side, it’s certainly a slicker approach when compared to Internet Explorer 7’s cluttered and visually unappealing smorgasbord of widgets beside the tab bar.

This layout style is remarkebly efficient and uses far less screen real estate than Internet Explorer or Mozilla Firefox in their default configurations. Not only that, but it actually looks like a next generation browser compared to Firefox 3.0’s dissapointinly old fashioned style, or Interent Explorer 7’s horrible layout! The widgets are a bit big though, I’m hoping in the final release there will be an option to scale them down as you can in Firefox, Camino and Safari.

In terms of features it certainly is lacking when compared to Firefox, but then again Phoenix and Firebird lacked features in their early releases too. Whether or not Google allows third party developers to create plugins or whether this will just be a delivery mechanism for Google services will be interesting to see. I’m really looking forward to seeing how they utilise my Google Calendar, Maps and Gmail!

Google Chrome's Incognito mode
Google Chrome’s Incognito mode

One feautre I think is very swish is the "Incognito" mode, similar to Safari’s "Private Browsing" mode in that it stores no information about anything you do in the session once you close it. This means you can browse to sensitive sites with confidence such as internet banking and por… uh… recipie sites for grilled cheese which you don’t want others to see.

It will be interesting to see what effect Chrome has on Firefox’s still growing market share. Unfortunately a very significant portion of people who run Windows see Interent Explorer as "the internet" and don’t even know you can swap it out. People who know enough about browser software probably are using Firefox now, and they’re the ones who’ll be checking out and using Chrome. Then again, Google has shown time and time again that it’s capable of generating interest in it’s products outside the core of computer savvy users. Perhaps Firefox will take a hit.

Of course the thing I’ll be looking at closely is the licence it will be released under, and specifically the way in which others will be able to access the code. Some sites are reporting that Chrome will be an open source browser, but others I read claim that only the underlying guts of the application will be open source and the interface will be closed, ala Mac OS X. If it’s the former, as a FreeBSD user I’d be delighted to compile it for use on my machine if they don’t supply native FreeBSD binary downloads, if it’s the latter I guess I’d be stuck with using the Linux version with FreeBSD’s Linux Compatibility Layer which would be workable, but less than ideal, especially when browsers such as Opera officially support FreeBSD, and Firefox and Konqueror can both be compiled and natively run.

The Google Chrome user interface
The Google Chrome user interface

ASIDE: My caesar salad just arrived! I never used to like anchovies; actually I used to HATE anchovies, but now I just can’t get enough of them! What salads have to do with a Google browser I’m not sure, but since when have I let relevency get in the way of what I’m discussing here?

For what it’s worth, the first thing I tried with the Windows version of Chrome I downloaded was trying to get it to run under Wine: for those who don’t know Wine is a project working towards complete and free implementation of the Windows API so regular Win32 applications can run in Unix-like environments. In FreeBSD 6.3-Stable and NetBSD 4.0 virtual machines on my MacBook Pro it spat out a list of errors relating to drawing elements on the screen from what I could gather; perhaps you Linux folk might have more success. If you’ve got it running under Wine, I’d love to hear about it!

All in all I’m very interested to see where this Google Chrome whatnot goes. I’m not sure whether I would personally use it as my day to day browser (LONG LIVE CAMINO!) but more software in the browser ecosystem can only be a good thing, especially when it comes to getting people off Internet Explorer. Perhaps Firefox’s market share may suffer slightly, but such is the nature of competition, and more is good!

VMware Fusion 2.0 beta2 with FreeBSD review

UPDATE: An abridged version of this review has been picked up by the fine folks over at BSD News. If you’ve arrived here from there, all my FreeBSD and NetBSD posts can be found in the aptly-named BSD category. Cheers :-)

I’ve loved using virtualisation software ever since I had an early version of Connectix Virtual PC for my iMac DV back in the early 2000s, and later their Windows version before they were bought out by Microsoft. Virtual PC was mostly intended for people to use recent versions of Windows on Mac OS 8, but I preferred using it for resurrecting classic operating systems such as DOS/Windows 3.x which we had on our first home machine, and playing around with Linux distributions without going through tedious partitioning.

My predictably unnecessarily verbose introduction aside, the latest virtualisation software I’m using on a regular basis is VMware Fusion for Mac OS X, and I’ve been very pleased with it. The second beta release for version 2.0 is out now, and I spent my Sunday afternoon trying out build 107508 with a handful of my most used operating systems, plus FreeDOS for fun!

VMware Fusion 2.0 beta 2 Virtual Machine Library
VMware Fusion 2.0 beta 2 Virtual Machine Library

The most noticeable difference initially between this latest beta and version 1 of Fusion is the redesigned Virtual Machine Library. Taking a cue from Virtual PC, the plain text listing of virtual machines has been revised to include screenshots for the suspended machines. While I think this is a extremely useful and welcome addition for quickly recognising machines visually, I think the Mac-like glossy finishes are a bit overdone. Also despite making the interface more Mac-like overall, I can’t help but think the New, Open and Settings would better be served by a regular toolbar at the top of the window.

The New Virtual Machine Assistant has been improved to allow for more boot and drive options. You’re no longer limited to choosing from a physical or virtual optical disc; you can choose to use an existing virtual drive or even none at all: a VERY welcome addition! Before you run the machine the first time you’re asked whether you want to modify settings too, which means you no longer have to start the machine at the end of the assistant and hastily shut it down to fine tune its configuration.

VMware Fusion 2.0 beta 2 New Virtual Machine Assistant
VMware Fusion 2.0 beta 2 New Virtual Machine Assistant

Speaking of configuration, the Virtual Machine Settings window has been drastically redesigned to make it look much more like the Mac System Preferences application, and to make it easier to access all the new options and virtual devices you can configure. Amongst the new goodies are the ability to configure floppy drives, parallel ports, serial ports, and multiple virtual hard drives. When I saw these additions, I literally jumped out of my chair and screamed "HELL YEAH!"

Fusion 2.0 beta 2 also allows you to visually scale and stretch live running virtual machine displays. Even just a little bit of scaling adversely affects the readability of text, but perhaps for other applications such as full screen gaming which needs to be scaled to fit to an unsupported resolution this might be useful.

VMware Fusion 2.0 beta 2 New Virtual Machine Assistant
Demonstration of the live visual scaling in beta 2. Both the NetBSD and Slackware virtual machines are set to 1024×768 but the latter has been scaled down.

Now for the bad news. I’m not sure if this is a temporary setback as a result of it being a beta version (I did disable debugging checks), but graphical performance in BSD operating systems on my original generation MacBook Pro is nothing short of abysmal. VMware provides welcome additions for FreeBSD, but even installing these in FreeBSD 6.3 Release and using them with the compat6x layer in FreeBSD 7.0 Release made no difference to the overall sluggishness. NetBSD 4.0 was just as bad, without any additions.

This slow performance was most pronounced when I started Xorg on FreeBSD or XFree86 on NetBSD. Typically starting an X11 environment in VMware Fusion 1.x takes less than a second followed by several seconds for loading the desktop environment or vanilla window manager. With Fusion 2.0 beta 2, both FreeBSD and NetBSD take over 5 minutes just to start X11, and another few minutes just to load something as lightweight as Fluxbox… if you want to load Xfce or KDE it takes over a whopping 10 minutes.

To check whether this was a problem with BSD, I tried Slackware Linux 12.1 with the same versions of KDE, Xfce and Xorg; and while it still felt a little sluggish it still managed to load all three in a reasonable amount of time.

Given I need to use FreeBSD for my studies I just can’t use this beta release on a production machine, but if you primarily use Windows or Linux you could probably try it out.

Western Digital MyBook DHCP adventure

Before I go any further, I’d like to warn you that this post about using FreeBSD to assign an address to a Western Digital MyBook drive is unnecessarily verbose. See, I could have just as easily said "this post is long".

Writing about theoretical uses for software is one thing, but figuring out how to apply software to a problem practically, and actually getting it work, is one of the greatest feelings in the world alongside writing a fantastic piece of software yourself to solve a problem. It makes me feel useful and gives me a rush quite unlike anything else.

And he’s available ladies! Unbelievable though it may seem! Come on! He also makes a mean Earl Grey latte. Any bidders? Anyone?

Case in point, my sister and I had a problem in our new house in Adelaide. Before I left Singapore, I bought a gigabit ethernet Western Digital MyBook 1GB World Edition NAS drive and loaded it up with all our media: movies, shows, music, podcasts, BSD disk images, ebooks. By using a simple network drive, we spared ourselves having to bring a separate computer down with us.

Our makeshift home network consists of each of our laptops and the aformentioned network drive which are all connected through short Cat-6 ethernet cables to a 5 port gigabit ethernet switch. To compensate for the lack of a router, I assigned my sister’s MacBook and my MacBook Pro static IP addresses and I knew the network drive could also be assigned one. Very cool.

Our very fancy new home network
Our very fancy new home network.

Now here’s the kicker: for some reason in their infinite wisdom Western Digital decided not to ship the MyBook with a default IP address. This means it requires a DHCP server (Wikipedia link) to initally provide it with an address. I realised that without a router with a built in DHCP server, this network drive wouldn’t get an address, and therefore there’d be no way for me to log into it to assign it a static IP! Catch 22, chicken and the egg, a Bruce Schneier fact, call it what you will.

So within a few minutes I had configured a home network with two laptops and an inaccessible, address-less network drive. It seemed not having a router with a built in DHCP server would make this setup impossible. A quick Perl script determined that indeed only the two laptops were in our subdomain range:

#!/usr/bin/env perl

for ($i = 1; $i < 255; $i++) {
  system “ping -a -c 2 192.168.1.$i”
}

print "Western Digital engineers love DHCP it seems\n";

At this point I had to make a tough decision. To access our media network drive I could either be patient and wait a week until we got our new broadband modem with a built in router, or I could be impatient. Grilled cheese sandwich. Grillec cheese sandwich?

I decided to do the latter and give it what it wanted: a DHCP server! In place of a router, I would configure a one-time use FreeBSD virtual machine with a software DHCP server which would assign the address to the network drive, so I could log into it remotely and assign it a static IP.

My FreeBSD virtual machine showing the DHCP server coming online
My FreeBSD virtual machine showing the DHCP server coming online

After setting up a generic VMware Fusion virtual machine on my MacBook Pro, I mounted a FreeBSD 7.0-RELEASE ISO I had on already had on my hard drive and installed it with all the default options. I skipped configuring everything in the system installer except than the network card. I declined to use DHCP when it asked, and assigned it a static IP.

After rebooting the VM, I logged in as root and installed the isc-dhcp3-server package from ports.

I didn’t bother adding anything fancy to the /usr/local/etc/dhcpd.conf other than defining the pool of addresses and required options:

option domain-name "chuckpeddle";
option subnet-mask 255.255.255.0;

default-lease-time 3600;
max-lease-time 86400;
ddns-update-style none;

subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.120 192.168.1.129;
}

Next, to check what addresses our makeshift DHCP server has assigned, I created the default dhcpd.leases file:

# touch /var/db/dhcpd.leases

Finally, I enabled the dhcpd daemon in /etc/rc.conf and told it what card I wanted FreeBSD to listen for DHCP requests on. On VMware Fusion 1.1.3, the network card in FreeBSD is le0, but you can always check to make sure by using ifconfig -a

dhcpd_enable="YES"
dhcpd_ifaces=”le0″

The moment of truth had arrived! I turned off my Western Digital MyBook NAS drive, rebooted the FreeBSD virtual machine, then turned the network drive back on again. After a minute of waiting, sure enough the /var/db/dhcpd.leases file reported that it had assigned an address…

lease 192.168.1.129 {
  starts 6 2008/08/02 14:37:12;
  ends 6 2008/08/02 15:37:12;
  binding state active;
  next binding state free;
  …
  client-hostname “RubenerdNAS”;
}

… and automagically the Finder on my MacBook Pro reported it had found a new samba share (with it’s irreverent sense of humour)! My network drive had been resurrected from the dead!

My Western Digital MyBook in the Finder
My Western Digital MyBook in the Finder

Finally, after all of that I was able to go to my web browser and log into the damned network drive’s configuration page and change the IP address to a static one.

I still can’t help but wonder why Western Digital decided not to include a default address.

Western Digital NAS config screen, and the FreeBSD DHCP virtual machine
Western Digital NAS config screen, and the FreeBSD DHCP virtual machine

And now if you’d excuse me, I’m off to watch an episode of Cranky Geeks. From my network drive. PHEW!

Backing up CDs to ISOs on FreeBSD

I remember back in 1995 when I was 9 years old our family excitedly got its first CD-ROM drive. This was just before we moved to Singapore and were still living in Australia, and that small little Creative Hex Speed optical spinning wonder cost us a small optical spinning fortune. It was proudly installed above the 5.25 inch floppy drive in our generic 486SX PC clone tower. It came with 10 CDs, we had 2 already. I still have that CD-ROM drive.

MENTAL NOTE: Spend less time on the introductions and more on the actual content on the post. Nobody cares about your first CD-ROM drive!

Here we are in 2008 and despite the fact I haven’t toasted or bought a CD for years I’m literally swimming in thousands of them. As a Windows user back in the dark days I remember I used Nero Express to create backup ISOs out of CDs, then either burn those ISOs to a single DVD or store them on a backup hard disk. Fortunately FreeBSD has similar capabilities with the venerable command line dd utility.

Spiffy somewhat related icons from the Tango Desktop Project
Spiffy icons from the Tango Desktop Project

Insert the CD you want to copy (no, really?), then enter the line below. Substitute acd0 with an alternative device if you have multiple optical drives:

# dd if=/dev/acd0 of=[YOUR_NAME_OF_IMAGE].iso bs=2048

This will take some time. Naturally the CPU power your machine has and the read speed of your optical drive will affect performance. A 52x optical drive on my 3.0GHz E8400 Core 2 Duo desktop takes a few minutes, my MacBook Pro a few minutes longer still, I’m sure our family 486 with a hex speed drive would take considerably longer!

For what it’s worth, the same procedure can be used on NetBSD and Mac OS X from my own testing. Just switch the virtual device /dev/acd0 with the relevant line for your OS. Isn’t BSD heritage fantastic? :-)

FreeBSD AMD64 is good for you

Now that I’ve redefined the purpose of my primary desktop machine to make it a lean, mean code compiling machine, file server and Bittorrent downloader, it’s graphical performance is much less important. Therefore I’ve wiped Debian off it and reinstalled FreeBSD, but this time instead of settling on the standard x86 version so as to use the proprietary Nvidia graphics drivers, I’ve installed the full blown AMD64 64-bit version!


top

It’s so nice to be back in my familiar FreeBSD environment where everything on the drive is logically and securely organised, where I can use the FreeBSD ports system, where tcsh is the default shell not bash, and where everything works the way I’m used to. Plus running the 64-bit version it can access all of my RAM and generally feels more responsive as a result.


dmesg

For what it’s worth, after dappling in Debian GNU/Linux, I still prefer Slackware with Pkgsrc. FreeBSD and NetBSD are still the best though :-).

Any questions?

Tunneling X11 through SSH on Mac OS X

As I increasingly use and rely upon Unix-like operating systems such as FreeBSD (and GNU/Linux) on desktops, I tend to forget at times that I’m using a sophisticated server installed locally to generate my graphical environments, namely X11. And just as with any server I can call it up from another machine and use its services.

X11.app X11 was built specifically to serve graphical applications over networks, and can still be used in this way by employing SSH on the client, and installing the desired applications on the server. My primary desktop is a DIY running FreeBSD 7.0 (more on my debacle with Debian GNU/Linux in a later post!), and my primary mobile machine is an original generation MacBook Pro.

USELESS ASIDE: Given the fact it’s about time for my half-yearly move back to Adelaide, Australia I’ve been contemplating how best to access my desktop machines here in Singapore using my MacBook Pro which I’ll be taking with me. These are the things that keep my up at night.

To access desktop applications on a remote Unix-like machine on your Mac, fire up your Terminal and use the regular SSH command, but with the -X flag:

% ssh -X [USERNAME]@[HOST MACHINE]
% Password: [PASSWORD]

Provided you have installed X11.app from either your Tiger or Leopard install DVD; or better yet downloaded the latest community build of Xquartz from MacOSForge; you should now be able to enter in the name of a graphical application and have it appear!

Tunneled FreeBSD X11 apps on Mac OS X
Tunneled FreeBSD X11 apps running on Mac OS X through SSH

For example, I entered % xfce4-panel and used that to launch some of my favourite apps, as you can see above. Over my local home gigabit ethernet connection and even at Starbucks on the free Singapore public WiFi networks the applications felt like they were running on my local machine.

You may recognise the Xfce panel from my previous post on Xfce and Openbox. There’s a reason for that; I’m using the panel remotely from the same machine. Ain’t [computer] science wonderful?

Plus then you can do things like run local Mac applications and the remote X11 applications on the same screen:

Tunneled FreeBSD X11 apps on Mac OS X
Xfce’s Thunar file manager compared to Leopard’s Finder

Fun with Xfce part 4: Using Openbox

What started as a mini series on the Xfce Desktop Environment on my university intranet has evolved into an open ended exploration on my public blog, and I’m having lots of fun doing it! Scroll down to the end of this post to view links to the previous posts in the series.

Part of the Xfce desktop environment is Xfwm, the Xfce window manager. Xfwm provides sophisticated and pretty composting effects such as drop shadows and alpha transparency on windows and menus, while still using less memory and power than competing desktop window managers. Despite this, for much slower machines even Xfwm can be overkill.

ASIDE: "Window managers" draw the widgets, title bars, resize handles and other elements onto application windows. "Desktop environments" such as KDE, GNOME and Xfce bundle their own window managers along with software developed specifically for their environments, such as Thunar for Xfce.

Enter Openbox, again! Openbox is an extensible, standards compliant, very minimalistic window manager that can be used by itself or in place of a desktop environment’s default window manager to further reduce memory and processor resources. The separate obconf utility provides a nice graphical control panel you can use to switch themes and adjust settings.

The Obconf window and Xfce Settings menu entry
Openbox running in Xfce with the bundled "Mikachu" theme

Most reputable package managers carry both Openbox and obconf, check your distribution’s repositories. To install them on my favourite BSD flavours for example:

FreeBSD ports system or package
# cd /usr/ports/x11-wm/openbox && make install clean
# cd /usr/ports/x11-wm/obconf && make install clean
or:
# pkg_add -rv openbox
# pkg_add -rv obconf

NetBSD pkgsrc
# cd /usr/pkgsrc/wm/openbox && make install clean clean-depends
# cd /usr/pkgsrc/wm/obconf && make install clean clean-depends

Now we want to kill the active Xfwm process in Xfce and open our glorious Openbox replacement. Fire up your Terminal and enter:

% killall xfwm4 ; openbox & exit

It really is smaller in every sense of the word isn’t it? To make sure Openbox is used by default whenever you start Xfce, quit Xfce and check "Save sessions for future login".

The Obconf window and Xfce Settings menu entry
Don’t worry, CC looks pretty confused herself!

You’ll also notice that the "Openbox Configuration Manager" has added itself to the Xfce Settings menu! Click on it and have fun with all the different themes, button positions, font sizes and arrangement settings.

Related posts

RichardDawkins.net