Solved bhyve / Windows 10 - no audio

I have Windows 10 running in Bhyve, but am lacking sound. I would like to have sound to have as much functionality and utility in the VM as possible. If I go to 'System Information', I don't see any sound devices.

I don't have Alpine Linux working graphically yet, but I would like to have sound there too if possible. If I do lspci in Alpine, I just see a VGA controller, no audio. With vm-bhyve, how would I specify an audio device? I don't want to passthru as that means the host wouldn't have audio any longer.
 
As for now, vm-bhyve doesn't have a dedicated option for sound, so you have to specify a device as a "raw" bhyve option:
Code:
bhyve_options="-s 10,hda,play=/dev/dsp,rec=/dev/dsp"
Here I specified "10" as slot number, but feel free to use what suits your needs.
 
That did it!
For the records, I just discovered reading vm(8) that vm-bhyve has an option to enable sound:
Code:
sound         Set this option to yes in order to provide HD Audio
              Emulation to the guest. Please see bhyve(8) for de-
              tails.

sound_play    Set this to the desired audio output device of the
              host to the guest. Defaults to '/dev/dsp0'

sound_rec     Set this to the desired audio input device of the
              host to the guest. If empty no audio input device is
              configured. Defaults to '' (empty)
While, IIUC, setting just the sound variable should suffice, I had to set the sound_play variable to /dev/dsp instead of the default value; otherwise my VMs would crash. The error in bhyve.log was the following:
Code:
Assertion failed: (!err), function hda_codec_audio_output_do_transfer, file /usr/src/usr.sbin/bhyve/hda_codec.c, line 702.
 
Last edited:
I've had troubles getting sound to pass through, but since I use RDP to access my VM's, I just use RDP redirection, and it works great.
 
Back
Top