Computer >> Computer tutorials >  >> System >> Windows 10

Adding a Sound Card to a Virtual Machine on VMWare ESXi

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.

Adding a Sound Card to a Virtual Machine on VMWare ESXi

Adding a Sound Card to a Virtual Machine on VMWare ESXi

If you connect to Windows over RDP, you can forward all the default Windows sound events to the Remote Audio device, even if there is no sound card in the VM.

Adding a Sound Card to a Virtual Machine on VMWare ESXi

To do it, select “Remote audio playback” -> “Play on this computer” in the mstsc.exe client settings.

Adding a Sound Card to a Virtual Machine on VMWare ESXi

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).

Also, you can forward a physical audio device from your host directly to the VM using PCI Passthrough.

Let’s see how to add a virtual sound card via a .vmx file:

  1. Enable the SSH service in the settings of your ESXi host, on which the virtual machine is running; Adding a Sound Card to a Virtual Machine on VMWare ESXi
  2. Stop the VM;
  3. Connect to your ESXi host using any SSH client (I’m using Windows 10 built in SSH client):
    ssh root@mun-esxi5
    Go to the folder containing your virtual machine files. For example:
    # cd /vmfs/volumes/VMFS_Store1/VMName1
  4. Make a backup copy of the the .vmx file of your VM;
  5. Edit the VMX file in the vi editor:
    # vi VMName1
  6. 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"

    Adding a Sound Card to a Virtual Machine on VMWare ESXi

  7. Save the VMX file and run the VM;
  8. Make sure that Windows Audio Service has been enabled in the guest OS, and hdaudio sound card (High Definition Audio Device) has appeared in the list of devices. Adding a Sound Card to a Virtual Machine on VMWare ESXi