Testing local TiddlyWeb applications in virtual machines

This is particular to VirtualBox, but I imagine the principles are the same for VMWare, Parallels and all those other virtual doohikies.

I’ve been developing a TiddlyWeb application on a local server on my Mac. This is fine for when I want to test in Firefox, Safari, Chrome, Webkit and others, but not so hot when I want to test in IE6/7/8. Virtualisation makes the general problem a lot easier, and I run VirtualBox for that purpose.

Unfortunately, accessing a locally running web server, rather than plain ol’ Internet, gave me some problems, so I thought I’d write down how I managed it.

Generally, to start up a TiddlyWeb instance, I’ve been using:

twanager server localhost 3000

I can point a browser to http://localhost:3000/ and I’m away. If I want to run on port 80, I can use:

sudo twanager server localhost 80

and then I can point a browser to http://localhost/.

The key thing to getting my virtual machines talking to my local server is to run TiddlyWeb on an IP address, rather than on “localhost”, which I had been doing. The IP address to run the application on is the IP address of your machine on the network. So how do you get this?

Given I’m using a mac, the non-confusing way is to open up System Preferences, hit the “Network” icon and read off the IP address in the “Status” section.
Network options in System Preferences

The more confusing way is to open up a Terminal, type in ifconfig and read off the IP address:

Running ifconfig on the Mac Terminal to get your IP address
With your IP address in hand, you can now use twanager to start up TiddlyWeb on an address accessible to your virtual machines:

twanager server 192.168.1.71 3000

Then you’ll be in IE testing hell in no time!

Advertisements

One Comment

  1. Posted February 2, 2010 at 3:46 pm | Permalink

    Jonathan, I understand about 1% of what you write about TiddlyWeb, but I am using the fruits of your labour in my TiddlyWeb-based treatment manual project, and it is frankly wonderful. This is where technology really allows workers to do new things – different teams across the UK, all working in similar but different settings, with similar but different individuals and families, having a conversation between each other via their local customisations of a shared treatment manual. Thus the manual becomes a work in progress, a shared quest for more effective methods of practice, supporting workers to deliver help in settings, and to groups of young people, which were previously seen as ‘beyond help’. This is exciting stuff.