LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-31-2017, 11:50 AM   #1
X.LINK
LQ Newbie
 
Registered: May 2017
Posts: 7

Rep: Reputation: Disabled
Unhappy Pulseaudio crashes when a virtual machine is started


/!\ The problem has changed, libpam-systemd is the real problem now.

You may directly go to this post, which will explain everything:

http://www.linuxquestions.org/questi...4/#post5718268

/!\



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:
Code:
chown standardUser /run/user/1000/pulse/ && chgrp standardUser /run/user/1000/pulse/
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.

Last edited by X.LINK; 06-02-2017 at 10:14 AM.
 
Old 05-31-2017, 01:00 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6051Reputation: 6051Reputation: 6051Reputation: 6051Reputation: 6051Reputation: 6051Reputation: 6051Reputation: 6051Reputation: 6051Reputation: 6051Reputation: 6051
you don't use sudo to start virtualbox.
if the error still occurs when you start it as a normal user, we'll talk.
 
Old 05-31-2017, 06:19 PM   #3
X.LINK
LQ Newbie
 
Registered: May 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
/!\ The problem has changed, libpam-systemd is the real problem now.

You may directly go to this post, which will explain everything:

http://www.linuxquestions.org/questi...4/#post5718268

/!\



This post is kept for history purposes:

Code:
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" :
Code:
I: [pulseaudio] client.c: Created 1 "Native client (UNIX socket client)"
D: [pulseaudio] protocol-native.c: Protocol version: remote 29, local 29
I: [pulseaudio] protocol-native.c: Got credentials: uid=0 gid=0 success=0
W: [pulseaudio] protocol-native.c: Denied access to client with invalid authorization data.
I: [pulseaudio] client.c: Freed 1 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Connection died.
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 ?

Last edited by X.LINK; 06-02-2017 at 10:14 AM.
 
Old 05-31-2017, 06:52 PM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Quote:
Originally Posted by X.LINK View Post
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:
Code:
chown standardUser /run/user/1000/pulse/ && chgrp standardUser /run/user/1000/pulse/
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.
 
1 members found this post helpful.
Old 05-31-2017, 07:58 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,772

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
I'm still trying to figure out why you are running a vm under gksu.
I doubt it is a well tested way. Bugs could creep in.

Guesses are memory issues usually. lack or ram or memory leaks or ideas above about pulse audio.
 
1 members found this post helpful.
Old 06-01-2017, 06:03 PM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Try
Code:
$ dpkg-reconfigure libpam-systemd
 
1 members found this post helpful.
Old 06-02-2017, 06:07 AM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
you don't use sudo to start virtualbox.
if the error still occurs when you start it as a normal user, we'll talk.
Look at the orignal
Code:
grep ^Exec  /usr/share/applications/virtualbox.desktop 
Exec=VirtualBox %U
Exec=VirtualBox
No gksu. Unless you've edited that also?

If you are running Vbox as root to overcome some limitation, you are doing something wrong.

Try
Code:
evince /usr/share/doc/virtualbox-5.1/UserManual.pdf
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

Stop messing around.
Have a Great Day!
 
Old 06-02-2017, 07:22 AM   #8
X.LINK
LQ Newbie
 
Registered: May 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Things got -almost- better after these fixes:

- /etc/pulse/default.pa got appended:
Code:
module-native-protocol-unix auth-anonymous=1
module-native-protocol-tcp auth-anonymous=1 auth-ip-acl=127.0.0.1
- /etc/pulse/client.conf also got appended:
Code:
default-server = 127.0.0.1
- 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 View Post
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 View Post
I'm still [...] pulse audio.
It sure isn't a well tested. You were right about bugs above Pulseaudio.

Quote:
Originally Posted by AwesomeMachine View Post
Try
Code:
$ dpkg-reconfigure libpam-systemd
It didn't solved the problem, but you made me hit the right spot. Thanks !

Last edited by X.LINK; 06-02-2017 at 10:18 AM.
 
Old 06-02-2017, 07:25 AM   #9
X.LINK
LQ Newbie
 
Registered: May 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
/!\ If you're not Habitual, you may ignore that post and go directly for the next one /!\

Code:
Quote:
Originally Posted by Habitual View Post
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!

Last edited by X.LINK; 06-02-2017 at 10:31 AM.
 
Old 06-02-2017, 08:27 AM   #10
X.LINK
LQ Newbie
 
Registered: May 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
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:

https://bugs.debian.org/cgi-bin/bugr...cgi?bug=732209 -> The bug is still here in 2017, even on Systemd 232

http://forums.debian.net/viewtopic.php?f=10&t=110035

https://bugs.debian.org/cgi-bin/pkgr...libpam-systemd

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.

Last edited by X.LINK; 06-02-2017 at 07:16 PM.
 
Old 06-02-2017, 05:15 PM   #11
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Quote:
Originally Posted by AwesomeMachine View Post
Try
Code:
$ dpkg-reconfigure libpam-systemd
You could at least try this, since more than one person has commented that it is the cause.
 
Old 06-02-2017, 05:58 PM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by X.LINK View Post
/!\ If you're not Habitual, you may ignore that post and go directly for the next one /!\
You may not like my answers, you may not like my IDK what,
but I don't see you telling anyone in http://forums.debian.net/viewtopic.php?f=10&t=133301 who and who can't or shouldn't read this or that.

Show some respect. It starts with Common Courtesy.

Don't be mad because people on 2 forums ask "why you run Vbox as root?".

You're welcome.
Bye.
 
Old 06-02-2017, 06:45 PM   #13
X.LINK
LQ Newbie
 
Registered: May 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
/!\ If you're not Habitual, you may ignore that post and go for the next one /!\

Quote:
Originally Posted by Habitual View Post
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.

Bye.

Last edited by X.LINK; 06-02-2017 at 07:21 PM.
 
Old 06-02-2017, 06:48 PM   #14
X.LINK
LQ Newbie
 
Registered: May 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AwesomeMachine View Post
You could at least try this, since more than one person has commented that it is the cause.
Sorry if I wasn't clear in my answer. :/

I did have tried the command right after you mentionned it, but it didn't fixed libpam-systemd.

Last edited by X.LINK; 06-02-2017 at 06:58 PM.
 
Old 06-02-2017, 09:18 PM   #15
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
You win.

Enjoy your toaster.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to : Open Virtual Machine Manager to create a new virtual machine BKChicago Linux - Newbie 2 11-08-2016 09:48 PM
Bypass pulseaudio problems and crashes when you don't have pulseaudio. Rinndalir Linux - Software 1 08-31-2016 01:00 PM
Is base memory of virtual machine used when virtual machine is not running? ravisingh1 Linux - Virtualization and Cloud 3 04-09-2013 03:41 AM
Winecfg crashes on sound tab with Pulseaudio and no 'sounddrivers' without pulseaudio William (Dthdealer) Linux - Software 5 06-13-2010 07:30 AM
Running virtual pc files in a virtual machine in linux ... preferably virtual box biharibong Linux - Software 4 01-21-2009 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration