VirtualBox hypervisor driver

The libvirt VirtualBox driver can manage any VirtualBox version from version 2.2 onwards.

Project Links

Connections to VirtualBox driver

The libvirt VirtualBox driver provides per-user drivers (the "session" instance). The uri of the driver protocol is "vbox". Some example connection URIs for the driver are:

vbox:///session                      (local access to per-user instance)
vbox+unix:///session                 (local access to per-user instance)
vbox+tcp://  (remote access, SASl/Kerberos)
vbox+ssh://  (remote access, SSH tunnelled)

NOTE: as of libvirt 1.0.6, the VirtualBox driver will always run inside the libvirtd daemon, instead of being built-in to the library directly. This change was required due to the fact that VirtualBox code is LGPLv2-only licensed, which is not compatible with the license of LGPLv2-or-later. The daemon will be auto-started when the first connection to VirtualBox is requested. This change also means that it will not be possible to use VirtualBox URIs on the Windows platform, until additional work is completed to get the libvirtd daemon working there.

Example domain XML config

<domain type='vbox'>

    <boot dev='cdrom'/>
    <boot dev='hd'/>
    <boot dev='fd'/>
    <boot dev='network'/>



    <disk type='file' device='cdrom'>
      <source file='/home/user/Downloads/slax-6.0.9.iso'/>
      <target dev='hdc'/>

    <disk type='file' device='disk'>
      <source file='/home/user/tmp/vbox.vdi'/>
      <target dev='hdd'/>

    <disk type='file' device='floppy'>
      <source file='/home/user/tmp/WIN98C.IMG'/>
      <target dev='fda'/>

    <filesystem type='mount'>
      <source dir='/home/user/stuff'/>
      <target dir='my-shared-folder'/>

    <interface type='bridge'>
      <source bridge='eth0'/>
      <mac address='00:16:3e:5d:c7:9e'/>
      <model type='am79c973'/>

    <interface type='user'>
      <mac address='56:16:3e:5d:c7:9e'/>
      <model type='82540eM'/>

    <sound model='sb16'/>

    <parallel type='dev'>
      <source path='/dev/pts/1'/>
      <target port='0'/>

    <parallel type='dev'>
      <source path='/dev/pts/2'/>
      <target port='1'/>

    <serial type="dev">
      <source path="/dev/ttyS0"/>
      <target port="0"/>

    <serial type="pipe">
      <source path="/tmp/serial.txt"/>
      <target port="1"/>

    <hostdev mode='subsystem' type='usb'>
        <vendor id='0x1234'/>
        <product id='0xbeef'/>

    <hostdev mode='subsystem' type='usb'>
        <vendor id='0x4321'/>
        <product id='0xfeeb'/>