Tuesday, 10 August 2010

Running Windows 7 in VirtualBox

I'd like to be free of Windows. Linux distros have made great leaps forward in recent years - especially in terms of hardware compatibility. Take wifi - trying the latest Xubuntu Live CD last week, even the wifi access worked straight away. Last year I installed Kubuntu 9.04, and getting wifi to work took several hours loading drivers, hacking scripts and crossing fingers. So it's getting easier to live without Windows - but I'll be working with people who run Windows, and I'm likely to need some software that can only be run on Windows.

Dual boot is one answer - but do I really want to reboot my machine just to look at an Excel spreadsheet? Virtualisation may be the way forward - run Windows under VirtualBox, and you can switch between operating systems at will. So I've just tried running Windows 7 in VirtualBox - successfully too.

I've had to install the PUEL (Personal User and Evaluation Licence) edition - this is available free from http://www.virtualbox.org/wiki/Downloads, with various installers for different Linux distros (I'm running Kubuntu 9.04). It's pretty much the same as the OSE (Open Source Edition), except it includes support for USB. This should allow the virtual machine access to USB devices - potentially very useful for me, as I may want to access printers and other hardware that aren't easily suppported in Linux.

After installing VirtualBox, I've built a new virtual machine and installed Windows 7 Enterprise Trial Edition (available from technet.microsoft.com). This will give me 90 days trial - enough to see if I can do everything I need to do in a virtual machine before buying a licensed copy. Windows claims to need 20GB of disk space for an installation - with just the OS, it's used up 5.5GB of the virtual disk.

Once the PUEL edition is installed and the virtual machine built, you'll need to enable USB for the virtual machine (enable USB and USB 2.0 EHCI in settings). I've added my linux user ID to the "vboxusers" and "plugdev" groups (using the KUser user manager) - seems to require a reboot for these to take effect (before rebooting you can see the USB devices but they are greyed out).

[After moving to Xubuntu 10.04, I also had to add my user ID to the "lp" group to be able to access a printer.]

Once I'd done this, USB support seems to work - by clicking on the USB icon on the bottom right of the virtual machine window, and checking the one you want to access in the virtual machine. The only difficulty is that it's difficult to recognise which device is which - the names they use may not be obvious ("Chicony Electronics Co., Ltd. CNF7047 [1324]" - eh?).

So it's quite straightforward to build a virtual machine to run Windows 7 on a linux box. I'm hoping this will mean not having to faff about with dual boot. It's also good to have a virtual machine to run dodgy bits of Windows software - if it all goes wrong I can easily destroy the virtual machine and build a new one - or use snapshots/clones to go back to a stable build.

Friday, 6 August 2010

Diary of an intrepid office explorer

Remember the good old days? When an explorer would hack off over the sea, through the jungle, or across the desert, armed with little but generous funding from wealthy benefactors, a wind up gramophone and several hundred native bearers? I've been doing the modern equivalent by exploring the island of Sulawesi from the comfort of my own office - using freely available geographic data.

I'll be off the Sulawesi in September to work with VSO on forestry management projects - and must admit to knowing little about the island. As someone working in conservation, hydrology and land use, I'd like to get an idea of what the place looks like, how much it rains, and how warm it is. Pretty much the sort of thing our pith helmetted forebears would be looking for.

To start - what does the coastline look like? Put away the sextant, we'll use this instead:

http://rimmer.ngdc.noaa.gov/mgg/coast/getcoast.html

This is a vector dataset of coastlines of the world, developed from various sources by the US Defense Mapping Agency. Unfortunately, this gives you data in a slightly weird format (text files of [x,y] pairs), which will take a bit of furtling to import into GIS. For the lazy explorer, the same data set has converted to shapefiles by some nice people at the Pacific Disaster Center in Hawaii:

http://www.pdc.org/mde/full_metadata.jsp?docId={32F5F3B8-1CF1-48C5-9B81-57885C0CA448}


There is also a lower resolution shapefile dataset derived from SRTM data here:

http://geoserver.isciences.com:8080/geonetwork/srv/en/metadata.show?id=244

This data set has a 1km resolution, so looks a bit "blocky", but is OK for large scale applications.

Now we'd like some topographic data - information on the land elevation is essential for hydrological modelling. Shuttle Radar Topography Mission (SRTM) is not the best accuracy (a few metres vertically) or resolution (90m, or 30m over the US), but it's probably OK for hydrological modelling in some places, and gives you easily accessible, near global coverage.

http://www2.jpl.nasa.gov/srtm/

A bit of faffing around with gdal will give you a DTM (Digital Terrain Model) referenced to your projection of choice (UTM zone 50S for west Sulawesi).

Finally, we'd like to know how wet it is - will I need to take an umbrella? WorldClim has a global datasets of rainfall, temperature and other climate variables at 1km resolution:

http://www.worldclim.org/

This is interpolated from climate station data - so the accuracy must be suspect where measurements are sparse.

Here are the results:



Coastline and SRTM topography Mostly volcanoes, with dendritic drainage patterns superimposed.





















Mean January Rainfall - note how the rainfall varies strongly with topography and coastal aspect, especially in the South Sulawesi peninsular.























So, 170 000 square kilometres of the east indies mapped without leaving the office. Leaving me time for a snifter before lunch at the Reform Club. Cheers!