How to mount a VirtualBox VDI image

Don’t believe the hype! It is entirely possible to mount a VirtualBox VDI image, just like a loopback filesystem… all you need are the right tools and know-how. Allow me to illustrate.

My apologies, that was the wrong illustration. Onward!

Before we start, it should be noted that you don’t want to do this while your disk image is already in use. That is to say, if you’re running a virtualised host using this image, GTFO.

First, install the QEMU tools. In Ubuntu, you’ll find them in the qemu-kvm package. Whatever package your distribution ships which contains the qemu-nbd binary should be fine.

Load the nbd kernel module. Yes, I’m serious, the network block device module! (Note: All of the following commands require superuser permissions, so escalate your privileges in whatever way makes you most comfortable.)

modprobe nbd

Then run qemu-nbd, which is a user space loopback block device server for QEMU-supported disk images. Basically, it knows all about weird disk image formats, and presents them to the kernel via nbd, and ultimately to the rest of the system as if they were a normal disk.

qemu-nbd -c /dev/nbd0 <vdi-file>

That command will expose the entire image as a block device named /dev/nbd0, and the partitions within it as subdevices. For example, the first partition in the image will appear as /dev/nbd0p1.

Now you could, for instance, run cfdisk on the block device, but you will most likely want to mount an individual partition.

mount /dev/nbd0p1 /mnt

Gadzooks! Now you can muck around inside the filesystem to your heart’s content. Go ahead and copy stuff in or out, or if you’re feeling fruity, have some chrooty: chroot /mnt.

When you’re done, unmount the filesystem and shut down the qemu-nbd service.

umount /mnt
qemu-nbd -d /dev/nbd0

Meta: Switching to partial feed on Planet GNOME

As I would like to write more regularly about a far wider range of topics, and have quite firmly moved on to “emeritus” status in the GNOME project, I have decided to publish only my GNOME-related thoughts on Planet GNOME in future.

If you have enjoyed my eclectic (albeit occasional) writing in the past and would like to keep reading, please subscribe to my complete blog feed or follow me on Twitter.

Franklin Street Statement PDF

The Franklin Street Statement can be found on the web in the form of a fairly ugly blog post, which does not befit a document of such importance… and for that matter, neither does the printed form of that page.

I wanted a nice paper copy of the statement to put in a prominent position on my desk, and figured it would make sense to share my rendering. It may be an interesting thing to hand out at developer conferences or Software Freedom Day events.

The document is set in Free typefaces, Liberation Serif and League Gothic — appropriate, given that League is a wonderful Free alternative to Franklin Gothic! I know, I know, you see what I did there. Now… Download the Franklin Street Statement PDF!

Note: I wish the source ODF had survived the wrath of OpenOffice.org’s “eat my document” crash recovery feature, but at least the resulting PDF is fairly easy to edit. :-)

Wired? Tired? Expired.

Glyn Moody pointed out an awful article written by Chris Anderson (of Long Tail infamy) and Michael Wolff, “The Web is Dead. Long Live the Internet”. It is almost Nick Carr-esque in its pursuit of overwrought claims with little to no basis in fact.

The lunacy of this article will resonate with anyone remotely connected with the technology industry, let alone those involved in software and web development.

But here are my favourite bits of abject cluelessness:

JavaScript then, Objective-C now? HTML then, XML now? What the fuck have you been smoking, Chris Anderson? … and don’t tell me it was some “junior staffer” subbing the living crap out of your stupid lack of perspective.

… and then this little gem to finish things off, ignoring years of evidence that we enjoy temporary dalliances with convenience before returning to (often quite) revolutionary openness:

The Internet is the real revolution, as important as electricity; what we do with it is still evolving. As it moved from your desktop to your pocket, the nature of the Net changed. The delirious chaos of the open Web was an adolescent phase subsidized by industrial giants groping their way in a new world. Now they’re doing what industrialists do best — finding choke points. And by the looks of it, we’re loving it.

I’ll make my own bold, unsubstantiated claim… Wired: Tired and expired.

Glad I have that off my chest. Thank you, ball boys.

* * *

Update: Check out this hilarious take-down from Boing Boing … with facts! … and analysis! … and pretty graphs!

Packet and Denby

This is Packet.

This is Denby.

I mention in the video that it’ll end up being “like TweetDeck”. I breezed past that a tad too quickly — it’s definitely not going to be an HTML5 clone of TweetDeck! (Turns out they’re working on one of those already.)

Instead, it will take inspiration from the multi-column approach, but hopefully improve the user experience on a number of levels:

  • It’ll be 100% Free Software / Open Source… and one hopes, peer produced.
  • JavaScript on the server, JavaScript on the client, with liberal doses of “HTML5″ (the platform your platform could be), whatever that means to you.
  • No Adobe AIR, and thus, no vicious memory and CPU abuse! Seriously: Firefox TweetDeck is wasting more CPU time sitting “idle” than Chromium and node.js are using to run Denby. Oh, and node.js is 12MB resident.
  • It can work a bit like a desktop app… use the “web page as application” tool your browser provides. Firefox has Prism, Chromium has… a menu item. ;-) Denby will support things like desktop notifications, audio bleeps, drag-n-drop (for media uploads), inline display of media, etc.
  • Run local or hosted. Once I’m happy with the user experience, I’ll start thinking about cool things the server could do while you’re not connected to it! For now, it only maintains the connection to Twitter while a client is connected.
  • I want to build delicious multiple account support, without complicating the single account experience. It’ll merge streams, detect the context you’re acting upon (click reply and you’ll be replying from the appropriate account), etc.

Please comment if you have any thoughts or suggestions… crimes committed by other Twitter clients, ideas for lovely web/desktop integration, and so on. Thanks! :-)

HELLO DENBY.

* * *

Note that I’ve already had questions about StatusNet and identi.ca support. Thus far, they don’t have user streams, which was one of the main reasons behind building Denby. That said, it is entirely possible for the Denby server to poll the REST API (given that it already talks to Twitter’s) and send the results down the WebSockets tube… so, we’ll see.

Hmm. Perhaps this is the best way to build a user streams API for StatusNet anyway? The web app could send JSON messages to node.js, which could relay them to the intended users… via multiple protocols! Long-running HTTP, WebSockets, whatever. If anyone is inspired to do this, StatusNet could have a bi-directional WebSockets API before Twitter does!

* * *

Update: I made another quick video, showing a few improvements (including update bleeps — no chicken noises as yet), Denby in Firefox’s Prism environment, and sharing some thoughts about the web as a development platform. Enjoy!

Happy 7th birthday, Linode!

Perhaps this is a familiar refrain for some readers… but I’ll say it again: Linode rock! On their 7th birthday, they are giving current and new users a huuuge RAM upgrade —  around 42% on average. From humble beginnings as a Linode 64 five years ago, my Linode 512 is now a Linode 768. Yikes!

“Good news. Linode’s getting older.”
“… and Leon is getting laaaaarger!”

Already blessed with plenty of memory available for cache (which is very handy on a VM with relatively slow I/O), I now have even more headroom:

Why I’m excited about Palm’s webOS

I have been a Palm fan for a very long time. My first PDA was a PalmPilot Professional, which eventually led to the m100 (AA batteries!), my first Palm OS phone, Pia’s hand-me-down Tungsten W, the Treo 650 and finally, my last (real) phone: the Treo 680. I’m even vaguely sad that I missed the final outing of Palm OS on the Centro.

I was disappointed when Palm split into two companies, but perhaps it was ultimately a good thing… PalmSource became victim to an almighty corporate Sarlacc, to be digested slowly over a thousand years, while Palm became nimble and determined to win out of necessity.

The ill-fated Foleo was a public relations disaster, but in retrospect, a concept way ahead of its time — consider the explosion of the netbook market soon after, and where the iPad is today (albeit generations of mobile technology beyond the capabilities of the Foleo).

Which brings us to webOS, released a year ago today on the Palm Pre. Having waited impatiently all that time (often running to the emulator to get my fix), I finally acquired one last week.

It is a truly delicious user experience. I won’t go into too much detail on this front — as with most things, you must use it — suffice to say that it carries the soul of Palm OS in a 21st century vessel.

(Okay, one thing on this: When it comes to the basic functions of a smart phone — calls, and contacts — I’m convinced this thing has both the iPhone and HTC’s Sense UI for the Desire beat. Synergy is seamless and awesome.)

Despite it’s youth, webOS is an incredibly promising and fast-moving platform… and in stark contrast to other “mobile Linux” competitors, it’s not just a bunch of goofy shit piled on top of a heavily molested Linux kernel: What runs on your phone is an utterly recognisable Open Source stack and an utterly recognisable web stack. Sure, there’s a layer of proprietary Java gumpf shoved between the good bits, but even that is getting thinner.

To some extent, webOS is the GNOME Mobile platform with a user interface and services layer built for the web generation. It’s D-Bus, GStreamer and PulseAudio under WebKit. Mojo applications, written in JavaScript, talk to services via JSON APIs, and native apps integrate into the web-based user interface via — get this! — NPAPI plugins.

Crucially, webOS will grow and improve along with the web. Everything you’re seeing in the web world — faster JavaScript, hardware accelerated CSS animation, massive growth of the JavaScript ecosystem (consider all the frameworks, CommonJS modules, nodejs event-based server, etc.) and all the incredible new APIs popping up — will find a place in webOS. Check out the Palm Developer Day keynote and podcast from Dion Almaer and Ben Galbraith for more on the near future of webOS.

On the awesomeness of Dion and Ben at Palm? I’ll just quote James Governor:

Palm tried to use Apple’s trick of secrecy first rather than investing heavily in developer good will and playing the open card. It didn’t work. Palm realised its error last year and did something incredibly smart – it hired Dion Almaer and Ben Galbraith to develop a new, web-savvy, strategy around its platform.

Using open technology as the bricks and mortar of a platform is not particularly amazing of course. Everyone’s doing it. But Palm are making friends and influencing developers by having an impressively open attitude to devices, too. Your store-bought phone — with a bit of Konami code action and the freely downloadable webOS SDK — is already “rooted” for you. Just log in. ps afx? cat /proc/cpuinfo? top? Your “first command” habit is most likely catered for. :-)

That openness has encouraged an incredible amount of community activity. The most Open Source savvy group dedicated to the platform is WebOS Internals. Initially, they published all sorts of juicy information about the innards of webOS and the Pre… but have now rallied around distribution of “home brew” Open Source patches and apps, using their own package management interface, Preware. They’ve even published an updated kernel which supports overclocking, temperature sensors and more advanced power management than the original! It’s wonderful stuff.

Then HP bought Palm.

Despite some messaging hiccoughs (now resolved), this is an incredibly exciting move for Palm and webOS fans. I’m hoping it gives Palm the reach, resources and relationships to go global, accelerate improvement of the platform, and ship some terrific new hardware to make their software shine… that said, it better not be an almighty corporate Sarlacc!

Damn it feels good to be a Palmster.