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

Can't start xpra server inside a container. #1792

Closed
totaam opened this issue Mar 25, 2018 · 7 comments
Closed

Can't start xpra server inside a container. #1792

totaam opened this issue Mar 25, 2018 · 7 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Mar 25, 2018

Issue migrated from trac ticket # 1792

component: server | priority: major | resolution: needinfo

2018-03-25 15:35:42: xaviermerino created the issue


I have a Debian container that I have set up with the following packages for xpra dependencies.

sudo apt-get install -y python-pip build-essential libx11-dev \ 
libxtst-dev libxcomposite-dev libxdamage-dev libxkbfile-dev \
python-all-dev python-gobject-dev python-gtk2-dev cython xauth \
x11-xkb-utils xserver-xorg-video-dummy libx264-dev libvpx-dev \
python-lz4 python-lzo python-cryptography ethtool node-uglify \
brotli python-pygame python-netifaces python-pillow websockify \
python-websockify python-rencode python-opengl

sudo pip install --upgrade pip && sudo pip install pyopengl-accelerate pyyaml websocket-client

I then proceeded to compile xpra. It all proceeded fine. My Xorg is located in /usr/bin/Xorg and Xpra's /usr/local/etc/xpra/conf.d/55_server_x11.conf had

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

So I changed it to:

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

I try to start a new server inside the container.

xpra start --start-child="xterm" --daemon=no --pulseaudio=no --bind-tcp=0.0.0.0:10002 --start-via-proxy=no

And it gives me the following output:

2018-03-25 14:24:53,402 Warning: failed to write script file in '/run/user/1000/xpra':
2018-03-25 14:24:53,405  [Errno 2] No such file or directory: '/run/user/1000/xpra'
2018-03-25 14:24:53,406  ($XDG_RUNTIME_DIR has not been created?)
2018-03-25 14:24:53,435 cannot access python uinput module:
2018-03-25 14:24:53,436  No module named uinput
xpra initialization error:
 /usr/bin/Xorg: did not provide a display number using displayfd
2018-03-25 14:25:03,705 closing tcp socket 0.0.0.0:10002

And then just when you think xpra is done some new text pops up at the console.

developer@e684b5a75e1d:/$ _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
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root
Failed to rename log file "/home/developer/.xpra/Xorg.S341.log" to "/home/developer/.xpra/Xorg.S341.log": No such file or directory
[config] failed to pre-init udev

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.0-4-armmp-lpae armv7l Debian
Current Operating System: Linux e684b5a75e1d 4.13.0-37-generic #42~16.04.1-Ubuntu SMP Wed Mar 7 16:03:28 UTC 2018 armv7l
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-37-generic root=UUID=8f2474e0-5e3d-4217-80ae-7aa5979a9ced ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet
Build Date: 16 October 2017  09:48:39AM
xorg-server 2:1.19.2-1+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/developer/.xpra/Xorg.S341.log", Time: Sun Mar 25 14:29:34 2018
(++) Using config file: "/usr/local/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
[config] failed to initialise udev

So I decided to run this:

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

And it gave me this:

_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
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root
(--) Log file renamed from "/tmp/Xlogpid-360" to "/tmp/Xlog6"
[config] failed to pre-init udev

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.0-4-armmp-lpae armv7l Debian
Current Operating System: Linux e684b5a75e1d 4.13.0-37-generic #42~16.04.1-Ubuntu SMP Wed Mar 7 16:03:28 UTC 2018 armv7l
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-37-generic root=UUID=8f2474e0-5e3d-4217-80ae-7aa5979a9ced ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet
Build Date: 16 October 2017  09:48:39AM
xorg-server 2:1.19.2-1+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/Xlog6", Time: Sun Mar 25 14:33:31 2018
(++) Using config file: "/usr/local/etc/xpra/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
[config] failed to initialise udev
6


Do you have any clues as why this is not working?

@totaam
Copy link
Collaborator Author

totaam commented Mar 25, 2018

2018-03-25 15:40:48: antoine changed owner from antoine to xaviermerino

@totaam
Copy link
Collaborator Author

totaam commented Mar 25, 2018

2018-03-25 15:40:48: antoine commented


I try to start a new server inside the container.
What container?

Warning: failed to write script file in '/run/user/1000/xpra':
Why is this directory missing? Maybe something to do with the container?

My Xorg is located in /usr/bin/Xorg and Xpra's /usr/local/etc/xpra/conf.d/55_server_x11.conf had ...
That's normal if you are running on Debian and not Raspbian, not sure at all you should be changing it.

/usr/bin/Xorg: did not provide a display number using displayfd
Did you increase the timeout?

So I decided to run this:
Xorg -logfile /tmp/Xlog%s -config /usr/local/etc/xpra/xorg.conf -displayfd 2
And it gave me this:
...
[config] failed to initialise udev
6
Not sure about the udev problem, but the fact that it printed "6" at the end means that the displayfd switch did work.

Maybe it is just taking too long to start?
Does xpra work if you specify the display number on the command line?

@totaam
Copy link
Collaborator Author

totaam commented Mar 25, 2018

2018-03-25 15:58:47: xaviermerino commented


The directory /run/user/1000/ can't be used because xpra doesn't have permissions.

I am running a Debian container so I will keep the /usr/local/etc/xpra/conf.d/55_server_x11.conf as it came. This is:

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

So I do:

sudo xpra start :9999 --start-child="xterm" --daemon=no --pulseaudio=no --bind-tcp=0.0.0.0:10002 --start-via-proxy=no

And I get back:

Warning: running as root
2018-03-25 14:54:41,107 cannot access python uinput module:
2018-03-25 14:54:41,110  No module named uinput
[config] failed to pre-init udev

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.0-4-armmp-lpae armv7l Debian
Current Operating System: Linux 4df8e92d2195 4.13.0-37-generic #42~16.04.1-Ubuntu SMP Wed Mar 7 16:03:28 UTC 2018 armv7l
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-37-generic root=UUID=8f2474e0-5e3d-4217-80ae-7aa5979a9ced ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet
Build Date: 16 October 2017  09:48:39AM
xorg-server 2:1.19.2-1+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/Xorg.:9999.log", Time: Sun Mar 25 14:54:42 2018
(++) Using config file: "/usr/local/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
[config] failed to initialise udev
2018-03-25 14:54:48,367 Error: failed to connect to display :9999
2018-03-25 14:54:48,369  could not connect to X server on display ':9999' after 3 seconds
2018-03-25 14:54:48,371 closing tcp socket 0.0.0.0:10002
2018-03-25 14:54:48,373 killing xvfb with pid 108
2018-03-25 14:54:48,375 failed to kill xvfb process with pid 108:
2018-03-25 14:54:48,376  [Errno 3] No such process

But it dies there.

@totaam
Copy link
Collaborator Author

totaam commented Mar 25, 2018

2018-03-25 16:10:37: antoine commented


What container?
?

The directory /run/user/1000/ can't be used because xpra doesn't have permissions.
That's not right.
Your user should have write access to the XDG_RUNTIME_DIR.
For more information see XDG Base Directory Specification and #1129

Warning: running as root
Don't do that.

Current Operating System: Linux 4df8e92d2195 4.13.0-37-generic #42~16.04.1-Ubuntu SMP Wed Mar 7 16:03:28 UTC 2018 armv7l
Is that still running on arm???? If that's on Raspbian as per #1777, then maybe you do need the modified Xorg path as per #1777#comment:17.

[config] failed to initialise udev
This is unusual.

could not connect to X server on display ':9999' after 3 seconds
Maybe the server needs to wait longer?
Try r18849 and set XPRA_VFB_WAIT=20 xpra start ...

@totaam
Copy link
Collaborator Author

totaam commented Apr 22, 2018

2018-04-22 06:43:30: antoine changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Apr 22, 2018

2018-04-22 06:43:30: antoine set resolution to needinfo

@totaam
Copy link
Collaborator Author

totaam commented Apr 22, 2018

2018-04-22 06:43:30: antoine commented


Not heard back, closing.

@totaam totaam closed this as completed Apr 22, 2018
@totaam totaam added the v2.2.x label Jan 22, 2021
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