Friday Mar 09, 2012

Creating a VirtualBox appliance that uses a click-thru license

Lots of people use VirtualBox to create virtual appliances or vm's which they can share with others. There's a whole host of them over at the OTN Developer VM's page, BTW.

But someone asked me how they would go about about redistributing a vm which required a "click to accept" type of license. Here's how:

When you are happy with the vm that you want to redistribute, you can use the GUI or command-line interface of VirtualBox to export the vm.  


  1. Choose "File...Export Appliance..." to bring up the Export wizard, then select the vm's that make up your appliance. (Note that you can export multiple vm's here. For example, the database vm may be separate from the business logic vm, etc).

  2. Export Wizard

  3. Choose the flavor of appliance: ovf or ova, and whether to create a manifest (hashes which can be used to determine if the appliance components arrived intact). Note that VirtualBox uses the extension to decide which type (ovf or ova) of appliance to create:

  4. Export Settings

  5. When you get to the Appliance Export Settings dialog you can describe who you are, what the appliance is called as well as specifying license text:

  6. Appliance Export Settings

    You can leave any of these fields empty, however, it is the presence of the License text field that causes VirtualBox to present the License at Import-time.

BTW The command line interface syntax that achieves the same thing is:

$ VBoxManage export
VBoxManage export           <machines> --output|-o <ovf/ova>
                            [--vsys <number of virtual system>]
                                    [--product <product name>]
                                    [--producturl <product url>]
                                    [--vendor <vendor name>]
                                    [--vendorurl <vendor url>]
                                    [--version <version info>]
                                    [--eula <license text>]
                                    [--eulafile <filename>]

So you can create scripts to automate the building of this. 

The end result is the same: an ova file or an ovf file with stream-optimized disk images and an optional manifest file. 


Here's what this appliance would then look like on import: 

  1. From the File...Import... menu in the VirtualBox Manager you select the ova or ovf file and you're show what the appliance contains:

    Appliance Import Settings

    At this point you can modify the devices if required, or change the MAC address (to avoid clashes with existing vm's). 

  2. But on continuing, if there is a License, it gets presented thus:

    Software License Agreement

    So your users can choose whether they want to accept your terms of use or not. 

That's all there is to it.

- FB 

Wednesday Sep 14, 2011

Windows 8 in VirtualBox

Just a quick note for those people who are looking to run Windows 8 in Oracle VM VirtualBox.

Windows 8

Here's how I did it:

  1. Go get it from the MSDN site.  I chose the 64-bit version but, be-warned, you need to assign more RAM (MS recommend 2GB, I used 1.5GB) to it than the 32-bit version (MS recommend 1GB).
  2. Create a New Windows 7 VM in VirtualBox but change the RAM in the VM from 512MB to as above.
  3. Configure the CD/DVD to point to the downloaded Developer Preview iso
  4. Turn it on and go

(FYI I used VirtualBox 4.1.2 on a Mac OS X Lion host)

Note that the Guest Additions  don't recognise Windows 8 (fair enough at this stage, I guess) and the Windows Key features heavily in Windows 8 so if you use the Mac Cmd key as the VirtualBox Host Key, press the right Cmd key or choose a different Host Key in VirtualBox.


- FB 

Tuesday Jul 19, 2011

What's in Oracle VM VirtualBox 4.1?

Another week, another VirtualBox release.

But unlike last week's maintenance release on our stable 4.0.x branch, today's 4.1 release introduces some exciting new cutting edge features:

VM clones

A clone is a copy of an existing VM. So when would you need to copy a vm?

Well, examples include when you want to give many people their own vm to use (e.g. teachers and students, or employees), or for backing up a vm (instead of snapshots), or for when you want to build a grid for, say, a Hadoop-type application.

A clone is an (almost) exact copy of a vm. We say "almost", because you can ask VirtualBox to assign a different MAC address to it so as not to confuse the network when you start 2 or more of them up.

In VirtualBox 4.1 we've made Cloning super easy. In the VirtualBox Manager simply right click on the vm and choose Clone.


For the more intrepid, we also support Linked Clones, where the existing vm is the parent of the clone. These are faster to create and more space efficient but a little harder to understand. At the moment the ability to create linked clones is only available via the VBoxManage command line interface.

Larger system support

VirtualBox is used in many places and many ways. 

One example is that VirtualBox is used in another Oracle product, Oracle VDI to deliver a smarter way of running Enterprise desktops, namely by running them in vm's on the server, where they are more secure, manageable, and available from many devices.

Now some servers are pretty big nowadays, not only in terms of CPU horsepower but also in the amount of RAM they can support. So with 4.1 we've enhanced VirtualBox to work great on all sizes of systems, even up to systems with 1 Terabyte of RAM.

Improved remote access

If your vms are running on another machine, VirtualBox provides a way to access them remotely via a service which is Microsoft RDP compatible. We've enhanced this service in a couple of ways:

  • Security: VRDP now supports TLS and server authentication to prevent, for example, Man-in-the-middle attacks.
  • Multiple Monitors: VRDP now supports multiple monitors on your client so your vm's can see and display on your multiple monitors.

Windows 7 Aero

We've developed a new WDDM driver for Windows Vista and 7 guests as part of the VirtualBox Guest Additions on these platforms. Using this driver the Windows guests can use transparency and other effects.

Note that this driver is relatively immature and so we've attached the "experimental" tag to it for now.

Here's an example of what it looks like on a Mac host:


Latest platform support

VirtualBox 4.1 is ready for the latest Linux platforms, even when using cutting edge features such as Unity or Gnome 3.

Ubuntu 11.04

And one of these days we expect Apple to release Lion (the newest Mac OS X) and we're ready for that too.

New Networking Mode

VirtualBox already supports a powerful range of networking options from NAT (vm's IP address is translated in communications) to bridged (the vm is a full network citizen with it's own publicly accessible IP address) to host-only and internal networking (where vm's sit on a virtual network inside the host machine).

This latter model is extremely useful for test setups because you don't need to involve system administrators at all. But the downside is that maybe you can't fit all your running vm's in the same host.

UDP Tunneling is a new feature introduced in 4.1 which allows you to interconnect virtual machines running on different hosts.

And lots more...

There are so many more improvements and fixes throughout VirtualBox 4.1 ranging from :

  • features for the mere mortal: an updated Virtual Media Manager, maintaining aspect ratio when in scale-view mode, proxy support for the update checker and an updated USB stack;
  • features for specific constituencies: Crossbow and shared folder automount support for Solaris hosts;
  • advanced features for the very brave: experimental support for SATA disk hotplugging and PCI passthrough.

So there should be something there for everyone :-)

To get the full list of changes, as always checkout the ChangeLog, or download and kick the tires yourself.

- FB 

Wednesday Apr 06, 2011

Errors when importing OVF appliances

This is another quick note to self which others may also benefit from....

There was a bug in the Export OVF code of VirtualBox 3.2.8 (and earlier) with vm's that have multiple hard disks. The bug was that each hard disk was given the same unique ID (UUID). Although the export seemed to work correctly, the resultant ovf looked something like this:

      <StorageController name="SATA Controller" type="AHCI" PortCount="2" useHostIOCache="false" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">
          <AttachedDevice type="HardDisk" port="0" device="0">
            <Image uuid="{eb5b9e44-321f-4cc7-84c3-781fd9d5a661}"/>
          <AttachedDevice type="HardDisk" port="1" device="0">
            <Image uuid="{eb5b9e44-321f-4cc7-84c3-781fd9d5a661}"/>

and so when you came to import the appliance, the import failed because there are 2 disks with the same UUID.

The right solution is that the creator of the vm should upgrade to 3.2.12 or later and re-export again. But a hacky solution involves hand editing the ovf file:

  1. remove the section between:
  2. <vbox:Machine ....>
  3. remove/rename the .mf manifest file (because the digital signature will be wrong now we've changed the .ovf file)
  4. try importing again. 


- FB 

Thursday Feb 24, 2011

VirtualBox and the Unbreakable Enterprise Kernel

This has tripped me up twice now, so time to write it down :-)

Oracle Linux 5 and now also Oracle Linux 6 come with a choice of kernels:

  • a 100% Red Hat compatible one; and
  • the Unbreakable Enterprise Kernel.

When installing VirtualBox, or the VirtualBox Guest Additions, we need to build and install kernel drivers which are dependent on the version of Linux you are using. So we need a few packages to be installed to allow us to do this.

Here's how using the standard kernel:

	yum update
	yum install gcc
	yum install kernel-devel

 or if using the Unbreakable kernel:

	yum update
	yum install gcc
	yum install kernel-uek-devel

 There, now I'll never forget how to do this again.


Tuesday Jan 04, 2011

VirtualBox 4 configuration files

For those that are long time users of VirtualBox you'll notice a few changes with version 4.0. One of those changes is the location of VirtualBox configuration files for vm's, and where virtual disk and snapshot files are saved too. Here's what we've done:

When creating new vm's in VirtualBox 4.0 we've moved all the info about a vm into a subfolder. This makes it easier to, say, tar up the folder contents in order to share the vm with your friends without going through the export/import process. And because the saved state and snapshot files are under the same subfolder, then you can even move suspended vm's, and those with multi-generational snapshots too.

Here's a summary of where stuff has moved to:

Before 4.0 4.0 or above
Default machines folder $HOME/.VirtualBox/Machines $HOME/VirtualBox VMs
Default disk image location $HOME/.VirtualBox/HardDisks In each machine's folder
Machine settings file extension .xml .vbox

Another benefit of these changes is that we associate files with the .vbox extension with VirtualBox. So you can launch vm's by double clicking on the .vbox file, or create an Alias or Shortcut to a vm when you right click in the vm in the VirtualBox Manager, like this:

Create Shortcut

What about legacy vm's that you created prior to VirtualBox 4.0?

4.0 is backward compatible so things should just continue to work out of the box, with the vm information held in the old locations. However, some new features, such as file associations, won't work (because the config file is still the old .xml extension not the new .vbox one). 

To migrate to the new 4.0 locations and filetypes you can perform a one-time export/import. You can either do this manually ("File...Export Appliance" and "File...Import Appliance), or you script the process. On Linux/Solaris/Mac it would look like this:

VBoxManage list vms | sed 's/.\*{ \*//;s/}//' | while read UUID; do VBoxManage export $UUID -o /tmp/$UUID.ova; VBoxManage import /tmp/$UUID.ova; done

This may take a bit of time, so I'd run it overnight.

Hope this info is useful to someone.



Wednesday Dec 22, 2010

Oracle VM VirtualBox 4.0 is released!

VirtualBox 4.0 is hot off the press so you may be wondering what's new? Here's a very quick summary....

VirtualBox Manager
  • Usability Improvements

    • A major revamp of the VirtualBox Manager with features such as VM Preview, an orderable VM list, and optional attribute panes, allows admins or power users to customize the interface to make it as simple or as comprehensive as they require.

    • Easy shortcut creation enables users to launch vm's from their Desktop, Start Menu, or from scripts, without the need to start the VirtualBox Manager.

    • The new scaleable display mode allows users to accommodate more virtual displays on the same amount of physical screen real-estate.

  • Increased capacity and throughput

    • New Asynchronous I/O model for networked (iSCSI) and local storage delivers significant storage related performance improvements, especially over 1GB LANs.

    • Improved ability to run larger vms on smaller 32-bit hosts. This enables large vms, for example, Oracle datacenter-class products, to run on desktop systems such as 32-bit Windows hosts.

  • Powerful Virtual Appliance sharing

    • Strongest support for the Open Virtualization Formats in industry. This release strengthens Oracle's commitment to standards, with the adoption of ovf and now ova format appliances

    • Version 4.0 also provides easier direct sharing of vms too, with a new configuration storage model. This new configuration storage model holds all information about a virtual machine, such as virtual hardware, virtual disk files, snapshots and saved state files into a single folder. vm's in a folder

    • This means that, for the first time, suspended vm's and vm's with snapshots can be transferred.

  • Latest virtual hardware

    • By offering a new, modern chipset supporting PCI Express, VirtualBox can support the most demanding of virtual workloads.

    • High Definition Audio devices deliver fantastic sound quality for both output and input (microphones) devices.

    • Hardware offloading for virtual networking increases throughput via virtual NICs.

    • Powerful port-forwarding rules allow the user to run server vms on their desktop device using NAT networking. This means that user can run, say an Apache web server in a vm and connect to it via a host port.

      Port Forwarding
      Port Forwarding
  • Open Source Packaging and Licensing

    • Fully Open Source base product. No longer will there be any confusion about separate editions of VirtualBox. For the first time there is an OSS licensed binary meaning partners do not need to build and maintain their own source tress. This lowers a barrier and is expected to spark increased interest in VirtualBox virtualization solutions.

    • Flexible Extension Pack mechanism for add-on functions. By delivering a pluggable Extension model in the style of Firefox Extensions, Oracle are providing a way for ecosystem partners to offer value-add functionality in an elegant and powerful way.Extensions

    • The first Oracle VM VirtualBox Extension Pack will offer high-speed USB 2.0, Remote Display Services and Network booting features. This will be licensed under the same free for Personal Use and Evaluation License as previous versions.

There is much, much more going on under the hood too, such as API changes and the introduction of an event driven model for API users, but we don't have time to cover this today. Suffice to say, we're really pleased with 4.0 and hope you are too.

- FB

Friday Nov 19, 2010

Oracle Solaris 11 Express

For the interested and curious, Oracle released a new platform this week: Oracle Solaris 11 Express is Solaris NextGen (FatBloke's term, not Oracle's ;-) ). It has lots of cool new features including a new Image Packaging System which I tried out as part of the Automated Installation.

In a nutshell here's how I used the Automated Installation method:

  1. I chose the smaller Automated Installer iso from the download page
  2. Created a new vm in VirtualBox using OS Type of Solaris and memory of 1024MB;
  3. Started up the vm and point the First Run Wizard at the local Automated Installer iso we just downloaded in 1.;
  4. Followed the on-screen Solaris installation instructions, and it pulled extra packages from the default Solaris repository over the internet.
  5. Don't forget to install the VirtualBox Guest Additions for Solaris for a smoother and faster experience.

Here's the end result (click to enlarge):

Oracle Solaris 11 Express on VirtualBox

Pretty slick, huh? 


Friday Oct 29, 2010

Running Storage Simulators in VirtualBox

I love hearing what people get up to with VirtualBox...

This week was all about Storage Simulators: using a vm to simulate a NAS device, complete with management tools, so you really get the idea of what you're buying into. I was reminded of 2 this week:

  • How to install the NetApp OnTap Simulator - a comprehensive HowTo that includes how to create the guest, how to install the OS (Oracle Enterprise Linux in this case) and then how to install the Simulator software.
  • How to use the Sun Storage 7000 Simulator which is available as a handy ovf appliance that just imports and goes.


Drop me a comment if you have other interesting use cases.


Monday Oct 11, 2010

VirtualBox 3.2.10 is released

Version 3.2.10 has just been released and made available from the Usual Places.

It fixes a bunch of stuff and also adds support for yesterday's Ubuntu 10.10 release and the forthcoming Fedora 14.

- FB 

Friday Oct 01, 2010

Starting VirtualBox in FullScreen mode

Regular readers will know that this blog often acts as an extension to my built-in memory :-). So here's another "memo-to-self" which others may find useful:

Most VirtualBox commands start with :

VBoxManage ...
command. But to start up a vm in fullscreen mode use the following command:
VirtualBox --startvm vm_name --fullscreen


Wednesday Sep 08, 2010

VirtualBox and Linux kernel updates

In order to weave its magic, VirtualBox uses loadable kernel modules both on the Host, and in the Guest as part of the Guest Additions. On Linux, these kernel modules are related to the version of the kernel that you're running and if you update the kernel then the modules need to be rebuilt to match the new version. Technologies such as dkms handle this and so if you're running dkms you'll be in good shape. But if you aren't running dkms, then you may find that after an update and a reboot, VirtualBox or the Guest Additions don't run anymore. Here's how to fix things... 

If your Linux system is setup to build modules you can just execute one of:

  • Host: 
    /etc/init.d/vboxdrv setup
  • Guest:
    /etc/init.d/vboxadd setup

If your system is not setup to build kernel modules you will need to get the relevant packages to do this. For example, on Oracle Enterprise Linux you need to:

  1. Update your system to the latest version: open a terminal and as root, execute 
  2. yum update
  3. Install the GNU C compiler and the kernel development packages using
  4. yum install gcc 
    yum install kernel-devel
  5. Reboot your guest system in order to activate the updates before then running the commands above to rebuild the VirtualBox modules. 

 This is covered in more depth in the VirtualBox User Manual in the sections on Host Modules and Guest Additions.

Hope this is some use to someone


Friday Aug 13, 2010

The VirtualBox Software Development Kit

One of the really neat things about VirtualBox is the elegance with which it is architected. At almost every layer there are published APIs which mean you can build really neat solutions to access the underlying services of VirtualBox. And the "front ends" to VirtualBox such as the GUI (VirtualBox.exe) and the Command Line (VBoxManage.exe) use these same public API's without no backdoors or private interfaces at all. Graphically, it looks like this:

VirtualBox API

Third parties are also building cool solutions against these interfaces too. (BTW you really should checkout the still-under-development but hugely impressive phpvirtualbox)

And so, as the VirtualBox ecosystem grows, it's important that people stick to the APIs. So, if in doubt, consult the VirtualBox Programming Guide and Reference.

We hope you enjoy a little bedtime reading ;-)


Monday Aug 09, 2010

VirtualBox 3.2.8 is released

The Fat Bloke may sleep but the VirtualBox engineering team never seems to... Version 3.2.8, a maintenance release, was made available from the Usual Places late last week.

It fixes a bunch of stuff.

- FB 

Tuesday Jul 27, 2010

VirtualBox log files

OK, I have to admit that this entry is one for the connoisseur, but some of these blogs entries double up as my extended memory, so before I forget... ;-)

One of the key tools you can use to diagnose any issues with VirtualBox is the VirtualBox log file for a vm session. VirtualBox always creates a log file which reflects the lifecycle of the virtual machine.

Log File Location

VirtualBox log files live in a per-user/per-vm directory that will be something like:

  • On Windows, this is %HOMEDRIVE%%HOMEPATH%\\.VirtualBox\\Machines\\<vm name>\\Logs; typically some- thing like C:\\Documents and Settings\\Username\\.VirtualBox\\Machines\\<vm name>\\Logs\\vbox.log
  • On Mac OS X, this is $HOME/Library/VirtualBox/Machines/<vm name>/Logs
  • On Unix-like systems (Linux, Solaris), this is $HOME/.VirtualBox/Machines/<vm name>/Logs

The log files are rotated such that the most recent is always called vbox.log and older ones are vbox.log.[123]. These log files contain lots of information about the capabilities of both the host and the guest vm and should be provided whenever reporting issues with VirtualBox. 

Log File Format 

The layout of the logfile varies based on whether you are resuming or starting initially but roughly follows this pattern:

Section Content Starts around...


VirtualBox version;
Host OS information;
Host hardware info 

Start of file


A listing of the configuration information of guest (guest virtual hardware)

\*\*\* CFGM dump \*\*\*

Host information (CPUID Dump)

Low level CPU information of Host and what will be reflected to Guest
\*\*\* CPUID dump \*\*\*

Creating the VM Information about the creation of the virtual machine environment
\*\*\* End of CPUID dump \*\*\*

Powering on or Loading from a saved state 

When powering on you'll see very little in the logs at this stage.  If loading from a saved state, information from the Saved State Manager about matching previous state to current environment.
Changing the VM state from 'CREATED' to 'POWERING_ON'

Changing the VM state from 'CREATED' to 'LOADING' 


Once the saved state is loaded, or the vm is booted, the guest code is executed.

Changing the VM state from 'POWERING_ON' to 'RUNNING'


Changing the VM state from 'LOADING' to 'SUSPENDED'

Changing the VM state from 'SUSPENDED' to 'RESUMING'.

Guest lifetime

This part of the log contains entries concerning the lifetime of the Guest.

Changing the VM state from 'RESUMING' to 'RUNNING'.


Powering Off or Suspending A dump of the guest state at the time the vm was powered off.

\*\*\* Guest state at power off \*\*\*


The statistics collected during the session are dumped out.

\*\*\* Statistics \*\*\*


One final tip when you're looking to make sense of log files: each line begins with a timestamp. e.g. 

00:00:01.817 VRDP: TCP server listening on port 3389.

This is in the format and is usually relative to the start of the vm. If you prefer wall clock time you can set the environment variable before starting the vm:

 export VBOX_RELEASE_LOG_FLAGS=time; VBoxManage startvm Android

 - FB


Fat Bloke


« April 2014