Configure audio devices on VirtualBox

I recently installed a new Debian guest on a FreeBSD host with VirtualBox. On this VM I need to be able to play/record sound from my laptop (Skype). To do so I configure the guest with an Intel HDA soundcard using the OSS audio driver. However I want to use the internal mic (/dev/dsp1.0) which is different than the default unit (/dev/dsp). So I had basically two options. Either I could record my voice but could not hear anything or I could hear everything but could not record my voice.

But there is a solution! I digged in the VirtualBox source code, and there are actually some options for the OSS driver (and other audio drivers as well). The two options of interests are:

  • DACDev: Path to the DAC (output/playback) device.
  • ADCDev: Path to the ADC (input/record) device.

You can use VBoxManage to configure these options. Assuming that the name of the VM is MyVM with an Intel HDA card and the OSS driver, use this command:

$ VBoxManage setextradata MyVM "VBoxInternal/Devices/hda/0/LUN#0/Config/Audio/OSS/ADCDev" /dev/dsp1.0

You can also directly edit the vbox file for this VM:


  <ExtraDataItem name="VBoxInternal/Devices/hda/0/LUN#0/Config/Audio/OSS/ADCDev" value="/dev/dsp1.0"/>

Note if when starting the VM you receive the message The attached driver configuration is missing the 'Driver' attribute (VERR_PDM_CFG_MISSING_DRIVER_NAME). This is probably because the sound device you selected for this VM is not the same as specified in the extra data. The above example is for Intel HD Audio (hda). If you need ICH AC97, replace hda by ichac97 in the example above.

Get rid of that Non-Breaking space

The non-breaking space is a variant of the space character which as the name suggests prevents automatic line breaking when using a space character. Another common use of it is to avoid collapsing of white-spaces in formats such as TeX or HTML. There are also some others specific typographic uses but nevermind.

From my point of view this character is a real pain, a annoying remain of a former era when the only editor you had was plain-text and which is now just good at invisibly polluting your work so that no compiler, interpreter or any other ASCII oriented tool would accept it anymore. For ASCII is not dead, it’s 7-bit, it’s common, it’s the neutral zone of all character set and No-Break Space shall not interfere therefore it must be eradicated from the very surface of earth or at least from my own keyboards.
There are several options to do that under Xorg. The first one would be to use the setxkbmap command to specify the nbsp:none option for your keyboard.
setxkbmap -option "nbsp:none"

However this won’t work as you might expect it especially when you have multiple keyboards with different layouts. So another solution would be to specify XkbOption directly within the Xorg configuration file, one for each input device. But this won’t work neither if you use a Bépo layout as this option will simply disable the use of underscore (AltGr Space). So the final solution is based on xmodmap to modify the list of keysyms assigned to the space keycode (0x41). You may just add the following line to ~/.xmodmap and ensure that the file is loaded when your session starts with xmodmap ~/.xmodmap.

keycode 65 = space space space space underscore underscore space space