VMWare wants to access /dev/dsp on my Linux (Mandrake 9.2) system.
Because I run KDE I usually have arts running. When any sound system is running, VMWare fails to connect since /dev/dsp is in use.
It is a real nuisance to stop arts in order to permit VMWare to use the sound system, and then start arts in order to let anything on the Linux system have sound.
I have tried and failed using artsdsp to snag the sound calls from VMWare. Is there any way at all to get sound in VMWare on a Linux host to play pretty with Linux apps?
Just chiming in here...
In my mind, it is totally unacceptable that VMWware doesn't support esd or artsd yet. VMWare claims to allow people to run multiple operating systems on a single machine. How can this be done successfully if each attempts to obtain exclusive control of the /dev/dsp device? esd and artsd aren't new technologies, they've been around for years, it's about time VMWare got on the ball and fixed this GLARING problem.
FYI - there is no workaround. Disabling artsd will work for you until KDE and VMware both try to play a sound at the same time, VMWare will lose and disable the device. artsdsp doesn't work with VMWare, as far as I can tell.
When is this gunna be fixed??
Properly configure esddsp or artsdsp, and it will work:
1) artsdsp and esddsp must not use absolute paths. I.e. ~5th line from the end of artsdsp should read:
LD_PRELOAD=libartsdsp.so.0:libartsc.so.0
2) These libraries must have suid bit set. chmod 4444 /usr/lib/libartsdsp.so.* /usr/lib/libartsc.so.*.
3) And now,
artsdsp vmware
and voila - if you did everything above right, VMware will use arts... At least on Debian.
I too am having sound problems and found your post. Thought I had found a solution.
Problem is, for me, it did not work.
When running vmware by itself (without artsdsp) I get the following error: "Failed to open sound device /dev/dsp: Cannot allocate memory
Sound will not be available."
I assumed this was actually reflecting the fact that /dev/dsp was opened for exclusive access by artsd.
When running artsdsp -v vmware as my userid, vmware insists it cannot find libartsdsp.so.0 even though running ldconfig -p | grep libartsdsp.so.0 shows its location to be in the cache.
Running artsdsp -v vmware as root appears to work (no library load errors) until I login to the guest O/S (Win2K in this case) and then I get the same error as shown above when artsdsp is not used.
At this point I will be glad to try about anything, so all ideas are welcome. I think I'm going to do an strace on vmware and see what pops out, maybe that will help.
Lastly, I would like to add that I agree with another poster in that I cannot believe that vmware does not support KDE artsd, especially since it is one of the most used user interfaces in the Linux world.
Thanks,
Steve Wheeler
When running artsdsp -v vmware as my userid, vmware
insists it cannot find libartsdsp.so.0 even though
running ldconfig -p | grep libartsdsp.so.0 shows its
location to be in the cache.
Your vendor must fix artsdsp, or you must modify artsdsp yourself in a way I outlined above. There is no third way.
I did do the modifications you suggested.
It was after doing them, and running the command artsdsp -v vmware, that vmware started complaining that it could not find the library. Again, with your mods in place, and running the command as root, vmware finds the library but I get the same exact error.
BTW: I did an strace of vmware starting up from artsdsp and vmware just hung, I never even got the screen up.
Weird.
smw
I did do the modifications you suggested.
It was after doing them, and running the command
artsdsp -v vmware, that vmware started complaining
that it could not find the library.
Are you sure you performed chmod commands on two \*arts* libraries? Library must have suid bit set to be eligible for LD_PRELOAD to suid application. And maybe that artsd on your system is different version than on mine: make sure that you have libartsdsp.so.0 and libartsc.so.0 in /usr/lib directory - they should be symlinks to libartsdsp.so.0.0.0 and libartsc.so.0.0.0, and these two files are two which should be suid.
Also, vmware is not app which needs this preload - vmware-vmx spawned by vmware is app which needs that preload, so you may try renaming vmware-vmx (in /usr/lib/vmware/bin/ or/usr/lib/vmware/bin-debug/ to vmware.backup, and create shell script (in these directories) which will do
#! /bin/bash
exec artsdsp "$0.backup" "$@"
and then start vmware without artsdsp preload.
And now I remember - I had to do some changes in artsdsp library - it hooks only open() - but VMware is LFS aware application, and so it uses open64(). libartsdsp.so.0.0.0 must hook both open and open64, otherwise artsdsp is incompatible with apps which can use files over 2GB.
hi petr,
i have read the posts about esd & vmware, but i did not succeeded in getting the sound in vmware working with esd on the host (fedora core 3) machine.
i changed the permissions of the \*arts* libs, and changed the libs' absolute paths in artsdsp and esddsp, both did not worked, i get an error that the libs cannot be found. i also tried the trick with renaming of vmware-vmx, no success (vmware complains about /dev/dsp is in use).
i am a little bit fustrated in the meantime...
any help & suggestions are highly welcome!
thanks,
martin
Did you tried installing http://platan.vc.cvut.cz/ftp/pub/vmware/vmwaredsp-1.1.tar.gz ? esddsp/artsdsp wrappers are not compatible with apps which are built with support for files over 2GB - and so they do not work with VMware.
If you have 64bit host, you are on your own, but with 32bit host it should work correctly - just install it and type 'vmwareesd' or 'vmwarearts', depending on your preference and system you use.
I just tried using vmwaredsp-1.2, with some success. The real problem with this approach is that, at least on my system, the dynamic loader completely filters LD_PRELOAD from the environment of setuid binaries if you are not running as root, and vmware-vmx is a setuid binary. But running "sudo vmwarearts" still doesn't work, because then vmdsp looks for arts running as root, not as me.
The only way I can get this to work as a regular user is to "echo /usr/lib/libvmdsp.so > /etc/ld.so.preload". The problem then is that the library is loaded by every program, not just vmware.
I don't consider this to be a good long-term solution for sound support on Linux. It would be much, much, better if VMWare supported arts/esd/jackd/etc directly.
IMPORTANT: there is a bug in vmwaredsp-1.2 that causes a segfault if VMDSP_BACKEND is not defined. Putting /usr/lib/libvmdsp.so in /etc/ld.so.preload without a patch will crash every program that uses the dynamic linker (which is basically everything).
\--- vmdsp.c.orig 2005-03-22 19:53:56.000000000 +0100
\+++ vmdsp.c 2005-03-26 22:04:24.042614144 +0100
@@ -1338,6 +1338,9 @@
allow_mixer_passthrough = 1;
}
bke = getenv("VMDSP_BACKEND");
+ if (!bke)
+ bke = "none";
+
for (p = bke; *p; p++) {
if (*p >= '0' && *p <= '9') {
continue;
I just tried using vmwaredsp-1.2, with some success.
The real problem with this approach is that, at
t least on my system, the dynamic loader completely
filters LD_PRELOAD from the environment of setuid
binaries if you are not running as root, and
Are you sure you run 'runme.sh' installer? It should work - and works on my systems...
The only way I can get this to work as a regular user
is to "echo /usr/lib/libvmdsp.so >
/etc/ld.so.preload". The problem then is that the
library is loaded by every program, not just vmware.
Are you sure that libvmdsp.so is -r-Srr on your box?
IMPORTANT: there is a bug in vmwaredsp-1.2 that
causes a segfault if VMDSP_BACKEND is not defined.
Putting /usr/lib/libvmdsp.so in /etc/ld.so.preload
d without a patch will crash every program that uses
the dynamic linker (which is basically everything).
It is fixed in vmwaredsp-1.3. I hit it during testing...
Yes. And to be sure....
~ > ls -l /usr/lib/libvmdsp*
-r-Srr 1 root root 18733 Mar 26 19:55 /usr/lib/libvmdsp.so
-rwxr-xr-x 1 root root 9825 Mar 26 19:55 /usr/lib/libvmdsp_arts.so
-rwxr-xr-x 1 root root 11933 Mar 26 19:55 /usr/lib/libvmdsp_esd.so
Assuming that you use sudo, can you try the following and we can compare output?
> sudo chmod 4711 /usr/bin/strace
~ > sudo strace -e open -E LD_PRELOAD=libvmdsp.so ls 2>&1 | head -n 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/usr/lib/libvmdsp.so", O_RDONLY) = 3
open("/etc/ld.so.preload", O_RDONLY) = 3
~ > strace -e open -E LD_PRELOAD=libvmdsp.so ls 2>&1 | head -n 3
open("/etc/ld.so.preload", O_RDONLY) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/librt.so.1", O_RDONLY) = 3
~ > sudo chmod 755 /usr/bin/strace
My system is gentoo, with glibc 2.3.4.20041102. I looked briefly at the glibc code, and it appears from looking at elf/dl-support.c and elf/rtld.c that glibc is doing exactly what it is supposed to do...stripping the LD_PRELOAD and a bunch of other environment variables when setuid programs are executed. There is a global "__libc_enable_secure" variable that turns on all this code, and I'm not sure what sets that variable. Perhaps I missed a configuration setting somewhere, or maybe its new and Gentoo users are the first to find out! I will look at this more tomorrow, after I have had some sleep.
It is fixed in vmwaredsp-1.3. I hit it during
testing...Are you sure you run 'runme.sh' installer? It should
work - and works on my systems...
It should be stripped from environment AFTER remembering its value (so LD_PRELOAD is not passed to processes suid app starts unless library reinstates LD_PRELOAD back to environment).
But dl_main (in rtld.c) processes LD_PRELOAD even for suid apps - there just must not be / (that is libvmdsp.so is OK) and dl-load.c's open_path verifies that S_ISUID bit in mode is set.
It is with glibc-2.3.2 on Debian.
It is correct that __libc_enable_secure is set (it is set when euid != uid on startup).
Your test works fine here:
Re: Linux sound. Is there any way...vana@evon:~$ strace -e open -E LD_PRELOAD=libvmdsp.so /bin/login
open("/lib/tls/i686/mmx/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/mmx/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/mmx/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/mmx/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/i686/mmx/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/i686/mmx/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/i686/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/i686/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/mmx/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/mmx/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/i686/mmx/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/i686/mmx/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/i686/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/i686/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/mmx/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/mmx/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/mmx/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/mmx/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/mmx/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/mmx/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/cmov/libvmdsp.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libvmdsp.so", O_RDONLY) = 3
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/tls/libcrypt.so.1", O_RDONLY) = 3
open("/lib/libpam.so.0", O_RDONLY) = 3
open("/lib/libpam_misc.so.0", O_RDONLY) = 3
open("/lib/tls/libc.so.6", O_RDONLY) = 3
open("/lib/tls/libpthread.so.0", O_RDONLY) = 3
open("/lib/tls/libdl.so.2", O_RDONLY) = 3
open("/proc/self/cmdline", O_RDONLY|O_LARGEFILE) = 3
open("/var/run/utmp", O_RDWR) = 3
No utmp entry. You must exec "login" from the lowest level "sh"
vana@evon:~$ ls -l /bin/login
-rwsr-xr-x 1 root root 35512 Mar 15 13:59 /bin/login[/code]
/proc/self/cmdline opening is done by vmdsp code when it tries to find whether process is named vmware-vmx and its last argument is absolute path to regular file (it is path to *.vmx file you are trying to poweron - program works only with vmware-vmx, if you want to use it with other programs, you must remove this check from libvmdsp.so).
Well, and as you can see, on my system it opens libvmdsp.so before opening /etc/ld.so.cache while on your this order is reserved. Maybe some "fix" went into glibc since version Debian uses? In that case you are out of luck, I'd say.
Ok, I got it figured out. It seems that in response to GLSA 200408-16, Gentoo made a patch that in addition to fixing the LD_DEBUG vulnerability, moved the cleansing of the environment to before the values were saved. This part of the change is not in the official glibc CVS source, and the patch is not applied for glibc-2.3.4.20050125-r1 (currently marked for testing...). So Gentoo users will need to upgrade their glibc to at least 2.3.4.20050125 to use LD_PRELOAD with setuid binaries.
Thanks for the help petr.
Did you tried installing
http://platan.vc.cvut.cz/ftp/pub/vmware/vmwaredsp-1.1.
tar.gz ? esddsp/artsdsp wrappers are not compatible
with apps which are built with support for files over
2GB - and so they do not work with VMware.
Petr: Pardon me for opening such an old thread>
I installed the above (actually the 1.3 version)
and the sound works fine with arts now with 5.5.1 build-19175
running on SuSE 9.3. Thank you.
Each launch of a VM is accompanied with the following message:
Unable to open /dev/mixer: No such device.
No mixer or volume control capabilities will be available.
But of course this is not true, there is a mixer in the VMs and
it works. I could check the box that tells me never to show that
message again, but I wonder why it happens at all?
/dev/mixer does exist:
jsa@norvio:~> l /dev/mixer*
lrwxrwxrwx 1 root root 6 2005-08-28 15:45 /dev/mixer -> mixer0
crw------- 1 jsa audio 14, 0 2005-03-19 10:36 /dev/mixer0
Secondly:
I also use vmrun to open particular VMs from Icons on the linux desktop.
These typically use a command line like:
vmrun start /home/
What would be the proper command line for these with vmwaredsp?