sp4rkie / debian-on-termux

HOWTO install plain Debian 10 (buster) on your non-rooted Android smartphone
GNU Lesser General Public License v2.1
401 stars 87 forks source link

How to configure installed system to be able to use Debian ARM xserver #42

Closed JanuszChmiel closed 4 years ago

JanuszChmiel commented 5 years ago

Dear specialists, I Am wondering, how complex would be to configure Xserver so this Xserver could be normally used on Android with no need to root The device. Yours script is perfect and it install fully functional system including sockets communication. Thanks to yours work I was been even able to install Orca screen reader, Openbox window manager and I can use many various GTK applications. But I must use Xserver XSDL. This require switching between windows by using build in Android navigation. And even Xserver XSDL is near to complete Xserver solution, it is possible to use many apps.But when I couldsimply type startx to be able to run xserver on The Debian session, it would be much more better. What do you think, is it possible, or I really must root my device?

max1220 commented 5 years ago

Recent versions of the X server can run without root priviledges, but running an X Server on an android device isn't easily possible, for multiple reasons*. Your best bet is probably XServer XDSL or using x11vnc etc.

*may include: no gfx drivers for X, most likely requires root, debian and android don't share the same libc, different framebuffer formats when running using only fbdev, android doesn't really support sharing your output device nicely(only via "stop"-command via root shell), etc.

JanuszChmiel commented 5 years ago

Thank you very much for yours answer. I have found out, that dummy driver work but it was one critical disadvantage. It do not allow me to interact with X11 session. I was even able to run so complex program like Orca screen reader is. But because I could not have interaction with active window by using keyboard or touch screen, my experiment have not much sense. Because I would had to make little Android app, which would interact with active X11 session by using XKBT protocol and it would create chaos. Because when I have used export DISPLAY=:0 and when I have executed xsession & It initiated X environment, sure with one strange English error message, that some variable have 0 value instead of 1. But no other crytical errors have occurred. Because I have executed original XORG, I did not get bug from Openbox and other window managers, that some extension is not available. Orca screen reader even cooperated with Active X session on The low level, so it was able to get information about window title, object name, without severe crashes. But no keyboard input, no touch screen input, so I was not been able to navigate inside active GTK based app. I have been dreaming, if I could combine X11 dummy driver with SSH tunel to be able to send keyboard shortcuts by using SSH. But it was also not possible.

  1. I think, that I can not combine two various approaches while controlling one display.
  2. Connect botdo not support sending up and down arrow keys directly, so it is simply not possibleto press arrow keys so active process which run on X11 window will react on it. I also do not know, if VNC support direct communication with Android keyboard AOSP module, so I could simply use my favourite external keyboard and send INSERT+SPACE hod key by pressing those keys. Or if it is only possible to use VNC by using touch display. Xserver XSDL is good project, but it was big disadvantage. User is forced to use second device to type commands on SSH Bash shell console when Xserver XSDL is running on active window. Or user use standard keyboard or touch screen on his Android device and user types commands on Termux. But in this case, user must switch between Termux main window and Xserver XSDL, which can make running Debian app unstable. But I know, that I must accept those thinks. Sure, I would simply buy cheap Rasbian device with fast SD cart and it would run perfectly. But I love new informatics experiments. I have also found next Xserver from Dargside technology,but it do not support Xkbt extension so Orca can not work. Next Android Xserver is being intensively developed and will be based on Android native activity, so no SDL library will be used for graphical output.
max1220 commented 5 years ago

It should be possible to do what you want via vnc only. To use the dummy driver, the setup should look something like this: First, use 11vnc -storepasswd to store your password. Then, start debian, start Xserver with dummy drivers configured for display :0, then start DISPLAY=:0 x11vnc -usepw, then start your X session(e.g. lxsession). You should now be able to connect to via localhost on port 5900 or so.

Or you just take the easy route by installing tigervnc-standalone-server tigervnc-common and just running vncserver -geometry 1080x1920. (Or what ever resolution you want)

Then of course there is the VNC client for your android device. There are a lot of options, but that just boils down to personal preference. Almost all of them support keyboard input. Just try a few from the playstore(or FDroid).

Edit: Also, I believe this issue can be closed, as the issue is not really termux-related.