Please feel free to send documentation patches to the vbox-dev mailing list.
Investigating audio problems
To pinpoint the issue further, it first must be determined if the audio problems are on the guest or on the host side. For the host side there are a variety of so-called host audio drivers (backends) which are needed in order to support the host operating system playing back and recording audio from / to the guest (VM).
Without the VBox.log and the dumped audio output files a diagnosis is not possible!
Tip of the day: Best is to copy & paste the following commands to avoid typing errors.
Dumping audio output
To enable dumping guest audio output, do the following:
- Make sure that the affected VM is not running anymore.
VBoxManage setextradata <Name-of-VM> "VBoxInternal2/Audio/Debug/Enabled" "true"
- Start the affected VM again.
Now, when performing any audio output on the guest (playback), there will be separate .WAV files created in the host's temporary directory.
For Windows hosts this by default is C:\Windows\Temp or C:\Users\<username>\AppData\Local\Temp. For Linux / Solaris / MacOS hosts this by default is /tmp/. When in doubt, have a look at the $TMP or $TMPDIR environment variables respectively.
To tweak the output directory to match your needs, do a
VBoxManage setextradata <Name-of-VM> "VBoxInternal2/Audio/Debug/PathOut" "/path/to/your/output/directory"
The created .WAV files then can be played back with any regular media player on the host, e.g. VLC, MPlayer or Windows Media Player.
|Playback in running VM||Dumped file(s)||Diagnosis|
|Distorted||OK||Host driver (backend) problem|
|OK||Distorted||Host mixing problem|
|Distorted||Distorted||Device emulation problem|
Enable extended logging
Note: These steps are only for VirtualBox older than 5.2. Newer versions perform those steps automatically.
As always when it comes to diagnosing problems with VirtualBox the appropriate VBox.log is useful to have. To gather more verbose information about the actual audio state, please do the following:
- On Windows
- Shut down all VM instances and VirtualBox programs, including VBoxSVC.
setx VBOX_RELEASE_LOG "drv_host_audio.e.l.l2.l3.f+drv_audio.e.l.l2.l3.f+audio_mixer.e.l.l2.l3.f+dev_hda_codec.e.l.l2.l3.f+dev_hda.e.l.l2.l3.f+dev_ac97.e.l.l2.l3.f" /Mon an Administrator command prompt to set this on a system-wide level (required).
- Close the Administrator terminal
- Open a new terminal as regular user
- verify that the changes were applied correctly be running
- Start the VirtualBox Manager.
- On Linux/OS X/Solaris, stop the VirtualBox manager and restart it by running the following from a terminal:
- Start the machine you want to diagnose audio for.
- Perform and reproduce the audio operation.
Ok, all done! What now?
Important: The newly created VBox.log log file must contain the line
Audio: Verbose logging enabled
Please collect the VBox.log from the host, pack it (ZIP, RAR) into an archive and submit that archive as part of a new or existing bug report at our public bug tracker.
Note: Without the log file we cannot diagnose your issue, so please make sure to always attach that. Thank you.
Also don't forget to disable debugging again -- otherwise this will fill up your hard drive with the information pointed out above pretty quickly.
To disable debugging, do a
VBoxManage setextradata <Name-of-VM> "VBoxInternal2/Audio/Debug/Enabled" ""