Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old January 4th, 2007   #1
xp_newbie
Way Too Much Ubuntu
 
xp_newbie's Avatar
 
Join Date: Jun 2006
Beans: 282
HOWTO: Solve VMWare sound (mixing?) problem once and for all

Concise practical summary / steps for the impatient (tested on VMware version 5.5.3 build-34685):
Note: to run step #2 successfully you will need apt's Universal (Community maintained) repository enabled.
  1. sudo -i
  2. aptitude install alsa-oss
  3. chmod +s /usr/lib/libaoss.so.*
  4. mv /usr/bin/vmware /usr/bin/vmware.orig
  5. echo '#!/bin/bash' > /usr/bin/vmware
  6. echo 'LD_PRELOAD=libaoss.so exec /usr/bin/vmware.orig "$@"' >> /usr/bin/vmware
  7. chmod +x /usr/bin/vmware
  8. exit

(now launch vmware as before)

Background:

The sound on your Ubuntu system works perfectly.

When you start a Windows 2000/XP VM on VMWare, the sound works there too - most of the time... Every once in a while, despite the sound device not being used at all by any Linux program (or so you think), you get the following error message when starting a Windows 2000/XP VM on VMWare:

Quote:
Failed to open sound device /dev/dsp: Device or resource busy Virtual device sound will start disconnected.
Explanation:

There are two ways of getting an application to work with ALSA if the application was written for OSS.
  1. The first way is to load the special ALSA drivers that emulate the OSS kernel interface; these allow the application to open /dev/dsp0 and other OSS device files.
  2. The second way is to wrap the application in the libaoss library provided in this package; the wrapper causes the application to access native ALSA device files such as /dev/snd/pcmC0D0c instead of OSS device files.

Use of the alsa-oss library (i.e. method 1) is recommended over the use of OSS-emulation drivers if you want to use ALSA's PCM plugin layer.

Enjoy!
__________________
Ubuntu 6.06.1 LTS (Dapper Drake) running on:
> ASUS P4P800-E Deluxe (Promise 1+0 Stripe/RAID0)
Ubuntu 8.04 (Hardy Heron) running on:
> Lenovo 3000 N100 (type 0768, model 36U)

Last edited by xp_newbie; May 23rd, 2007 at 12:02 PM..
xp_newbie is offline   Reply With Quote
Old February 14th, 2007   #2
ssavelan
Gee! These Aren't Roasted!
 
Join Date: Nov 2006
Beans: 179
Re: HOWTO: Solve VMWare sound (mixing?) problem once and for all

I've never heard of VMWare?

Is that Virtual Machine. Sound interesting. Surely you are not suggesting that linux is using a device when you are booted into XP, so you must be talking about running a virtual machine? I recently manage to void my sound while trying to run wine on things that really shouldn't be run with wine yet.
ssavelan is offline   Reply With Quote
Old February 14th, 2007   #3
ssavelan
Gee! These Aren't Roasted!
 
Join Date: Nov 2006
Beans: 179
Re: HOWTO: Solve VMWare sound (mixing?) problem once and for all

http://en.wikipedia.org/wiki/VMware

I see, that is what I thought. Must you purchase such software?

---------------
ps.... we need to make everything JACK-able.

Last edited by ssavelan; February 14th, 2007 at 09:41 PM.. Reason: Addition
ssavelan is offline   Reply With Quote
Old February 25th, 2007   #4
xp_newbie
Way Too Much Ubuntu
 
xp_newbie's Avatar
 
Join Date: Jun 2006
Beans: 282
Re: HOWTO: Solve VMWare sound (mixing?) problem once and for all

Quote:
Originally Posted by ssavelan View Post
http://en.wikipedia.org/wiki/VMware

I see, that is what I thought. Must you purchase such software?
Some versions are free, some are not. Check the VMWare web site. Also, there is the open source equivalent of VMWare, called Xen. Its only limitation is that currently if you want to emulate a Microsoft OS using Xen, you must have one of the latest CPUs that support virtualization in HARDWARE. Otherwise, you can run as many Linux VMs as you want under Xen (which itself runs under Linux).

HTH,
Alex
__________________
Ubuntu 6.06.1 LTS (Dapper Drake) running on:
> ASUS P4P800-E Deluxe (Promise 1+0 Stripe/RAID0)
Ubuntu 8.04 (Hardy Heron) running on:
> Lenovo 3000 N100 (type 0768, model 36U)
xp_newbie is offline   Reply With Quote
Old February 22nd, 2007   #5
dro0g
Just Give Me the Beans!
 
Join Date: Oct 2005
Beans: 71
Re: HOWTO: Solve VMWare sound (mixing?) problem once and for all

awesome walkthrough, thanks!
dro0g is offline   Reply With Quote
Old February 25th, 2007   #6
xp_newbie
Way Too Much Ubuntu
 
xp_newbie's Avatar
 
Join Date: Jun 2006
Beans: 282
Re: HOWTO: Solve VMWare sound (mixing?) problem once and for all

Quote:
Originally Posted by dro0g View Post
awesome walkthrough, thanks!
Glad you liked it. After getting so much from this virtual community, it was time for me to give something back.

Alex
__________________
Ubuntu 6.06.1 LTS (Dapper Drake) running on:
> ASUS P4P800-E Deluxe (Promise 1+0 Stripe/RAID0)
Ubuntu 8.04 (Hardy Heron) running on:
> Lenovo 3000 N100 (type 0768, model 36U)
xp_newbie is offline   Reply With Quote
Old March 11th, 2007   #7
jasonxh
5 Cups of Ubuntu
 
Join Date: Nov 2006
Beans: 32
Ubuntu 7.04 Feisty Fawn
Re: HOWTO: Solve VMWare sound (mixing?) problem once and for all

Nice HOWTO. However it doesn't apply to my vmware server directly, but with a little bit twist which I found from vmware forum. I point it out here in case anyone like me stumble upon this thread with a vmware server.

Instead of /usr/bin/vmware, I have to modify /usr/lib/vmware/bin/vmware-vmx (default installation path) to get it working, i.e.,
Code:
cd /usr/lib/vmware/bin
sudo mv vmware-vmx vmware-vmx.real
sudo echo '#!/bin/bash' > vmware-vmx
sudo echo 'LD_PRELOAD=libaoss.so exec /usr/lib/vmware/bin/vmware-vmx.real "$@"' >> vmware-vmx
sudo chmod +x vmware-vmx
Everything else is the same.
__________________
"Software systems are like cathedrals. First we build them and then we pray ..."
http://jasonxh.blogspot.com/

Last edited by jasonxh; June 29th, 2007 at 12:40 PM..
jasonxh is offline   Reply With Quote
Old March 18th, 2007   #8
mfarley
5 Cups of Ubuntu
 
Join Date: Mar 2006
Beans: 33
Re: HOWTO: Solve VMWare sound (mixing?) problem once and for all

Quote:
Originally Posted by jasonxh View Post
Nice HOWTO. However it doesn't apply to my vmware server directly, but with a little bit twist which I found from vmware forum. I point it out here in case anyone like me stumble upon this thread with a vmware server.

Instead of /usr/bin/vmware, I have to modify /usr/lib/vmware/bin/vmware-vmx (default installation path) to get it working, i.e.,
Code:
cd /usr/lib/vmware/bin
sudo mv vmware-vmx vmware-vmx.real
sudo echo "#!/bin/bash" > vmware-vmx
sudo echo "LD_PRELOAD=libaoss.so.0.0.0 exec /usr/lib/vmware/bin/vmware-vmx.real "$@"" >> vmware-vmx
sudo chmod +x vmware-vmx
Everything else is the same.
I tried everything in the original post and what you said -- no dice.

I can play audio in both the XP VM and the native Linux, just not simultaneously.

Any tips?
mfarley is offline   Reply With Quote
Old June 29th, 2007   #9
SirOracle
5 Cups of Ubuntu
 
Join Date: Feb 2006
Beans: 29
Re: HOWTO: Solve VMWare sound (mixing?) problem once and for all

Quote:
Originally Posted by jasonxh View Post
Nice HOWTO. However it doesn't apply to my vmware server directly, but with a little bit twist which I found from vmware forum. I point it out here in case anyone like me stumble upon this thread with a vmware server.

Instead of /usr/bin/vmware, I have to modify /usr/lib/vmware/bin/vmware-vmx (default installation path) to get it working, i.e.,
Code:
cd /usr/lib/vmware/bin
sudo mv vmware-vmx vmware-vmx.real
sudo echo "#!/bin/bash" > vmware-vmx
sudo echo 'LD_PRELOAD=libaoss.so exec /usr/lib/vmware/bin/vmware-vmx.real "$@"' >> vmware-vmx
sudo chmod +x vmware-vmx
Everything else is the same.
I don't get this to work, I use Feisty and VMware Server 1.0.3.
On the first echo-command I get this (I have double checked, the file has been renamed to vmware-vmx.real, and there is no wmare-vmx file):
Code:
sudo echo "#!/bin/bash" > vmware-vmx
bash: !/bin/bash": event not found
If I replace the double " with single ' I get this:
Code:
sudo echo '#!/bin/bash' > vmware-vmx
bash: vmware-vmx: Permission denied
I am however able to get the text in this way:
Code:
sudo gedit vmware-vmx
And paste in this code:
Code:
#!/bin/bash
LD_PRELOAD=libaoss.so exec /usr/lib/vmware/bin/vmware-vmx.real "$@"
But when I start a virtual machine I get this error:
Cannot open the disk '/var/lib/vmware/Virtual Machines/Windows/Windows.vmdk' or one of the snapshot disks it depends on.
Reason: File too large.

If I revert the changes, the virtual machines starts fine, except for the sound. Could someone please help me with this?
SirOracle is offline   Reply With Quote
Old June 29th, 2007   #10
jasonxh
5 Cups of Ubuntu
 
Join Date: Nov 2006
Beans: 32
Ubuntu 7.04 Feisty Fawn
Re: HOWTO: Solve VMWare sound (mixing?) problem once and for all

Oops, another quotation mistake... Since I actually used vim to edit the file, so the code was NOT tested...

Now I suggest you check permissions of libaoss.so, vmware-vmx.real and the newly created vmware-vmx. If you still can not figure it out, please attach the results here.
__________________
"Software systems are like cathedrals. First we build them and then we pray ..."
http://jasonxh.blogspot.com/
jasonxh is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:11 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry