termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
1.96k stars 301 forks source link

Not working in LXC #293

Closed Ilya114 closed 1 year ago

Ilya114 commented 1 year ago

Hi, I using LXC containers on my phone (POCO X3 Pro) and I tried mount termux-x11 socket using this command: lxc.mount.entry = /data/data/com.termux/files/usr/tmp/termux-x11 tmp/termux-x11 none bind,optional,rw,create=file but when I exported $DISPLAY in container and try launch xfce4 I got:

root@ubuntu:~# xfce4-session
xfce4-session: Cannot open display: .
Наберіть 'xfce4-session --help' для використання.

Same commands (except mount method) working in chroot or proot but I want use termux-x11 in LXC, this is a possible?

2096779623 commented 1 year ago

export DISPLAY=:1 Then try again.

Ilya114 commented 1 year ago

зображення I dont think what problem in display

twaik commented 1 year ago

Both termux-x11 and X display socket must be accessible for termux-x11. You can use export TMPDIR=/path/to/tmpdir if it is possible. Or you can mount-bind /tmp/.X11-unix of container to some place like /data/data/com.termux/files/usr/tmp/.X11-unix.

Ilya114 commented 1 year ago

I`m mounted /tmp from Termux to container fully but its still not work:

root@ubuntu:~# ls -la /tmp
total 25
drwxrwxrwt.  7 root  root  8192 кві  1 14:12 .
drwxr-xr-x. 17 root  root  3488 кві  1 14:11 ..
drwxrwxrwt.  2 root  root  3488 кві  1 14:11 .font-unix
drwxrwxrwt.  2 root  root  3488 кві  1 14:11 .ICE-unix
srwx------.  1 10168 10168    0 кві  1 14:12 termux-x11
-rw-------.  1 10168 10168    0 кві  1 14:12 termux-x11.lock
drwxrwxrwt.  2 root  root  3488 кві  1 14:11 .Test-unix
drwxrwxrwt.  2 root  root  3488 кві  1 14:11 .X11-unix
drwxrwxrwt.  2 root  root  3488 кві  1 14:11 .XIM-unix
root@ubuntu:~# export DISPLAY=:0
root@ubuntu:~# xfce4-session
xfce4-session: Cannot open display: .
Наберіть 'xfce4-session --help' для використання.
root@ubuntu:~# 
twaik commented 1 year ago

What is inside /tmp/.X11-unix?

Ilya114 commented 1 year ago

зображення зображення

Empty, in Termux too

twaik commented 1 year ago

It should not be empty if you started termux-x11.

Ilya114 commented 1 year ago

But

![зображення](https://user-images.githubusercontent.com/93242944/229294680-545b7db1-2941-401e-b4eb-e8c8580dda06.png)
twaik commented 1 year ago

Something is definitely wrong. But I do not think it is possible to see this black screen without existing socket in /data/data/com.termux/files/usr/tmp.

Ilya114 commented 1 year ago

My starting commands: Xvfb :0 -ac & DISPLAY=:0 termux-x11 &

Ilya114 commented 1 year ago

Started xfce4 in Termux but .X11-unix still empty

![зображення](https://user-images.githubusercontent.com/93242944/229295582-f53fd204-8cad-4ecb-a06b-793d6f107b3f.png)
twaik commented 1 year ago

Can I connect to your phone with Anydesk?

twaik commented 1 year ago

Contact me in Telegram.

Ilya114 commented 1 year ago

If your username is @twaik I wrote you

Ilya114 commented 1 year ago

Fixed