Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xpra can't start a server. #1777

Closed
totaam opened this issue Mar 1, 2018 · 19 comments
Closed

Xpra can't start a server. #1777

totaam opened this issue Mar 1, 2018 · 19 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Mar 1, 2018

Issue migrated from trac ticket # 1777

component: server | priority: major | resolution: fixed | keywords: rpi x11

2018-03-01 02:40:35: xaviermerino created the issue


Hello,

I decided to use Xpra on the Raspberry Pi 3. The packaged versions were too old so I had to compile xpra. I followed the steps for Debian - Ubuntu and the remarks for the Raspberry Pi made in the building documentation. https://www.xpra.org/trac/wiki/Building

After that was done Xpra 2.2.4 was installed. I can attach to an xpra server in another computer via:

xpra attach tcp:host:port

And that works. But when I try to do something like:

xpra start --start-child=xterm --bind-tcp=0.0.0.0:10000

Then it does not work. In fact, it gives the following log:

2018-03-01 02:26:21,587 cannot access python uinput module:
2018-03-01 02:26:21,588  No module named uinput
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
Failed to rename log file "/run/user/1000/xpra/Xorg.S26161.log" to "/run/user/1000/xpra/Xorg.S26161.log": No such file or directory

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.41-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.9.80-v7+ #3 SMP Mon Feb 26 23:28:32 PST 2018 armv7l
Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=76bb0162-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
Build Date: 18 October 2017  04:55:30PM
xorg-server 2:1.19.2-1+rpt1+deb9u2 (https://www.debian.org/support) 
Current version of pixman: 0.34.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/run/user/1000/xpra/Xorg.S26161.log", Time: Thu Mar  1 02:26:21 2018
(++) Using config file: "/usr/local/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE) 
Fatal server error:
(EE) no screens found(EE) 
(EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/run/user/1000/xpra/Xorg.S26161.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.
xpra initialization error:
 /usr/lib/xorg/Xorg: did not provide a display number using displayfd
2018-03-01 02:26:31,652 closing tcp socket 0.0.0.0:10000

I don't know what displayfd does but from what I have read I believe it should give Xpra a free display number. It seems like its not playing nice. So I decided to choose the number.

xpra start :9999 --start-child=xterm --bind-tcp=0.0.0.0:10000

It still does not work. But now I get a different message:

2018-03-01 02:31:03,864 cannot access python uinput module:
2018-03-01 02:31:03,865  No module named uinput

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.41-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.9.80-v7+ #3 SMP Mon Feb 26 23:28:32 PST 2018 armv7l
Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=76bb0162-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
Build Date: 18 October 2017  04:55:30PM
xorg-server 2:1.19.2-1+rpt1+deb9u2 (https://www.debian.org/support) 
Current version of pixman: 0.34.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/run/user/1000/xpra/Xorg.:9999.log", Time: Thu Mar  1 02:31:03 2018
(++) Using config file: "/usr/local/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE) 
Fatal server error:
(EE) no screens found(EE) 
(EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/run/user/1000/xpra/Xorg.:9999.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.
2018-03-01 02:31:07,016 Error: failed to connect to display :9999
2018-03-01 02:31:07,017  could not connect to X server on display ':9999' after 3 seconds
2018-03-01 02:31:07,019 closing tcp socket 0.0.0.0:10000
2018-03-01 02:31:07,021 killing xvfb with pid 27173
2018-03-01 02:31:07,022 failed to kill xvfb process with pid 27173:
2018-03-01 02:31:07,022  [Errno 3] No such process

Also every time this happens my screen goes black and moving the mouse around erases the black and reveals the screen underneath.

What could this be?

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

2018-03-01 03:09:25: antoine changed owner from antoine to xaviermerino

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

Maybe your version of Xorg is missing some bits (the dummy driver?), try generating an xpra config with xvfb instead.

You can inspect /usr/local/etc/xpra/xorg.conf and also check what the Xorg output tells you to do: have a look at /run/user/1000/xpra/Xorg.:9999.log.

Either tweak it by hand or run setup.py with --without-Xdummy.

Note: a rpi is slow and you may want to tune the list of encodings to try to get better performance.

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

2018-03-01 03:55:48: xaviermerino commented


You are right I was missing the dummy driver. I installed it by:

sudo apt-get install xserver-xorg-video-dummy

After that, I was able to run xpra as long as I specified a display otherwise it would still complain like this:

/usr/lib/xorg/Xorg: did not provide a display number using displayfd

Can something be done about this? The section below is part of the error logs from before. As you suggested it didnt have the dummy module. So I then installed it like I mentioned above. Are the other ones necessary for Xpra?

[  2540.513] xorg-server 2:1.19.2-1+rpt1+deb9u2 (https://www.debian.org/support) 
[  2540.513] Current version of pixman: 0.34.0
[  2540.513] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[  2540.513] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  2540.513] (++) Log file: "/run/user/1000/xpra/Xorg.:50.log", Time: Thu Mar  1 01:51:25 2018
[  2540.514] (++) Using config file: "/usr/local/etc/xpra/xorg.conf"
[  2540.514] (EE) Unable to locate/open config directory: "/run/user/1000/xpra/xorg.conf.d/13401"
[  2540.514] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[  2540.549] (==) ServerLayout "dummy_layout"
[  2540.549] (**) |-->Screen "dummy_screen" (0)
[  2540.549] (**) |   |-->Monitor "dummy_monitor"
[  2540.556] (**) |   |-->Device "dummy_videocard"
[  2540.556] (**) |   |-->GPUDevice "dummy_videocard"
[  2540.556] (**) Option "DontVTSwitch" "true"
[  2540.556] (**) Option "AllowMouseOpenFail" "true"
[  2540.556] (**) Option "AutoAddDevices" "false"
[  2540.556] (**) Option "AutoEnableDevices" "false"
[  2540.556] (**) Not automatically adding devices
[  2540.556] (**) Not automatically enabling devices
[  2540.556] (==) Automatically adding GPU devices
[  2540.556] (==) Max clients allowed: 256, resource mask: 0x1fffff
[  2540.556] (WW) The directory "/usr/share/fonts/X11/misc" does not exist.
[  2540.556] 	Entry deleted from font path.
[  2540.556] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[  2540.556] 	Entry deleted from font path.
[  2540.556] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[  2540.556] 	Entry deleted from font path.
[  2540.556] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[  2540.556] 	Entry deleted from font path.
[  2540.556] (==) FontPath set to:
	/usr/share/fonts/X11/100dpi/:unscaled,
	/usr/share/fonts/X11/Type1,
	/usr/share/fonts/X11/100dpi,
	built-ins
[  2540.556] (==) ModulePath set to "/usr/lib/xorg/modules"
[  2540.556] (==) |-->Input Device "<default pointer>"
[  2540.556] (==) |-->Input Device "<default keyboard>"
[  2540.556] (==) The core pointer device wasn't specified explicitly in the layout.
	Using the default mouse configuration.
[  2540.556] (==) The core keyboard device wasn't specified explicitly in the layout.
	Using the default keyboard configuration.
[  2540.556] (II) Loader magic: 0x1fbf40
[  2540.556] (II) Module ABI versions:
[  2540.556] 	X.Org ANSI C Emulation: 0.4
[  2540.556] 	X.Org Video Driver: 23.0
[  2540.556] 	X.Org XInput driver : 24.1
[  2540.556] 	X.Org Server Extension : 10.0
[  2540.564] (II) systemd-logind: took control of session /org/freedesktop/login1/session/c4
[  2540.565] (II) no primary bus or device found
[  2540.565] (II) LoadModule: "glx"
[  2540.565] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[  2540.569] (II) Module glx: vendor="X.Org Foundation"
[  2540.569] 	compiled for 1.19.2, module version = 1.0.0
[  2540.569] 	ABI class: X.Org Server Extension, version 10.0
[  2540.569] (II) LoadModule: "dummy"
[  2540.570] (WW) Warning, couldn't open module dummy
[  2540.570] (II) UnloadModule: "dummy"
[  2540.570] (II) Unloading dummy
[  2540.570] (EE) Failed to load module "dummy" (module does not exist, 0)
[  2540.570] (II) LoadModule: "mouse"
[  2540.571] (WW) Warning, couldn't open module mouse
[  2540.571] (II) UnloadModule: "mouse"
[  2540.571] (II) Unloading mouse
[  2540.571] (EE) Failed to load module "mouse" (module does not exist, 0)
[  2540.571] (II) LoadModule: "kbd"
[  2540.571] (WW) Warning, couldn't open module kbd
[  2540.571] (II) UnloadModule: "kbd"
[  2540.571] (II) Unloading kbd
[  2540.571] (EE) Failed to load module "kbd" (module does not exist, 0)
[  2540.571] (EE) No drivers available.
[  2540.571] (EE) 
Fatal server error:
[  2540.571] (EE) no screens found(EE) 
[  2540.571] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[  2540.571] (EE) Please also check the log file at "/run/user/1000/xpra/Xorg.:50.log" for additional information.

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

This command should always work (you may need to adjust the path to xpra's xorg.conf):

Xorg -logfile /tmp/Xlog%s -config /etc/xpra/xorg.conf -displayfd 2

If that fails somehow, then there's nothing xpra can do to make it work and this would be a question for your distribution.

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

2018-03-01 04:48:04: xaviermerino commented


I got it to work with your previous comment. Thank you!

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

I got it to work with your previous comment.

Please always specify what you did to "make it work" so that others can benefit when reading this ticket.
Did you resolve your displayfd issue?

@totaam totaam closed this as completed Mar 1, 2018
@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

2018-03-01 05:16:01: xaviermerino commented


I was unable to resolve the displayfd issue with the commands that you suggested. It still complains with:

/usr/lib/xorg/Xorg: did not provide a display number using displayfd

But, I am fine with specifying the display number. If I do that, then I can run xpra like this:

xpra start :9999 --start-child=leafpad --bind-tcp=0.0.0.0:10000

So with your comments I noticed that I needed this:

sudo apt-get install xserver-xorg-video-dummy

And then I was able to start an xpra server.

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

I was unable to resolve the displayfd issue with the commands that you suggested. It still complains with:
/usr/lib/xorg/Xorg: did not provide a display number using displayfd

If the command in comment:3 fails then you should file a bug with your distribution against the Xorg package.

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

2018-03-01 05:34:57: xaviermerino commented


Replying to [comment:7 Antoine Martin]:

I was unable to resolve the displayfd issue with the commands that you suggested. It still complains with:
/usr/lib/xorg/Xorg: did not provide a display number using displayfd
If the command in comment:3 fails then you should file a bug with your distribution against the Xorg package.

Just to be sure, you are saying to run this (already points to my xorg.conf):

Xorg -logfile /tmp/Xlog%s -config /usr/local/etc/xpra/xorg.conf -displayfd 2

That produces this:

pi@raspberrypi:/etc/default $ Xorg -logfile /tmp/Xlog%s -config /usr/local/etc/xpra/xorg.conf -displayfd 2
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(--) Log file renamed from "/tmp/Xlogpid-2277" to "/tmp/Xlog3"

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.41-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.9.80-v7+ #3 SMP Mon Feb 26 23:28:32 PST 2018 armv7l
Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=76bb0162-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
Build Date: 18 October 2017  04:55:30PM
xorg-server 2:1.19.2-1+rpt1+deb9u2 (https://www.debian.org/support) 
Current version of pixman: 0.34.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/tmp/Xlog3", Time: Thu Mar  1 05:24:52 2018
(++) Using config file: "/usr/local/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
3

If I try and run xpra again after that then I get this:

pi@raspberrypi:~ $ xpra start --start-child=leafpad --bind-tcp=0.0.0.0:10000 --no-daemon
2018-03-01 05:30:04,034 cannot access python uinput module:
2018-03-01 05:30:04,035  No module named uinput
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
Failed to rename log file "/run/user/1000/xpra/Xorg.S3479.log" to "/run/user/1000/xpra/Xorg.S3479.log": No such file or directory

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.41-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.9.80-v7+ #3 SMP Mon Feb 26 23:28:32 PST 2018 armv7l
Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=76bb0162-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
Build Date: 18 October 2017  04:55:30PM
xorg-server 2:1.19.2-1+rpt1+deb9u2 (https://www.debian.org/support) 
Current version of pixman: 0.34.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/run/user/1000/xpra/Xorg.S3479.log", Time: Thu Mar  1 05:30:04 2018
(++) Using config file: "/usr/local/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
xpra initialization error:
 /usr/lib/xorg/Xorg: did not provide a display number using displayfd
2018-03-01 05:30:14,100 closing tcp socket 0.0.0.0:10000
pi@raspberrypi:~ $ XKB: Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
(EE) 
Fatal server error:
(EE) Failed to activate virtual core keyboard: 2(EE) 
(EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/run/user/1000/xpra/Xorg.S3479.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.


I don't know much about how the X11 "things" work so I'm sorry if I'm missing something obvious.

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

2018-03-01 05:46:40: antoine commented


Right, so Xorg is not broken and you don't need to file a bug with your distribution.

What happens is that we end up using /usr/lib/xorg/Xorg (by the looks of things, or whatever is defined in your xpra config for the xvfb option) and that doesn't honour the displayfd flag - for whatever reason.
Simply replacing your xvfb command line with something like: xvfb=/usr/bin/Xorg ... should do the trick and allow you to use displayfd with xpra.

Ideally, we would detect this unusual / buggy wrapper script and avoid using it. But rpi is such a niche distro that I don't see much point in spending too much time on it.

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

2018-03-01 10:21:30: xaviermerino commented


When I do which Xorg i get /usr/bin/Xorg.
I am assuming that this is why you say it doesn't work because xvfb is attempting to use /usr/lib/xorg/Xorg.

So I tried doing this:

xpra start --start-child=leafpad --bind-tcp=0.0.0.0:10000 --no-daemon --start-via-proxy=no --xvfb=/usr/bin/Xorg

And in response I got:

pi@raspberrypi:~ $ xpra start --start-child=leafpad --bind-tcp=0.0.0.0:10000 --no-daemon --start-via-proxy=no --xvfb=/usr/bin/Xorg
2018-03-01 10:14:05,041 cannot access python uinput module:
2018-03-01 10:14:05,042  No module named uinput
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(--) Log file renamed from "/home/pi/.local/share/xorg/Xorg.pid-1946.log" to "/home/pi/.local/share/xorg/Xorg.4.log"

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.41-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.9.80-v7+ #3 SMP Mon Feb 26 23:28:32 PST 2018 armv7l
Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=76bb0162-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
Build Date: 18 October 2017  04:55:30PM
xorg-server 2:1.19.2-1+rpt1+deb9u2 (https://www.debian.org/support) 
Current version of pixman: 0.34.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/pi/.local/share/xorg/Xorg.4.log", Time: Thu Mar  1 10:14:05 2018
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE) 
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
(EE) 
(EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/home/pi/.local/share/xorg/Xorg.4.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.
xpra initialization error:
 /usr/bin/Xorg: did not provide a display number using displayfd
2018-03-01 10:14:15,065 closing tcp socket 0.0.0.0:10000

It is still mentioning displayfd.

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

When I do which Xorg i get /usr/bin/Xorg
I am assuming that this is why you say it doesn't work because xvfb is attempting to use /usr/lib/xorg/Xorg

Correct.

So I tried doing this:
... xvfb=/usr/bin/Xorg

No, that won't work.

You need to change the path found in the xvfb command line option, not replace it altogether.

See xpra showconfig | grep xvfb
Or modify /etc/xpra/conf.d/55_server_x11.conf directly.

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

2018-03-01 16:39:45: xaviermerino commented


When I do xpra showcongif | grep xvfb I get:

sync-xvfb                      = 0
xvfb                           = '/usr/lib/xorg/Xorg -noreset -novtswitch -nolisten tcp +extension GLX +extension RANDR +extension RENDER -auth $XAUTHORITY -logfile ${XPRA_LOG_DIR}/Xorg.${DISPLAY}.log -configdir ${XDG_RUNTIME_DIR}/xpra/xorg.conf.d/$PID -config /usr/local/etc/xpra/xorg.conf'

I am going to change the path to say /usr/bin/Xorg although I can't find the /etc/xpra/conf.d/55_server_x11.conf file in the Pi. There is no /etc/xpra directory. So I did this:

xpra start --start-child=leafpad --bind-tcp=0.0.0.0:10000 --no-daemon --xvfb='/usr/bin/Xorg -noreset -novtswitch -nolisten tcp +extension GLX +extension RANDR +extension RENDER -auth $XAUTHORITY -logfile ${XPRA_LOG_DIR}/Xorg.${DISPLAY}.log -configdir ${XDG_RUNTIME_DIR}/xpra/xorg.conf.d/$PID -config /usr/local/etc/xpra/xorg.conf'

And got this in response:

pi@raspberrypi:~ $ xpra start --start-child=leafpad --bind-tcp=0.0.0.0:10000 --no-daemon --xvfb='/usr/bin/Xorg -noreset -novtswitch -nolisten tcp +extension GLX +extension RANDR +extension RENDER -auth $XAUTHORITY -logfile ${XPRA_LOG_DIR}/Xorg.${DISPLAY}.log -configdir ${XDG_RUNTIME_DIR}/xpra/xorg.conf.d/$PID -config /usr/local/etc/xpra/xorg.conf'
2018-03-01 16:34:54,965 cannot access python uinput module:
2018-03-01 16:34:54,966  No module named uinput
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
Failed to rename log file "/run/user/1000/xpra/Xorg.S29814.log" to "/run/user/1000/xpra/Xorg.S29814.log": No such file or directory

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.41-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.9.80-v7+ #3 SMP Mon Feb 26 23:28:32 PST 2018 armv7l
Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=76bb0162-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
Build Date: 18 October 2017  04:55:30PM
xorg-server 2:1.19.2-1+rpt1+deb9u2 (https://www.debian.org/support) 
Current version of pixman: 0.34.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/run/user/1000/xpra/Xorg.S29814.log", Time: Thu Mar  1 16:34:55 2018
(++) Using config file: "/usr/local/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
xpra initialization error:
 /usr/bin/Xorg: did not provide a display number using displayfd
2018-03-01 16:35:05,027 closing tcp socket 0.0.0.0:10000
pi@raspberrypi:~ $ XKB: Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
(EE) 
Fatal server error:
(EE) Failed to activate virtual core keyboard: 2(EE) 
(EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/run/user/1000/xpra/Xorg.S29814.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

I can't find the /etc/xpra/conf.d/55_server_x11.conf

From your previous posts, you seem to have installed everything into the /usr/local prefix. So that would be /usr/local/etc/xpra/....

But what you did should have worked, and since I don't have time to boot up a rpi, it's probably best to leave it there, sorry.

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2018

2018-03-01 21:36:33: xaviermerino commented


Thanks for pointing me to the file.

I basically changed this:

# Selecting virtual X server:
xvfb = /usr/lib/xorg/Xorg -noreset -novtswitch -nolisten tcp +extension GLX +extension RANDR +extension RENDER -auth $XAUTHORITY -logfile ${XPRA_LOG_DIR}/Xorg.${DISPLAY}.log -configdir ${XDG_RUNTIME_DIR}/xpra/xorg.conf.d/$PID -config /usr/local/etc/xpra/xorg.conf

to this:

# Selecting virtual X server:
xvfb = /usr/bin/Xorg -noreset -novtswitch -nolisten tcp +extension GLX +extension RANDR +extension RENDER -auth $XAUTHORITY -logfile ${XPRA_LOG_DIR}/Xorg.${DISPLAY}.log -configdir ${XDG_RUNTIME_DIR}/xpra/xorg.conf.d/$PID -config /usr/local/etc/xpra/xorg.conf

So then I run:

xpra start --start-child=leafpad --bind-tcp=0.0.0.0:10000 --no-daemon --start-via-proxy=no

And I get:

pi@raspberrypi:~ $ xpra start --start-child=leafpad --bind-tcp=0.0.0.0:10000 --no-daemon --start-via-proxy=no
2018-03-01 20:54:29,593 cannot access python uinput module:
2018-03-01 20:54:29,594  No module named uinput
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
Failed to rename log file "/run/user/1000/xpra/Xorg.S20038.log" to "/run/user/1000/xpra/Xorg.S20038.log": No such file or directory

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.41-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.9.80-v7+ #3 SMP Mon Feb 26 23:28:32 PST 2018 armv7l
Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=76bb0162-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
Build Date: 18 October 2017  04:55:30PM
xorg-server 2:1.19.2-1+rpt1+deb9u2 (https://www.debian.org/support) 
Current version of pixman: 0.34.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/run/user/1000/xpra/Xorg.S20038.log", Time: Thu Mar  1 20:54:29 2018
(++) Using config file: "/usr/local/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
xpra initialization error:
 /usr/bin/Xorg: did not provide a display number using displayfd
2018-03-01 20:54:39,653 closing tcp socket 0.0.0.0:10000

Sometimes I will also get extra information appended to the output above. I have no clue but I think that maybe xpra is wating for the display number but its taking the display a bit to set up. So eventually xpra prepares to stop executing and then some information about why the server failed pops up.

pi@raspberrypi:~ $ XKB: Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
(EE) 
Fatal server error:
(EE) Failed to activate virtual core keyboard: 2(EE) 
(EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/run/user/1000/xpra/Xorg.<number>.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.

So I decided to supply xpra with a display number myself.

xpra start :9999 --start-child=leafpad --bind-tcp=0.0.0.0:10000 --no-daemon --start-via-proxy=no

Then the error does not mention displayfd it just fails, I think, because something fails to load for the X server to start. In this case it may be the virtual keyboard.

pi@raspberrypi:~ $ xpra start :9999 --start-child=leafpad --bind-tcp=0.0.0.0:10000 --no-daemon --start-via-proxy=no
2018-03-01 21:19:17,627 cannot access python uinput module:
2018-03-01 21:19:17,628  No module named uinput

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.41-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.9.80-v7+ #3 SMP Mon Feb 26 23:28:32 PST 2018 armv7l
Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=76bb0162-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
Build Date: 18 October 2017  04:55:30PM
xorg-server 2:1.19.2-1+rpt1+deb9u2 (https://www.debian.org/support) 
Current version of pixman: 0.34.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/run/user/1000/xpra/Xorg.:9999.log", Time: Thu Mar  1 21:19:17 2018
(++) Using config file: "/usr/local/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
'''XKB: Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
(EE) 
Fatal server error:
(EE) Failed to activate virtual core keyboard: 2(EE) 
(EE)''' 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/run/user/1000/xpra/Xorg.:9999.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.
2018-03-01 21:19:28,029 Error: failed to connect to display :9999
2018-03-01 21:19:28,030  could not connect to X server on display ':9999' after 3 seconds
2018-03-01 21:19:28,032 closing tcp socket 0.0.0.0:10000
2018-03-01 21:19:28,033 killing xvfb with pid 25942

That also points us to this file /tmp/Xorg.:9999.log. The file is huge but in the end it says:

[  5261.093] (II) DUMMY(0): Modeline "320x175"x85.3   15.75  320 336 368 416  175 191 192 222 doublescan +hsync -vsync (37.9 kHz d)
[  5261.093] (==) DUMMY(0): DPI set to (96, 96)
[  5261.093] (II) Loading sub module "fb"
[  5261.093] (II) LoadModule: "fb"
[  5261.094] (II) Loading /usr/lib/xorg/modules/libfb.so
[  5261.097] (II) Module fb: vendor="X.Org Foundation"
[  5261.097] 	compiled for 1.19.2, module version = 1.0.0
[  5261.097] 	ABI class: X.Org ANSI C Emulation, version 0.4
[  5261.097] (II) Loading sub module "ramdac"
[  5261.097] (II) LoadModule: "ramdac"
[  5261.097] (II) Module "ramdac" already built-in
[  5261.097] (--) Depth 24 pixmap format is 32 bpp
[  5261.097] (II) DUMMY(0): Using 3904 scanlines of offscreen memory 
[  5261.097] (==) DUMMY(0): Backing store enabled
[  5261.097] (==) DUMMY(0): Silken mouse enabled
[  5261.097] (WW) DUMMY(0): Option "ConstantDPI" is not used
[  5261.097] (==) RandR enabled
[  5261.119] (II) SELinux: Disabled on system
[  5261.122] (II) AIGLX: Screen 0 is not DRI2 capable
[  5261.122] (EE) AIGLX: reverting to software rendering
[  5261.231] (II) IGLX: enabled GLX_MESA_copy_sub_buffer
[  5261.233] (II) IGLX: Loaded and initialized swrast
[  5261.233] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[  5261.465] (EE) XKB: Could not invoke xkbcomp
[  5261.465] (EE) XKB: Couldn't compile keymap
[  5261.465] (EE) XKB: Failed to load keymap. Loading default keymap instead.
[  5261.476] (EE) XKB: Could not invoke xkbcomp
[  5261.476] (EE) XKB: Couldn't compile keymap
[  5261.476] XKB: Failed to compile keymap
[  5261.476] Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
[  5261.476] (EE) 
Fatal server error:
[  5261.476] (EE) Failed to activate virtual core keyboard: 2(EE) 
[  5261.476] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[  5261.477] (EE) Please also check the log file at "/tmp/Xorg.:9999.log" for additional information.
[  5261.477] (EE) 
[  5261.477] (EE) Server terminated with error (1). Closing log file.

In sum, after modifying the xvfb option in the /usr/local/etc/xpra/conf.d/55_server_x11.conf to reflect /usr/bin/Xorg instead of /usr/lib/xorg/Xorg, we can try to use xpra but it fails.

If you don't specify a display number it attempts to get one via displayfd. Correct me if I am wrong but I suspect the response gets there later than xpra expects it. Because Xpra is shutting down and the X server attempts to start and then fails.

If you specify a display number it attempts to start the X server and then fails.

The failures in both cases are "apparently" related to the virtual keyboard.

What do you think? I am perfectly fine with supplying the display number. I would just appreciate if you could point me in the right direction to get that X server starting after those virtual keyboard errors.

@totaam
Copy link
Collaborator Author

totaam commented Mar 2, 2018

Sometimes I will also get extra information appended to the output above. I have no clue but I think that maybe xpra is wating for the display number but its taking the display a bit to set up.

That could very well be the case.
The timeout was set to 10 seconds - which is enough on most systems, but maybe not on something as underpowered as an rpi. As of r18661 you can now change it using an env var:

XPRA_DISPLAY_FD_TIMEOUT=30 xpra start ...

(EE) XKB: Could not invoke xkbcomp
(..)
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
Failed to activate virtual core keyboard: 2(EE)

Maybe the /usr/lib/xorg/Xorg wrapper does something with device permissions.
We only use virtual devices and those don't require any special permissions, so I don't see why skipping the wrapper would cause this to fail, but who knows.
This looks like a question for your distribution's Xorg packager.

@totaam
Copy link
Collaborator Author

totaam commented Mar 25, 2018

2018-03-25 14:59:09: xaviermerino commented


So in the end I could solve the problem with your guidance.

I thought I would share the gist here: [https://gist.github.com/xaviermerino/5bb83e0b471e67beaea6d5eeb80daf8c]

I hope someone else can find it useful.

Performance on the Pi is not that bad but then again I haven't tried streaming anything other than a text editor. Any suggestions on what to do to fine tune performance?

@totaam
Copy link
Collaborator Author

totaam commented Mar 25, 2018

Thanks, I've created a wiki page based on this Building Raspbian with only some minor changes.

Please check if r18848+r18853 fixes the Xorg paths problems, then the corresponding section of the new wiki page can be removed.

Any suggestions on what to do to fine tune performance?

Keep the speed / min-speed settings high, and maybe avoid the video encodings.

@totaam
Copy link
Collaborator Author

totaam commented Dec 27, 2018

Even a rpi should be able to start an Xorg server quickly enough, we just need to fix an Xorg inefficiency: #2091

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant