There are several posts out there regarding this topic, but none accurately present the solution to the problem of a VMware Workstation on a Windows Host having the following problem with connecting the virtual sound card under a Linux guest (the message appears under Windows Guests as well, but the sound just happens to work properly):
"The default sound device cannot be opened: A device ID has been used that is out of range for your system. Failed to connect virtual device sound."
Here is the real solution.
The problem is that the "Stereo Mix" option has to be enabled. This is an option with Realtek AC'97 compatible sound cards. You are likely having this problem in the first place if you have a Realtek-compatible sound card. The problem doesn't lie in the guest Linux installation of ALSA, PulseAudio, OSS, or any other feature under Linux like many have suggested provided that you are using the recommended sound setup for your distribution.
In order to solve the problem, enable the "Stereo Mix" option:
1. Right-click on the sound card volume icon in the tray.
2. Select "Recording Devices"
3. In a blank or "white" space where the recording devices are listed, right-click and enable "Show disabled devices".
4. The "Stereo Mix" option should appear.
5. Right-click on the "Stereo Mix" option, and select Enable.
6. Make sure that the virtual sound card is set to connect at startup for the guest VM in question.
7. Enjoy working sound in your Guest VMs.
If the "Stereo Mix" option doesn't appear in the recording devices panel, then you need to install the latest Realtek AC'97 codec drivers here:
After installation of the updated drivers, repeat steps #1-#7.
Hope this helps and makes the solution official.
--