Pulseaudio crashes when a virtual machine is started
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Here's the original problem, for history purposes:
Code:
Hi all,
I've noticed that everytime I start a virtual machine from VirtualBox using "gksu virtualbox %U", Pulseaudio do always crash.
Right after that, VirtualBox says:
Quote:
No audio devices could be opened. Selecting the NULL audio backend with the consequence that no sound is audible.
and
Quote:
HostAudioNotResponding
However, the syslog doesn't say much about the crash:
Quote:
May 31 18:18:58 HostName pulseaudio[3466]: [autospawn] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
May 31 18:18:58 HostName pulseaudio[3466]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
May 31 18:18:58 HostName pulseaudio[3466]: [pulseaudio] main.c: Failed to acquire autospawn lock
May 31 18:18:59 HostName pulseaudio[3471]: [autospawn] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
May 31 18:18:59 HostName pulseaudio[3471]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
May 31 18:18:59 HostName pulseaudio[3471]: [pulseaudio] main.c: Failed to acquire autospawn lock
May 31 18:18:59 HostName pulseaudio[3473]: [autospawn] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
May 31 18:18:59 HostName pulseaudio[3473]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
May 31 18:18:59 HostName pulseaudio[3473]: [pulseaudio] main.c: Failed to acquire autospawn lock
May 31 18:18:59 HostName pulseaudio[3475]: [autospawn] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
May 31 18:18:59 HostName pulseaudio[3475]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
May 31 18:18:59 HostName pulseaudio[3475]: [pulseaudio] main.c: Failed to acquire autospawn lock
May 31 18:18:59 HostName pulseaudio[3478]: [autospawn] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
May 31 18:18:59 HostName pulseaudio[3478]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
May 31 18:18:59 HostName pulseaudio[3478]: [pulseaudio] main.c: Failed to acquire autospawn lock
May 31 18:19:00 HostName pulseaudio[3483]: [autospawn] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
May 31 18:19:00 HostName pulseaudio[3483]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
May 31 18:19:00 HostName pulseaudio[3483]: [pulseaudio] main.c: Failed to acquire autospawn lock
May 31 18:19:09 HostName pulseaudio[3488]: [autospawn] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
May 31 18:19:09 HostName pulseaudio[3488]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
May 31 18:19:09 HostName pulseaudio[3488]: [pulseaudio] main.c: Failed to acquire autospawn lock
May 31 18:19:09 HostName pulseaudio[3490]: [autospawn] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
May 31 18:19:09 HostName pulseaudio[3490]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
May 31 18:19:09 HostName pulseaudio[3490]: [pulseaudio] main.c: Failed to acquire autospawn lock
May 31 18:19:17 HostName pulseaudio[3496]: [autospawn] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
May 31 18:19:17 HostName pulseaudio[3496]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
May 31 18:19:17 HostName pulseaudio[3496]: [pulseaudio] main.c: Failed to acquire autospawn lock
May 31 18:19:18 HostName pulseaudio[3498]: [autospawn] core-util.c: Failed to create secure directory (/run/user/1000/pulse): Permission denied
May 31 18:19:18 HostName pulseaudio[3498]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
May 31 18:19:18 HostName pulseaudio[3498]: [pulseaudio] main.c: Failed to acquire autospawn lock
May 31 18:20:28 HostName pulseaudio[1847]: [pulseaudio] protocol-native.c: Denied access to client with invalid authorization data.
Since it only says that Pulseaudio can't get restarted since the `/run/user/1000/pulse/` got the infamous bug of being owned by root.
Which I simply fixed with:
But, still, no sign of what could have made crash Pulseaudio.
So the question is: What's making Pulseaudio crash and how to prevent it ?
Everything was done on an updated Debian 8.7 with the stock KDE desktop environment.
Thanks for answering.
There is some cases that requires me to run VirtualBox on root, since there is some resources I can't access at all without.
Things worked well under Wheezy, but I can't see why it doesn't now on Jessie.
On the other side, after a lot of try and guesses, I got some improvements by editing the /etc/pluse/default.pa file.
By enabling these Pulseaudio modules:
- module-alsa-sink
- module-oss device="/dev/dsp" sink_name=output source_name=input
Doing a modeprobe of: snd-pcm-oss
And disabling these modules:
- module-esound-protocol-unix
- module-suspend-on-idle
There is almost no bug at all (still got the VirtualBox one and the infamous pulse folder owned by root though), except this one I got from syslog:
Code:
May 31 22:09:11 HostName pulseaudio[3376]: Trying resume...
May 31 22:09:11 HostName pulseaudio[3376]: open '/dev/snd/pcmC0D0p' failed (-16)
May 31 22:09:11 HostName pulseaudio[3376]: Error opening PCM device front:0: Device or resource busy
May 31 22:09:11 HostName pulseaudio[3376]: Using generic matrix remapping
And this one since I manually started Pulseaudio by doing "pulseaudio -vvvv" :
Still, I can't understand why the "/dev/snd/pcmC0D0p" error comes, and why it's apparently a permission problem.
Apart from syslog and running Pulseaudio with ultra verbose mode, I do not know how I can track what's happening to Pulseaudio.
Is there any way I can provide more information about that crash ?
But, still, no sign of what could have made crash Pulseaudio.
Normally the owner change on a user means that pulse was running as the user, and ROOT issued the pulseaudio --kill or pulseaudio --start command. You'd have to look at the sources or strace or such to figure out if that's actually happening. But I trigger and fix that all the time when I'm fiddling and oopsies in the wrong terminal. But I have autospawn=no and switch between alsa, jack, pulse, and even pulse over jack depending on what I'm doing.
If you only start in this manner and never test the default, how will you know?
and the "infamous bug"? from 2013?
Never seen so much goose-stepping over procedural error.
Don't run Virtualbox as root. Period.
IF it was meant to run as root, /usr/share/applications/virtualbox.desktop would have been configured to do so
- However, "modprobe snd-pcm-oss" is still needed.
Everything related to Pulseaudio worked, even vmware didn't complained about not getting /dev/dsp (only works with `modprobe snd-pcm-oss`). No errors were found by Pulseaudio -vvvv or /var/log/syslog/ .
Unfortunately, sound is still missing while Pulseaudio is working perfectly.
Furthermore, I also tried to run Pulseaudio in system-mode; but things didn't get any better and the problem was the same.
But, thanks to the following quoted posts, the problem seems to be libpam-systemd.
Quote:
Originally Posted by Shadow_7
Normally [...] I'm doing.
After the right above fixes -and without system mode-, pulseaudio was started with "pulseaudio -vvvv" by a standard user; but /run/user/1000/pulse still become owned by root.
Considering what you said, this is plain weird; something above Pulseaudio must overrides that... which is libpam-systemd.
Quote:
Originally Posted by jefro
I'm still [...] pulse audio.
It sure isn't a well tested. You were right about bugs above Pulseaudio.
Quote:
Originally Posted by AwesomeMachine
Try
Code:
$ dpkg-reconfigure libpam-systemd
It didn't solved the problem, but you made me hit the right spot. Thanks !
/!\ If you're not Habitual, you may ignore that post and go directly for the next one /!\
Code:
Quote:
Originally Posted by Habitual
Look at the orignal [...]
Have a Great Day!
Thanks for answering, in the same order:
- I've launched virtualbox and vmware through a terminal.
- Why ? Is there any other ways ? Then how ? Any hints on where I can search ?
- I did, they also said sometimes you need to run virtualbox in true root: Pages 91, 95, 100, 231
- I've tested the default way, but it didn't worked; that's why I've switched to "gksu virtualbox %U"
- The bug is infamous, and spread enough over the internet:
http://forums.debian.net/viewtopic.php?f=10&t=110035 -> I also got this bug with "gksu gedit", and applied the same fixes.
- That bug is still true, even in 2017 on Debian Stretch in its current pre-release state: https://bugs.debian.org/cgi-bin/bugr...cgi?bug=732209
- So how am I then supposed to do my first researches ? I'm trying my best to not be a Help Vampire and do my part.
Thus such a trial and error procedure of finding what could have happenend.
If there is a Debian or better way to track a bug, or steps that should be made other than going through /var/log/syslog; which one only stated about pulseaudio errors, I'll gladly listen.
- evince /usr/share/doc/virtualbox-5.1/UserManual.pdf -> Please read pages 91, 95, 100, 231.
I would then not be as categoric as you were, period.
If virtualbox may be run on root and errors comes, it's still a bug. A systemd one that is confirmed in Debian's bug tracking.
- Same as previous point.
Something that was configured on a certain way doesn't mean it has to always be that way. Otherwise free software wouldn't even exists... same goes for Linux.
- Why being so condescendant ?
- Not very effective, that can even be considered as some people as sarcasm.
Frankly; since you're not Theo de Raadt or any OpenBSD guy, I do admit that your behaviour isn't logical, and resurfaces a negative and deprecated view people got on Linux, which is the infamous "RTFM Noob". Even worse, you did that, In 2017.
Also, the "Linux - Newbie" mention of this section has a meaning, and a good one.
If you're feeling angry or something like that because you can't handle exactly the same tone you were the first to sow, blaming me isn't the solution nor the right and is a counter-productive way of doing things.
Have a Great Day!
Anyway, it seems that the main problem was about /run/user/1000/pulse getting owned by root, and means the real problem is that infamous bug.
After some research, I found out that libpam-systemd is causing that. This is a known bug that Debian got from Systemd, which has been reported for Debian Stable, Testing (Stretch) and Experimental:
Concerning the 2nd link, I also confirm the "gksu gedit" problem, which I also applied the same workaround.
The problem seems unsolved, at least until the Debian Stable maintainers do update libpam-systemd.
On the other side, I've sent a bug report to them.
Also, to the other people that may read this, I recommend people facing this bug too to still report this bug again, so they can get a true confirmation.
Moreover, if anyone knows how to fix that bug in the meantime, I would gladly listen to any solution and even hints.
This also includes recompiling libpam-systemd as a deb. (I don't know how to do it properly, in the Debian way of packing software. I tried it in the past but it was unsuccessful), any hint is welcome.
/!\ If you're not Habitual, you may ignore that post and go for the next one /!\
Quote:
Originally Posted by Habitual
Blah
When you'll stop seeing yourself as an IDK god of whatever, you'll start to understand why:
- I didn't get "mad" on debian forums (Hint: because they weren't condescending)
- I didn't get "mad" at ondoho even if she asked the same question (Hint: she wasn't condescending in her answer)
- I got offended by your condescending behaviour (Hint: read your first post again, and again)
- I used the very same condescendence you used, on yourself; to make you understand what you're doing to others through their perspective. But then show you can't even handle that.
- I got to tremendously laugh when you talked about Respect through Common Courtesy; while you were the very first one to lack of (hint: with your condescendence). And even more when you were desperately trying to reject that on me.
You'll understand.
But hey, better lose your own time by "helping others", then even lose more time because you were at the very first counter productive right ?
So if you got time to lose, this is not the place to do it. Because I don't have time for non-serious business like yours.
"Don't do things to others that you can't even handle by yourself". And this has a name: The Golden Rule. (learn it)
And if by any means you still don't understand why, try using the same tone in real life.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.