VM - no sound?

tems

Cadet
Joined
Aug 4, 2017
Messages
2
Hi All,

Any ideas why I can't get sound to work on my newly installed VMs?

I recently upgraded to FN11 and noticed the new VM feature. I gave it a whirl with and installed a couple of VMs with ease (Ubuntu (ubuntu-17.04-desktop-amd64) and Solus (Solus-1.2.1). Both seem work work fine when I VNC into them (using Real VNC and Jump both for OS X) however I can't seem to get the sound to work on either of them.

On both Ubuntu and Solus the sound icon seems normal, the volume is maxed. I noticed that in both OSs the sound device was listed as "Dummy Output" but don't see how to add another device.

Does anyone have any ideas? Is it a case of sound not working on VMs or is it the case that I have to have the correct VNC software?

Thanks in advance for any pointers.

tems
 
Last edited:

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
IIRC there are no sound drivers in FreeNAS. So sound drivers on the host means no sound to pass through to VM's.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I don't believe VNC supports sound. Microsoft's RDP protocol does, if I recall correctly, though that may not be too helpful on Linux.

FreeNAS lacking sound drivers is probably not an issue here as much as the lack of some device of some sort. I think that USB passthrough may be supported now, and if so, it might be worth it to see what happens if you try a USB audio device. I don't use the FreeNAS VM stuff, but on a typical ESXi hypervisor environment you have similar issues, and handling this with USB is a common solution.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
But wouldn't the drivers need to be present in the host to recognize the device to pass it through regardless of what type of device it is?
 

tems

Cadet
Joined
Aug 4, 2017
Messages
2
Many thanks for the answers guys!

Have a great weekend.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
But wouldn't the drivers need to be present in the host to recognize the device to pass it through regardless of what type of device it is?

No. A driver is something that is designed to interact with a device. So when you want to have Homer Simpson say "D'oh!", you do "cat doh.au > /dev/audio" and the sound driver opens the sound card, takes the audio data and converts it to a format the audio card understands, and begins to send it to the sound card through a series of accesses that cause the sound card to make sound. The data sent to the card might not resemble what was sent to the driver, The driver understands how to interact with the device and is trying to produce a specific result from the device.

Hardware passthru such as PCI passthru would pass the device off to the VM without any host driver support at all. It simply makes the physical device, its memory mappings, interrupts, etc., all appear to the VM as though they were natively part of the VM. You might be able to do this with USB ports but because these are typically built into the chipset, you might end up needing to hand off half or all of your USB ports to the VM, because the hardware probably presents itself as one or (if you're lucky) two USB controllers.

Single device USB passthru would require basic driver support on the host to manage the USB bus itself, because the host still needs to understand how to actually interface with the USB devices and identify one as the "FooMagic WannaPassIt", which could be on any of several USB ports and also downstream of that on a hub. So the host speaks with the USB hardware, picks out the data for that specific USB device, and emulates that within the VM environment, but it doesn't actually have to understand what is being said to the USB device by the driver contained in the VM.

Ugh. I think that's a terrible answer. So ponder this:

Pretend you don't know French but your wife does. So some French guy calls you up on the telephone and your wife is standing by you. The French guy says "Bonjour, puis-je parler avec Homer Simpson." You don't know what that means, but you repeat the sounds to your wife. Understanding flashes on her face and she tells you to respond with "Vous avez un mauvais numéro de téléphone". You repeat those sounds to the caller. The caller says "Oh, au revoir" and hangs up.

You were able to do the basic things needed to communicate - hear the phone ring, pick it up, listen, speak, and do something vaguely intelligent like find someone to handle the communications. But you didn't actually understand the words being said, or compose the words being said, even though your mouth actually formed the sounds. You ""spoke"" French but only because someone else handled the higher level stuff.

This is how USB passthrough can work even if the host has no driver for the specific USB device in question.
 

Ziggy

Contributor
Joined
Oct 7, 2015
Messages
157
I have come across this issue in a vm I'm trying to setup to be available outside the lan. I want to use the vm (linux) to manage via Openwebif a linux tv box at home so that when I'm abroad I can access my tv channels. At the moment I can do this, but I have no sound. I intend to access the lan via Wireguard. From my reading of the posts above it seems possible to use a sound driver usb, so seeking some clarity on a possible solution. Firstly, where would I source such a driver? Secondly, when/if found, do I simply load it on a usb and plug that into the freenas box? Thirdly, how do I activate that driver? Any other suggestions or solutions gratefully received. Regards.
 
Last edited by a moderator:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Actually, it is possible to have sound in a Linux VM without USB passthrough, but it's kind of a hack. Basically, if the Linux VM uses PulseAudio, you can install PulseAudio for Windows on the machine acting as the VNC viewer, and then configure the Windows workstation's IP in the VM as a remote audio sink.

This is only really good for OS event sounds. As stated in the PulseAudio for Windows site:
  • RTP isn't working yet
  • Assert failure when using pacat -t raw
  • No UNIX sockets support
  • GUI utilities not ported
So RTP not working means watching video, your audio is going to be out of sync, and will suffer periodic drops.
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Of course, if you're accessing the VM via VNC from a Linux box, things are much smoother, as remote PulseAudio sinks will have both socket and RTP support.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399

Ziggy

Contributor
Joined
Oct 7, 2015
Messages
157
Thanks Samuel. Altho some of this I don’t currently understand (need to read some more), in essence it ‘sounds’ like (badum tish!) a much less complicated and indeed effective method of achieving sound via a vm is with a usb delivered sound driver? If so, I would welcome any simple but detailed guide on how to do this from anyone out there.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
I would welcome any simple but detailed guide on how to do this from anyone out there.

USB passthrough can't be accomplished from the web GUI. There is no simple guide for doing this, as you'll have to rebuild your VMs from the CLI using iohyve.

You should experiment with the PulseAudio option first to see if it will satisfy your needs.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
There's also this reference in an earlier thread about needing to disable xhci from loading during boot to make USB passthrough work, which could make your boot pool inaccessible.
 

StanTheMa

Dabbler
Joined
Jun 30, 2020
Messages
13
Top of head thought; could I run a linux on WSL2 and call the noVNC client from that to get GUI for VM on TrueNAS bhyve. Then perhaps Samuel's idea of if you're accessing the VM via VNC from a Linux box, things are much smoother, as remote PulseAudio sinks will have both socket and RTP support.
may work ? Maybe I've misunderstood noVNC client?
 
Top