Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

ERROR: vgl failed to start #1

Closed
ex0hunt opened this Issue · 33 comments

8 participants

@ex0hunt

When I emerge and run bumblebee. Get error this:

  • Caching service dependencies ... [ ok ]
  • Starting VirtualGL ... xauth: error in locking authority file (\S+)/ xauth: (argv):1: bad "add" command line [ !! ]
  • ERROR: vgl failed to start
  • ERROR: cannot start bumblebee as vgl would not start

Gentoo 3.2.1-gentoo-r2 x86_64
x11-misc/virtualgl-2.3-r1 from bumblebee-gentoo overlay
x11-misc/bumblebee-3.0 from bumblebee-gentoo overlay

@Nicias

I had the same issue. Go into /etc/conf.d/vgl and comment out the "common case" line and uncomment the line that matches your display manager.

@z0rr0

Edit /etc/conf.d/vgl does not solve the problem, in my case.

@ex0hunt

@z0rr0, try to add XAUTHORITY="$(python /opt/vglparse.py)" in /etc/conf.d/vgl and comment another "XAUTHORITY" strings.
Download this script http://pastebin.com/CW2Z7p2X and move to /opt/vglparse.py

It's ugly hack, but it's works for me:)

@z0rr0

Thanks, it works well.

@msva
Collaborator

Hi guys, sorry for long unavailability :( :(
z0rr0, can you tell me, what is you DM?
fang90, O_o Maybe let's think about "coreutils"
z0rr0, can you tell me, what is you DM?
fang90, O_o Maybe let's think about "coreutils" variant instead of python/find/perl/sed magic? :)

@ex0hunt

@msva yep, of course. My solution with python is not better:).
Another way for Gnome3(gdm ver 3.2.1.1-r2) may use this XAUTHORITY="/var/run/gdm/auth-for-gdm-*/database" string in /etc/conf.d/vgl.

@Reinis
Collaborator

Yes, gdm for Gnome 2 and 3 have different -auth parameters for Xorg, I came up with this for the later:
XAUTHORITY="$(ps -C Xorg -o args= | grep -o /var/run/gdm/auth-for-gdm-.*/database)"
but this ps command doesn't work on stable systems and the fang90's solution obviously is much nicer. Only question might be if it needs to check for multiple Xorg instances.

@Reinis
Collaborator

It would be good to add message in ebuild for users to check /etc/conf.d/vgl and in that conf file add comments to help users set up XAUTHORITY for their system, e.g., say to check Xorg parameter -auth with 'ps wwaux | grep [-]auth' for idea how to construct the variable.

@ex0hunt

@Reinis I thought about multiple Xorg instances and found another solution
ps wwwaux | grep -o "/var/run/gdm/auth-for-gdm-[0-Z]/[a-Z]"

correct command: http://pastebin.com/RQ00TH0h

@Reinis
Collaborator

@fang90 I don't think it is any better then previous versions. Moreover, I don't think that "/database" part changes. In case of multiple Xorg instances only one should be used for setting XAUTHORITY. Which one, that depends on the system. A good guess might be the one which started first:
XAUTHORITY="$(ps -C Xorg -o args= --sort=-stime | grep -o /var/run/gdm/auth-for-gdm-.*/database | head -1)"
or simpler:
XAUTHORITY="$(ls -tr1 /var/run/gdm/auth-for-gdm-*/database | head -1)"

Alternatively we could select the instance based on the $DISPLAY it is running on.

@ex0hunt

may be this a more flexible solution:
ps wwwaux | grep Xorg | grep -o "/var[^[:space:]]*auth[^[:space:]]*"

@Reinis
Collaborator

@fang90 if you want to use one expression for Gnome 2 and 3 then it wouldn't work, but this would:
ps wwwaux | grep '\b/usr/bin/\(X\|Xorg\)\b' | grep -o '/var[^[:space:]]*auth[^[:space:]]*'

Still it could be improved, e.g. 'wwwu' for ps command could be replaced with '-o args=':
ps ax -o args= | grep '^/usr/bin/\(X\|Xorg\)\b' | grep -o '/var/\S*auth\S*'

And to ensure that we take only one line:
ps ax -o args= --sort=-stime | grep -m 1 '^/usr/bin/\(X\|Xorg\)\b' | grep -o '/var/\S*auth\S*'

@Reinis
Collaborator

Ok, just realized why my command with ps -C didn't work on stable system :D
This works for both (gdm on ~arch and arch):
ps -C X,Xorg -o args= --sort=-stime | grep -m 1 -o '/var/\S*auth\S*'

This is the shortest and simplest variant so far :)
But I'm not sure if that isn't too general and hence a security risk. It is possible to make the regexp more specific but that obfuscates it quite a bit, tough a little better situation is if we use extended regexps for grep:
ps -C X,Xorg -o args= --sort=-stime | grep -E -m 1 -o "\B/var/(run/)?gdm/(${DISPLAY}\.X)?auth(-for-gdm-.*/database)?\b"

Maybe better is this variant which makes sure that we get the argument of -auth flag:
ps ww -C X,Xorg -o args= --sort=-stime | grep -m 1 -o '\B[-]auth\s*/var/\S*auth\S*' | cut -d ' ' -f 2

@msva
Collaborator
@Reinis
Collaborator

@msva Does the last command work also for KDM? I think that is the best from the variants we discussed so far

  • It adds 'ww' to ensure that we get the full command line for X (-o args= still didn't gave the full width for output)
  • Takes the auth parameter from the oldest X instance running
  • Puts exactly one parameter in XAUTHORITY
  • Makes sure it gets the parameter from -auth argument of X
  • Works for GDM with ~arch and arch (and probably KDM also)

ps ww -C X,Xorg -o args= --sort=-stime | grep -m 1 -o '\B[-]auth\s*/var/\S*auth\S*' | cut -d ' ' -f 2

@msva
Collaborator

yep, it works brilliant.
But I have one improvement:
ps ww -C X,Xorg -o args= --sort=-stime | grep -m 1 -o '\B[-]auth\s/var/run/\Sauth\S*' | cut -d ' ' -f 2

(it adds "run" to path in /var, since all the time X's auth is in /var/run )

So, if you agree with my improvement — I'll commit it in repo.

@Reinis
Collaborator

No, it is not always in /var/run. On stable GDM it is in /var/gdm/:0.Xauth. Thats why in the last before that version where I used grep with extended regexp the /run part was marked with ? (zero or one times).

@msva
Collaborator

okay

@msva msva closed this
@satellitexf

gentoo 3.2.12 x86_64
virtualgl-2.3-r1
In /etc/conf.d/vgl :
XAUTHORITY="$(ps ww -C X,Xorg -o args= --sort=-stime | grep -m 1 -o '\B[-]auth\s/var/\Sauth\S*' | cut -d ' ' -f 2)"
when i start virtualgl,the output:
Caching service dependencies ... [ ok ]
Starting VirtualGL ...
xauth: (argv):1: bad "add" command line [ !! ]
ERROR: vgl failed to start

when i run (ps ww -C X,Xorg -o args= --sort=-stime | grep -m 1 -o '\B[-]auth\s/var/\Sauth\S*' | cut -d ' ' -f 2) in a terminal, the output is "/var/lib/xdm/authdir/authfiles/A:0-f67v6a"

@Reinis
Collaborator

Which login manager are you using? Are you using virtualgl from bumblebee overlay or from the main tree? Have you updated configuration files (with dispatch-conf or etc-update) after emerging virtualgl?

@satellitexf

Thanks for Reinis!
my dm is xdm
I install virtualgl-2.3-r1 from bumblebee-gentoo.
I have installed virtualgl-2.3 via emerging in gentoo,but it don't work, the error is same.
so I install virtualgl-2.3-r1, after downloading the bumblebee-gentoo in this site.
I updated configuration use dispatch-conf each time.

@Reinis
Collaborator

If you are using ebuilds from here, you don't have to download them, you can use layman, to add this overlay:

# layman -a bumblebee

Check if the file which is reported by ps ww -C X,Xorg -o args= --sort=-stime | grep -m 1 -o '\B[-]auth\s/var/\S*auth\S' | cut -d ' ' -f 2 exists.
I presume you are using openrc as your init system. Do you start vgl service as part of boot process or manually by running /etc/init.d/vgl start?

@satellitexf

I reinsatll virtualgl-2.3-r1, the errors is the same.
the file which is reported by the command exist.
ps wwax -C X,Xorg -o args= --sort=-stime | grep -m 1 -o '\B[-]auth\s/var\Sauth\S*' | cut -d ' ' -f 2
/var/lib/xdm/authdir/authfiles/A:0-AjmSOz
I use openrc-0.9.8.4
I both try to start vgl service by setting the boot process or manually start. the output is:
xauth: (argv):1: bad "add" command line

@Reinis
Collaborator

What is the output of the following command?

xauth -f $(ps wwax -C X,Xorg -o args= --sort=-stime | grep -m 1 -o '\B[-]auth\s*/var\S*auth\S*' | cut -d ' ' -f 2) list
@satellitexf

#ffff##: XDM-AUTHORIZATION-1 4a2b2dbbb2752547004f578134b2c3e5
#ffff##: MIT-MAGIC-COOKIE-1 10e46337bf8fc22af8b5c7337f3ac7d1

@Reinis
Collaborator

Try editing /etc/init.d/vgl this line

xauth -f /etc/VirtualGL/vgl_xauth_key add $DISPLAY . `xauth -f $XAUTHORITY list | awk '{print $3}'` && \

to this:

xauth -f /etc/VirtualGL/vgl_xauth_key add $DISPLAY . `xauth -f $XAUTHORITY list | tail -1 | awk '{print $3}'` && \

And see if it works.

@satellitexf

thanks! It works. vgl service start.

@Reinis
Collaborator

Does bumblebee service also starts successfully and are you able to run applications with it using optirun program_name?

@satellitexf

yes,bumblebee daemon starts, I success to run with using optirun glxspheres. The result show:
$ glxspheres
Polygons in scene: 62464
Visual ID of window: 0x9f
Context is Direct
OpenGL Renderer: Mesa DRI Intel(R) Sandybridge Mobile
59.987886 frames/sec - 55.044884 Mpixels/sec

$ optirun glxspheres
Polygons in scene: 62464
Visual ID of window: 0x21
Context is Direct
OpenGL Renderer: GeForce GT 550M/PCIe/SSE2
109.808281 frames/sec - 100.760079 Mpixels/sec

@Lekensteyn Lekensteyn referenced this issue in Bumblebee-Project/Bumblebee
Closed

Could not enable discrete graphics card on Gentoo #265

@joaocarlos

I'm running gentoo with sources 3.5.
I can run optirun as root user normaly, but when I try to launch any application as normal user it keeps giving me:

[VGL] ERROR: Could not open display :1.

I tryed some random solutions posted here but none of them change my situation.
I aready did tried to change de XAUTHORITY on vlg conf to the kdm sugestion, and also change to some custom commands posted here.

Is there anything else that I could do?

@msva
Collaborator

and how do you run Xorg?

@satellitexf

slim+openbox

@BlGene

I am not running xdm or any display manager, I had to do the following:
change /etc/conf.d/vgl from
XAUTHORITY="$(ps wwax -C X,Xorg -o args= --sort=-stime | grep -m 1 -o '\B[-]auth\s/var\Sauth\S' | cut -d ' ' -f 2)"
to
XAUTHORITY="$(ps wwax -C X,Xorg -o args= --sort=-stime | grep -m 1 -o '\B[-]auth\s
/home\Sauth\S' | cut -d ' ' -f 2)"

and change /etc/init.d/vgl
from
xauth -f /var/lib/VirtualGL/vgl_xauth_key add $DISPLAY . 'xauth -f $XAUTHORITY list | awk '{print $3}' && \
to
xauth -f /var/lib/VirtualGL/vgl_xauth_key add $DISPLAY . 'xauth -f $XAUTHORITY list |grep $DISPLAY| awk '{print $3}'` && \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.