By default, there are no sound devices in VMWare ESXi virtual machines. If you want to get sound from a guest Windows VM, it is easier to use the RDP Remote Audio (used to forward sounds from a remote computer to an audio device of a local host in an RDP client). However, in some cases a user or an app running in a virtual machine has to get direct access to a sound card. In this article, we will show how to add a virtual sound card to a VM running on VMWare ESXi host.
When you create a new VMWare virtual machine on ESXi, there are no virtual audio devices in device list. If you connect to the guest Windows VM, you will see that the sound icon in the tray has a red cross on it with the message
No Audio Output Device is installed. Accordingly, there are no audio devices in Windows Device Manager.
To do it, select “Remote audio playback” -> “Play on this computer” in the
mstsc.exe client settings.
A virtual HD Audio device is officially considered unsupported for the VMWare ESXi virtual machines. But you can add it via the .vmx configuration file or advanced configuration parameters of the virtual machine (in VMWare Workstation virtual machine you can add an audio device like any other virtual hardware).
Let’s see how to add a virtual sound card via a .vmx file:
- Enable the SSH service in the settings of your ESXi host, on which the virtual machine is running;
- Stop the VM;
- Connect to your ESXi host using any SSH client (I’m using Windows 10 built in SSH client):
Go to the folder containing your virtual machine files. For example:
# cd /vmfs/volumes/VMFS_Store1/VMName1
- Make a backup copy of the the .vmx file of your VM;
- Edit the VMX file in the vi editor:
# vi VMName1
- Add the following lines to the end of your config file:
sound.present = "true" sound.allowGuestConnectionControl = "false" sound.virtualDev = "hdaudio" sound.fileName = "-1" sound.autodetect = "true"
- Save the VMX file and run the VM;
- Make sure that Windows Audio Service has been enabled in the guest OS, and
hdaudiosound card (High Definition Audio Device) has appeared in the list of devices.