Running sphinx in VirtualBox

This tutorial explains how to run Sphinx in a virtual machine (VM) environment using VirtualBox.

Setup the virtual machine

  1. Download and install VirtualBox.
  2. To capture a USB device with a filter, you need to install the VirtualBox Extension Pack.
  3. Create a virtual machine using one of the supported Linux distributions.
  4. It is recommended to allocate at least 8 GB of base memory and 12 MB of video memory.
  5. Configure your VM to use VirtualBox 3D acceleration:
  • Make sure you install the Guest Additions into the Linux guest (Host+D)
  • Enable 3D acceleration in the VM settings: .. image:: images/virtualbox.png
  1. Start the guest OS and install Sphinx.

Start running Sphinx

From the running VM, you can now run Sphinx with the option --port-forwarding set to the host IP address to forward all required ports to the host:

sphinx-server --port-forwarding=<host_ip> /opt/parrot-sphinx/usr/share/sphinx/drones/anafi4k.drone

When running sphinx-client on the host, you must specify the IP address and port of the VM:

sphinx-client --server-uri=<VM_ip:VM_port>

Receive access to the network

To enable bridged networking, open the Settings dialog of a virtual machine, go to the Network page and select Bridged Network in the drop-down list for the Attached To field. Select a host interface from the list at the bottom of the page, which contains the physical network interfaces of your systems.

Use a USB WiFi adapter

To use the WiFi dongle of the host in the virtual machine, you must capture the USB device using a USB filter.

Open the VM settings, go to the USB page and create a USB filter. Delete all values except Name, Vendor ID and Product ID.

To find which WiFi PCI device is currently installed on your system, you can type the following commands on the host:

lsusb | grep -i wireless
lsusb | grep -i intel

Running sphinx on an headless virtual machine

On an headless virtual machine, you can use xvfb to start an X server that emulates a dumb framebuffer using virtual memory:

sudo apt-get install xvfb
Xvfb :99 -screen 0 1x1x24+32 -fbdir /var/tmp &
export DISPLAY=:99
sphinx-server --port-forwarding=<host_ip> /opt/parrot-sphinx/usr/share/sphinx/drones/anafi4k.drone