Booting your Windows Bootcamp partition in VirtualBox

I have XP in my Bootcamp partition which I occasionally boot to run apps that I don’t have on Mac OS X, usually it’s for a Windows game. It annoys me to switch between Mac OS X and booting Windows from Bootcamp, as it takes a while to switch back and forth. The only reason I’ve ever considered buying Fusion or Parallels is to be able to boot from the Bootcamp partition and avoid having two Windows installs – one in Bootcamp and one on a virtual disk. Sometimes it’s fine to boot in a virtual machine, but othertimes you really want to boot natively to make full use of the graphics card and DirectX etc. Turns out you can set up VirtualBox to easily boot from a Bootcamp partition, and avoid having two installs.

I followed the instructions here, and after a bit of fiddling with with VirtualBox settings for my new VM, it booted fine. The instructions are for booting Windows 7 from Bootcamp in VirtualBox, but it works the same for XP too.

JSF conditional text output

Use an EL expression in the rendered attribute, for example:

<h:outputText value="some conditional message" rendered="#{! empty someManagedBean.someProperty}" />