Skip to content

Commit b0552dc

Browse files
committed
Server: Don't disable Wayland; Use Display :1024
On modern Linux distributions, GDM runs Xwayland on Display :1024 if WaylandEnable=true (the default), and it runs Xorg on Display :0 if WaylandEnable=false. Referring to aa5ff87 and #94, in 2019 I observed that it was necessary on RHEL 8 and Fedora 27-28 to add/uncomment WaylandEnable=false in order for VirtualGL's greeter autostart script to work. However, that is apparently no longer necessary. In 2025, using Display :1024 seems to work fine on RHEL 7-10, Ubuntu 16-24, Fedora 40-42, and openSUSE 15. (In fact, it is necessary on RHEL 10, since GDM no longer allows Wayland to be disabled. That is what prompted this change.)
1 parent 37e4efd commit b0552dc

File tree

6 files changed

+69
-104
lines changed

6 files changed

+69
-104
lines changed

ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ in the VirtualGL User's Guide for more information.
1212
enabling quad-buffered stereo, even if the requirements for quad-buffered
1313
stereo had been met.
1414

15+
3. On Wayland-enabled Linux systems running GDM, `vglserver_config` no longer
16+
disables the ability to log in locally with a Wayland session. Instead,
17+
`vglrun` automatically sets `VGL_DISPLAY` to `:1024` if `VGL_DISPLAY` is unset,
18+
X Display :1024 exists, and X Display :0 does not exist. This allows VirtualGL
19+
to use the GDM greeter's Xwayland instance as a 3D X server.
20+
1521

1622
3.1.3
1723
=====

doc/advancedconfig.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,26 @@ previous method:
119119
| Summary | __''{d}''__ = the X display/screen or EGL device to use for 3D \
120120
rendering |
121121
| Image Transports | All |
122-
| Default Value | '':0'' |
122+
| Default Value | '':0'' or '':1024'' |
123123
#OPT: hiCol=first
124124

125125
Description :: If the VirtualGL server has multiple GPUs, then you can use
126126
this option to specify which GPU should be used for 3D rendering. For
127127
instance, setting ''VGL_DISPLAY'' to (or invoking ''vglrun -d'' with)
128128
'':0.1'' would cause VirtualGL to use the GLX back end and redirect all of
129129
the OpenGL rendering from the 3D application to a GPU attached to Screen 1 on
130-
X display :0. Setting ''VGL_DISPLAY'' to (or invoking ''vglrun -d'' with)
130+
X Display :0. Setting ''VGL_DISPLAY'' to (or invoking ''vglrun -d'' with)
131131
a DRI device path (such as ''/dev/dri/card0'') or an EGL device ID (such as
132132
''egl0'') would cause VirtualGL to use the EGL back end and redirect all of
133133
the OpenGL rendering from the 3D application to the specified EGL device.
134134
''/opt/VirtualGL/bin/eglinfo -e'' lists all valid EGL device IDs and their
135135
associated DRI device paths.
136136

137+
!!! ''vglrun'' automatically sets ''VGL_DISPLAY'' to '':1024'' if
138+
''VGL_DISPLAY'' is unset, X Display :1024 exists, and X Display :0 does not
139+
exist. This allows VirtualGL to use the GDM greeter's Xwayland instance as a
140+
3D X server.
141+
137142
| Environment Variable | {pcode: VGL_EGLLIB = __{l}__ } |
138143
| Summary | __''{l}''__ = the location of an alternate EGL library |
139144
| Image Transports | All |

doc/index.html

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
55
<meta name="language" content="en">
6-
<meta name="date" content="2025-07-01T12:15:57">
6+
<meta name="date" content="2025-10-07T13:56:21">
77
<meta name="generator" content="deplate.rb 0.8.5">
88
<title>User&rsquo;s Guide for VirtualGL 3.1.4</title>
99
<link rel="start" href="index.html" title="Frontpage">
@@ -921,10 +921,6 @@ <h2 id="hd006001">6.1&nbsp;Initial System Configuration</h2>
921921
and 3D X server at boot time. This is the default with most modern
922922
Linux and Unix distributions.</p>
923923

924-
<div class="important"><p class="important">
925-
On Wayland-enabled Linux machines running GDM, configuring the machine for use with the GLX back end will disable the ability to log in locally with a Wayland session. In general, logging in locally once the machine has been configured for use with the GLX back end is discouraged, as this could disrupt VirtualGL&rsquo;s connection to the 3D X server and thus cause OpenGL applications running with VirtualGL to abort or freeze.
926-
</p></div>
927-
928924
<p>3. Accelerated OpenGL is working properly in the 3D X server.</p>
929925

930926
<ul class="Itemize">
@@ -969,8 +965,10 @@ <h2 id="hd006002">6.2&nbsp;GLX Back End: Granting Access to the 3D X Server</h2>
969965
need to use the GLX back end. Unless you fully trust the users to whom
970966
you are granting this access, then you should avoid logging in locally
971967
to the 3D X server (particularly as root) unless absolutely necessary.
972-
(Logging in locally to the 3D X server is discouraged anyhow, for
973-
reasons explained in the previous section.)</p>
968+
(In general, logging in locally once the machine has been configured for
969+
use with the GLX back end is discouraged, as this could disrupt
970+
VirtualGL&rsquo;s connection to the 3D X server and thus cause OpenGL
971+
applications running with VirtualGL to abort or freeze.)</p>
974972

975973
<p>This section will explain how to configure a VirtualGL server such that
976974
selected users can use the GLX back end, even if the server is sitting
@@ -1166,27 +1164,26 @@ <h3 id="hd006002001">6.2.1&nbsp;Sanity Check</h3>
11661164
<dl class="Description">
11671165
<dt class="Description-1 Description">If you restricted 3D X server access to <code>vglusers</code></dt>
11681166
<dd class="Description-1 Description">
1169-
<pre class="verbatim">
1170-
xauth&nbsp;merge&nbsp;/etc/opt/VirtualGL/vgl_xauth_key
1171-
xdpyinfo&nbsp;-display&nbsp;:0
1172-
/opt/VirtualGL/bin/glxinfo&nbsp;-display&nbsp;:0&nbsp;-c
1173-
</pre>
1174-
11751167
</dd>
1168+
</dl>
1169+
1170+
<pre class="verbatim">xauth merge /etc/opt/VirtualGL/vgl_xauth_key
1171+
xdpyinfo -display :<em>n</em>
1172+
/opt/VirtualGL/bin/glxinfo -display :<em>n</em> -c</pre>
1173+
<dl class="Description">
11761174
<dt class="Description-1 Description">If you did not restrict 3D X server access</dt>
11771175
<dd class="Description-1 Description">
1178-
<pre class="verbatim">
1179-
xdpyinfo&nbsp;-display&nbsp;:0
1180-
/opt/VirtualGL/bin/glxinfo&nbsp;-display&nbsp;:0&nbsp;-c
1181-
</pre>
1182-
11831176
</dd>
11841177
</dl>
11851178

1186-
<p>Both commands should output a list of visuals and should complete with
1187-
no errors. If you chose to disable the <code>XTEST</code> extension,
1188-
then check the output of the <code>xdpyinfo</code> command to verify
1189-
that <code>XTEST</code> does not show up in the list of extensions.</p>
1179+
<pre class="verbatim">xdpyinfo -display :<em>n</em>
1180+
/opt/VirtualGL/bin/glxinfo -display :<em>n</em> -c</pre>
1181+
<p>(where <em><code>n</code></em> is the display number of the 3D X
1182+
server.) Both commands should output a list of visuals and should
1183+
complete with no errors. If you chose to disable the <code>XTEST</code>
1184+
extension, then check the output of the <code>xdpyinfo</code> command to
1185+
verify that <code>XTEST</code> does not show up in the list of
1186+
extensions.</p>
11901187

11911188
<p>You should also examine the output of the <code>glxinfo</code> command
11921189
to ensure that at least one of the visuals is 24-bit or 32-bit TrueColor
@@ -3103,7 +3100,7 @@ <h2 id="hd0018001">18.1&nbsp;Faker Settings</h2>
31033100
</tr>
31043101
<tr class="standard">
31053102
<td class="high standard">Default Value</td>
3106-
<td class="standard"><code>:0</code></td>
3103+
<td class="standard"><code>:0</code> or <code>:1024</code></td>
31073104
</tr>
31083105
</table>
31093106
</div>
@@ -3118,13 +3115,16 @@ <h2 id="hd0018001">18.1&nbsp;Faker Settings</h2>
31183115
<code>vglrun&nbsp;-d</code> with) <code>:0.1</code> would cause
31193116
VirtualGL to use the GLX back end and redirect all of the OpenGL
31203117
rendering from the 3D application to a GPU attached to Screen 1 on X
3121-
display :0. Setting <code>VGL_DISPLAY</code> to (or invoking
3118+
Display :0. Setting <code>VGL_DISPLAY</code> to (or invoking
31223119
<code>vglrun&nbsp;-d</code> with) a DRI device path (such as
31233120
<code>/dev/dri/card0</code>) or an EGL device ID (such as
31243121
<code>egl0</code>) would cause VirtualGL to use the EGL back end and
31253122
redirect all of the OpenGL rendering from the 3D application to the
31263123
specified EGL device. <code>/opt/VirtualGL/bin/eglinfo&nbsp;-e</code>
31273124
lists all valid EGL device IDs and their associated DRI device paths.
3125+
<div class="important"><p class="important">
3126+
<code>vglrun</code> automatically sets <code>VGL_DISPLAY</code> to <code>:1024</code> if <code>VGL_DISPLAY</code> is unset, X Display :1024 exists, and X Display :0 does not exist. This allows VirtualGL to use the GDM greeter&rsquo;s Xwayland instance as a 3D X server.
3127+
</p></div>
31283128
</dd>
31293129
</dl>
31303130

doc/unixconfig.txt

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ LightDM) installed and has been configured to start the display manager and 3D
2121
X server at boot time. This is the default with most modern Linux and Unix
2222
distributions.
2323

24-
!!! On Wayland-enabled Linux machines running GDM, configuring the machine
25-
for use with the GLX back end will disable the ability to log in locally with
26-
a Wayland session. In general, logging in locally once the machine has been
27-
configured for use with the GLX back end is discouraged, as this could
28-
disrupt VirtualGL's connection to the 3D X server and thus cause OpenGL
29-
applications running with VirtualGL to abort or freeze.
30-
3124
3. Accelerated OpenGL is working properly in the 3D X server.
3225
* If the 3D X server is not headless, then this can be verified by logging
3326
into the X server locally and running ''glxinfo''.
@@ -60,8 +53,10 @@ disallow access to the GPU. Thus, it is necessary to grant full, trusted
6053
access to the 3D X server for any users that will need to use the GLX back end.
6154
Unless you fully trust the users to whom you are granting this access, then
6255
you should avoid logging in locally to the 3D X server (particularly as root)
63-
unless absolutely necessary. (Logging in locally to the 3D X server is
64-
discouraged anyhow, for reasons explained in the previous section.)
56+
unless absolutely necessary. (In general, logging in locally once the machine
57+
has been configured for use with the GLX back end is discouraged, as this could
58+
disrupt VirtualGL's connection to the 3D X server and thus cause OpenGL
59+
applications running with VirtualGL to abort or freeze.)
6560

6661
This section will explain how to configure a VirtualGL server such that
6762
selected users can use the GLX back end, even if the server is sitting at the
@@ -206,22 +201,23 @@ end, log out of the server, log back into the server using SSH, and execute the
206201
following commands in the SSH session:
207202

208203
If you restricted 3D X server access to ''vglusers'' :: {:}
209-
#Verb <<---
210-
xauth merge /etc/opt/VirtualGL/vgl_xauth_key
211-
xdpyinfo -display :0
212-
/opt/VirtualGL/bin/glxinfo -display :0 -c
213-
---
204+
#Pverb <<---
205+
xauth merge /etc/opt/VirtualGL/vgl_xauth_key
206+
xdpyinfo -display :__n__
207+
/opt/VirtualGL/bin/glxinfo -display :__n__ -c
208+
---
214209

215210
If you did not restrict 3D X server access :: {:}
216-
#Verb <<---
217-
xdpyinfo -display :0
218-
/opt/VirtualGL/bin/glxinfo -display :0 -c
219-
---
220-
221-
Both commands should output a list of visuals and should complete with no
222-
errors. If you chose to disable the ''XTEST'' extension, then check the output
223-
of the ''xdpyinfo'' command to verify that ''XTEST'' does not show up in the
224-
list of extensions.
211+
#Pverb <<---
212+
xdpyinfo -display :__n__
213+
/opt/VirtualGL/bin/glxinfo -display :__n__ -c
214+
---
215+
216+
(where __''n''__ is the display number of the 3D X server.) Both commands
217+
should output a list of visuals and should complete with no errors. If you
218+
chose to disable the ''XTEST'' extension, then check the output of the
219+
''xdpyinfo'' command to verify that ''XTEST'' does not show up in the list of
220+
extensions.
225221

226222
You should also examine the output of the ''glxinfo'' command to ensure that at
227223
least one of the visuals is 24-bit or 32-bit TrueColor and has Pbuffer support.

server/vglrun.in

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Copyright (C)2004 Landmark Graphics Corporation
44
# Copyright (C)2005 Sun Microsystems, Inc.
5-
# Copyright (C)2009-2016, 2018-2019, 2021, 2024 D. R. Commander
5+
# Copyright (C)2009-2016, 2018-2019, 2021, 2024-2025 D. R. Commander
66
#
77
# This library is free software and may be redistributed and/or modified under
88
# the terms of the wxWindows Library License, Version 3.1 or (at your option)
@@ -41,7 +41,7 @@ usage()
4141
echo " library."
4242
echo
4343
echo "-d <d> : <d> = the X display/screen or EGL device to use for 3D rendering"
44-
echo " [default = :0]"
44+
echo " [default = :0 or :1024]"
4545
echo
4646
echo "-fps <f> : Limit image transport frame rate to <f> frames/sec"
4747
echo
@@ -193,12 +193,20 @@ else
193193
if [ ! -z "$SSH_IP" -a -z "$VGL_CLIENT" -a -z "$RRCLIENT" ]; then
194194
VGL_CLIENT=$SSH_IP
195195
export VGL_CLIENT
196-
echo "[VGL] NOTICE: Automatically setting VGL_CLIENT environment variable to"
196+
echo "[VGL] NOTICE: Automatically setting the VGL_CLIENT environment variable to"
197197
echo "[VGL] $SSH_IP, the IP address of your SSH client."
198198
fi
199199
fi
200200
fi
201201

202+
if [ -z "$VGL_DISPLAY" -a ! -e /tmp/.X11-unix/X0 -a \
203+
-e /tmp/.X11-unix/X1024 ]; then
204+
echo "[VGL] NOTICE: Automatically setting the VGL_DISPLAY environment variable to"
205+
echo "[VGL] :1024, the X display number of the GDM greeter's Xwayland instance."
206+
VGL_DISPLAY=:1024
207+
export VGL_DISPLAY
208+
fi
209+
202210
# This is so we can launch both 32-bit and 64-bit executables using the same
203211
# script.
204212
if [ -x "$MYPATH/.vglrun.vars64" ]; then

server/vglserver_config

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ RMMODNEEDED=0
2020
NVIDIADRMNEEDED=0
2121
UNATTENDED=0
2222
SELINUX=0
23-
WAYLAND=0
2423
BACKEND=glx
2524

2625
GID=
@@ -281,22 +280,6 @@ disallowgdmtcp()
281280
commentline $1 "DisallowTCP.*=.*"
282281
}
283282

284-
disablewaylandgdm()
285-
{
286-
backup $1
287-
echo ... Disabling Wayland in $1 ...
288-
grep -q "WaylandEnable.*=.*false" $1 && (
289-
uncommentline $1 "WaylandEnable.*=.*false"
290-
) || (
291-
grep -q "WaylandEnable" $1 && (
292-
replaceline $1 WaylandEnable "WaylandEnable=false"
293-
) || (
294-
removeline $1 WaylandEnable
295-
addtoconf $1 "daemon" "daemon" WaylandEnable=false
296-
)
297-
)
298-
}
299-
300283
setdripermissions()
301284
{
302285
if [ -z "$1" ]; then
@@ -579,37 +562,6 @@ checkselinux()
579562
fi
580563
}
581564

582-
checkwayland()
583-
{
584-
which Xwayland >/dev/null 2>&1 || return 0
585-
if [ -f /etc/systemd/system/display-manager.service ]; then
586-
DM=`grep ExecStart=\/usr /etc/systemd/system/display-manager.service | sed 's/.*\///g'`
587-
if [ ! "$DM" = "gdm" -a ! "$DM" = "gdm3" ]; then
588-
return 0
589-
fi
590-
elif [ -f /etc/alternatives/default-displaymanager ]; then
591-
DM=`grep DISPLAYMANAGER=\/usr /etc/alternatives/default-displaymanager | sed 's/.*\///g'`
592-
if [ ! "$DM" = "gdm" ]; then
593-
return 0
594-
fi
595-
else
596-
return 0
597-
fi
598-
WAYLAND=1
599-
echo
600-
echo WARNING: Configuring this server for use with VirtualGL will disable the
601-
echo ability to log in locally with a Wayland session.
602-
if [ $UNATTENDED = 0 ]; then
603-
ynprompt "Continue?"
604-
if [ ! "$?" = "1" ]; then
605-
return 1
606-
fi
607-
else
608-
echo
609-
fi
610-
return 0
611-
}
612-
613565
unconfigglx()
614566
{
615567
if [ -d /etc/opt/VirtualGL ]; then
@@ -793,8 +745,6 @@ configegl()
793745

794746
configglx()
795747
{
796-
checkwayland || return
797-
798748
if [ $UNATTENDED = 0 ]; then
799749
ynprompt "Restrict 3D X server access to vglusers group (recommended)?"
800750
if [ $? = 1 ]; then VGLUSERSONLY=1; else VGLUSERSONLY=0; fi
@@ -916,8 +866,8 @@ EOF
916866
/etc/X11/gdm/custom.conf \
917867
/etc/gdm3/custom.conf \
918868
/etc/gdm3/daemon.conf; do
919-
if [ -f $file -a ! -h $file -a $WAYLAND = 1 ]; then
920-
disablewaylandgdm $file
869+
if [ -f $file -a ! -h $file ]; then
870+
commentline $file "WaylandEnable.*=.*false"
921871
fi
922872
done
923873

0 commit comments

Comments
 (0)