Sometimes Xorg just freezes. Maybe it's caused by my graphical app, or maybe not. Here's what I see in .xsession-errors.old
The server closed the connection.
The server closed the connection: socket, pipe or stream error.
And also another type of errors
Failed request: ChangeProperty, BadWindow: 0x00800003.
Investigation begins
Let's find out how Xorg is started and with what arguments. On a system with lightdm you run systemctl status lightdm
and find this
/usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
Another place is nano /etc/X11/xinit/xserverrc
.
The -nolisten
flag means that no TCP connections on port 6000, but only unix socket. To enable TCP you need to create a file nano /usr/share/lightdm/lightdm.conf.d/50-nick-test.conf
with this content
[Seat:*]
xserver-allow-tcp=true
(Source: nolisten flag added to the command line set by setting from config here)
Then after reboot you will see the Xorg listening on port 6000 with netstat -lpnt
(install it with apt install net-tools
)
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 894/Xorg
Also open ssh X11 forwarding for our experiments nano /etc/ssh/sshd_config
:
X11Forwarding yes
I looked into implementation of the XOpenDisplay function. So, basically I need to test the open a connection with XCB (docs)
Restart Xorg and save the app
I didn't find any tools to make this proposition to work. But here's a list of tools I looked at
- The answer Possible to move a window from one X screen to another on same host?
- another small answer Recover an application in sleeping state after an X server crash
- X2Go
- Guievict - A system for checkpointing and migrating the GUI of an X window application (github)
xmove
xpra
wget -O /usr/share/keyrings/xpra.asc https://xpra.org/gpg.asc
wget -O /etc/apt/sources.list.d/xpra.sources https://raw.githubusercontent.com/Xpra-org/xpra/master/packaging/repos/bionic/xpra.sources
References
- https://wiki.postmarketos.org/wiki/Troubleshooting:display
- https://www.x.org/archive/X11R6.8.0/doc/Xorg.1.html
- Also check out the code in my Mr Bean repository