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.

No comments:

Post a Comment