Question Termux: Linux with graphics working

Search This thread

shim80

Senior Member
Dec 18, 2010
84
23
Hello,
I want to use Linux on my Galaxy Tab S8+ through Termux and proot distro (Arch, actually).
However, no matter what I do, there's no way to make GPU work on it...
Using the last Termux from github + Termux-X11, I managed to launch xfce4 desktop on my Arch proot, but when I try glxgears, I get:
Error: couldn't get an RGB, Double-buffered visual
glxinfo:
Error: couldn't find RGB GLX visual or fbconfig
Blender:
intern/ghost/intern/GHOST_WindowX11.cpp:136: X11 glXQueryVersion() failed, verify working openGL system! initial window could not find the GLX extension Writing: /tmp/blender.crash.txt Segmentation fault
I do have compiled mesa on Arch with freedreno-KGSL enabled and zink.
My final goal is to make Blender work with GPU while using proot (no chroot because I don't want to root it yet and loose warranty).
 
  • Wow
Reactions: roirraW "edor" ehT

skrowl

Senior Member
Aug 26, 2009
255
111
USA
www.denialofservice.org
Unfortunately, due to this issue: https://gist.github.com/agnostic-ap...#how-to-disable-the-phantom-processes-killing , you're going to need to root if you want to run Linux desktop apps on ANY Android 12 device.

Once you root your Tab S8, install Linux Deploy (https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy), run it and install whichever distro you like (I chose Kali), and Remote Desktop Manager (https://play.google.com/store/apps/details?id=com.devolutions.remotedesktopmanager) to connect to it via VNC

The only settings I had to change in Linux Deploy was changing the installation type to Directory and the installation path to
Code:
${ENV_DIR}/rootfs/linux
, but your mileage may vary depending on what distro you want to install. If you want to use your Android filesystem from Linux, enable mounts and mount /data/media/0 to /mnt/android.

I haven't messed with PulseAudio, because I really just wanted full LibreOffice. Let me know if you get it to work. You may also want to go into GUI settings in Linux deploy and change the resolution to 1920x1200, but again it depends on your distro chosen.
 

Jake.S

Senior Member
But keep in mind, rooting will 1. Brick your KNOX chip permanent 2. Without KNOX chip, apps like secret folder, samsung pass and few more will stop working. 3. To root you need to unlock the bootloader which triggers the knox chip and permanently disables it and it cannot be recovered or enabled again since knox chip has a tiny fuse inside itself so when bootloader is unlocked it will burn the thin copper thread inside fuse and snap off that will permanently disable knox and this would also void your warranty when knox chip gets triggered and disabled.

So take time think about it before doing it. Do you want warranty or not? Do you want to lose those apps that you may want to use later or already using?
 
Last edited:

shim80

Senior Member
Dec 18, 2010
84
23
Thanks for your answers.
I know that root and bootloader will break the waranty and is not recoverable. It's why I'm trying to make it work using proot.
Once you root your Tab S8, install Linux Deploy (https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy), run it and install whichever distro you like (I chose Kali), and Remote Desktop Manager (https://play.google.com/store/apps/details?id=com.devolutions.remotedesktopmanager) to connect to it via VNC
I use termux-x11 or termux-wayland rather than VNC because it's more fast and smooth.

The GPU seem to work from termux itself (tried glxgears on openbox). However, it doesn't work from proot-distro.
After some research, I found that I could use the GPU by compiling virglrenderer with egl enabled, and then, export GALLIUM_DRIVER=virpipe from proot-distro.
However, to compile virglrenderer, I need to compile mesa from source with gbm enabled, but the compilation give me errors :
../src/vulkan/wsi/wsi_common_display.c:1238:4: error: implicit declaration of function 'pthread_setcanceltype' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); ^

../src/vulkan/wsi/wsi_common_display.c:1238:4: note: did you mean 'pthread_setname_np'? /data/data/com.termux/files/usr/include/pthread.h:352:5: note: 'pthread_setname_np' declared here int pthread_setname_np(pthread_t __pthread, const char* __name); ^

../src/vulkan/wsi/wsi_common_display.c:1238:26: error: use of undeclared identifier 'PTHREAD_CANCEL_ASYNCHRONOUS' pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); ^

../src/vulkan/wsi/wsi_common_display.c:1268:7: error: implicit declaration of function 'pthread_cancel' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pthread_cancel(wsi->wait_thread); ^

../src/vulkan/wsi/wsi_common_display.c:1268:7: note: did you mean 'pthread_once'? /data/data/com.termux/files/usr/include/pthread.h:275:5: note: 'pthread_once' declared here int pthread_once(pthread_once_t* __once, void (*__init_routine)(void)); ^

../src/vulkan/wsi/wsi_common_display.c:2183:10: error: implicit declaration of function 'pthread_cancel' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pthread_cancel(wsi->hotplug_thread);
I found out that pthread_cancel is not supported in the android libc.
Now, I don't know what to do...
 
  • Like
Reactions: roirraW "edor" ehT

skrowl

Senior Member
Aug 26, 2009
255
111
USA
www.denialofservice.org
Here's the Termux discussion about it here: https://github.com/termux/termux-app/issues/2366

Trust me that I spent a lot of time looking into it and there are no workarounds. You MUST root to use Linux in Android 12, period. Termux is no longer viable for background processes (like an X server), but you can still use it to do stuff interactively (working directly in your shell with Termux never losing focus). Your background processes will eventually get murdered by the OS and your X session will just suddenly go poof. It's sad too, because I really liked Termux.
 

shim80

Senior Member
Dec 18, 2010
84
23
Here's the Termux discussion about it here: https://github.com/termux/termux-app/issues/2366

Trust me that I spent a lot of time looking into it and there are no workarounds. You MUST root to use Linux in Android 12, period. Termux is no longer viable for background processes (like an X server), but you can still use it to do stuff interactively (working directly in your shell with Termux never losing focus). Your background processes will eventually get murdered by the OS and your X session will just suddenly go poof. It's sad too, because I really liked Termux.
Just tried, and yeah, you right...
I though "acquire wakelock" would fix that, but I never used Linux though X11 more than 5 seconds...
Why do the OS ever do that?
 
  • Like
Reactions: roirraW "edor" ehT

skrowl

Senior Member
Aug 26, 2009
255
111
USA
www.denialofservice.org
You should just probably wait until you've had your tab s8 long enough that you're satisfied it won't need to be returned and are willing to void the warranty by rooting it. Come back to playing around with linux then. Until then, just install linux in a VM on one of your computers and VNC into it with your tablet.
 
  • Like
Reactions: roirraW "edor" ehT

shim80

Senior Member
Dec 18, 2010
84
23
You should just probably wait until you've had your tab s8 long enough that you're satisfied it won't need to be returned and are willing to void the warranty by rooting it. Come back to playing around with linux then. Until then, just install linux in a VM on one of your computers and VNC into it with your tablet.
Wait... Even with root, termux-x11 will still not work, won't it? It's a problem from android 12 itself.
I don't want to use VNC since it's too slow.
 

skrowl

Senior Member
Aug 26, 2009
255
111
USA
www.denialofservice.org
Wait... Even with root, termux-x11 will still not work, won't it? It's a problem from android 12 itself.
I don't want to use VNC since it's too slow.
Check https://gist.github.com/agnostic-ap...#how-to-disable-the-phantom-processes-killing , they talk about commands you can run (as root) to disable the phantom process killing, which would allow termux to run. That said, termux's proot is MUCH MUCH slower than real chroot.

On localhost, you're very unlikely to be able to tell a difference between old school x11 and vnc. Wayland improves it somewhat, but it's probably still a very negligible difference on a local machine.
 
  • Like
Reactions: roirraW "edor" ehT

vxllvxn

New member
Oct 14, 2022
3
0
Check https://gist.github.com/agnostic-ap...#how-to-disable-the-phantom-processes-killing , they talk about commands you can run (as root) to disable the phantom process killing, which would allow termux to run. That said, termux's proot is MUCH MUCH slower than real chroot.

On localhost, you're very unlikely to be able to tell a difference between old school x11 and vnc. Wayland improves it somewhat, but it's probably still a very negligible difference on a local machine.
You can execute this via adb btw
 

sosimple

Senior Member
Aug 20, 2017
2,518
165
50
Greece
www.youtube.com
Can anyone explain to us, newbies in Linux , who can't understand what is the difference between x11, Wayland, vnc. If we root the tablet, will Linux work fast, or it will work somehow like we run it in an emulator?
What is the best/fastest approach. If we do the fastest method, how slower will it work compared with, if it could work Linux internal as default os. Just an estimation. Because I'm thinking if I'll root it to install Linux.
Thanks,
 

CtrlAltCuteness

New member
Jan 23, 2016
1
0
Can anyone explain to us, newbies in Linux , who can't understand what is the difference between x11, Wayland, vnc. If we root the tablet, will Linux work fast, or it will work somehow like we run it in an emulator?
What is the best/fastest approach. If we do the fastest method, how slower will it work compared with, if it could work Linux internal as default os. Just an estimation. Because I'm thinking if I'll root it to install Linux.
Thanks,
If you are entirely new to Linux, you probably should not be doing this yet. If you need a comparison as to why I'm stating this, here is one that is probably not as good: it is similar to trying to do a professional figure skating move that they do in the Olympics while you are still learning how to just balance without falling.

In other words, learn more about Linux and also get used to using Linux on a normal desktop / laptop computer before trying to do such stuff on your mobile device.
 

sosimple

Senior Member
Aug 20, 2017
2,518
165
50
Greece
www.youtube.com
If you are entirely new to Linux, you probably should not be doing this yet. If you need a comparison as to why I'm stating this, here is one that is probably not as good: it is similar to trying to do a professional figure skating move that they do in the Olympics while you are still learning how to just balance without falling.

In other words, learn more about Linux and also get used to using Linux on a normal desktop / laptop computer before trying to do such stuff on your mobile device.
Thanks for the reply, but it actually isn't a reply as it doesn't explaining what i ask. What are the differences of all those. I have linux in my pc, although i don't use it much as i can use windows there. If Linux in tab s8 ultra is working very good, i might use it here as i can't use windows.
 

Renate

Recognized Contributor / Inactive Recognized Dev
There isn't. You probably mean colabora office. It's not very good..
Yeah, I was misled by the Wikipedia article. I did see that the Colabora stuff.

I don't use portable devices for anything productive.
At the most I'll use them with a BT keyboard to capture raw typing that will later get corrected/converted/used on a desktop.
 
  • Like
Reactions: Stogie87

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    But keep in mind, rooting will 1. Brick your KNOX chip permanent 2. Without KNOX chip, apps like secret folder, samsung pass and few more will stop working. 3. To root you need to unlock the bootloader which triggers the knox chip and permanently disables it and it cannot be recovered or enabled again since knox chip has a tiny fuse inside itself so when bootloader is unlocked it will burn the thin copper thread inside fuse and snap off that will permanently disable knox and this would also void your warranty when knox chip gets triggered and disabled.

    So take time think about it before doing it. Do you want warranty or not? Do you want to lose those apps that you may want to use later or already using?
    2
    Unfortunately, due to this issue: https://gist.github.com/agnostic-ap...#how-to-disable-the-phantom-processes-killing , you're going to need to root if you want to run Linux desktop apps on ANY Android 12 device.

    Once you root your Tab S8, install Linux Deploy (https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy), run it and install whichever distro you like (I chose Kali), and Remote Desktop Manager (https://play.google.com/store/apps/details?id=com.devolutions.remotedesktopmanager) to connect to it via VNC

    The only settings I had to change in Linux Deploy was changing the installation type to Directory and the installation path to
    Code:
    ${ENV_DIR}/rootfs/linux
    , but your mileage may vary depending on what distro you want to install. If you want to use your Android filesystem from Linux, enable mounts and mount /data/media/0 to /mnt/android.

    I haven't messed with PulseAudio, because I really just wanted full LibreOffice. Let me know if you get it to work. You may also want to go into GUI settings in Linux deploy and change the resolution to 1920x1200, but again it depends on your distro chosen.
    2
    Here's the Termux discussion about it here: https://github.com/termux/termux-app/issues/2366

    Trust me that I spent a lot of time looking into it and there are no workarounds. You MUST root to use Linux in Android 12, period. Termux is no longer viable for background processes (like an X server), but you can still use it to do stuff interactively (working directly in your shell with Termux never losing focus). Your background processes will eventually get murdered by the OS and your X session will just suddenly go poof. It's sad too, because I really liked Termux.
    2
    You should just probably wait until you've had your tab s8 long enough that you're satisfied it won't need to be returned and are willing to void the warranty by rooting it. Come back to playing around with linux then. Until then, just install linux in a VM on one of your computers and VNC into it with your tablet.
    Wait... Even with root, termux-x11 will still not work, won't it? It's a problem from android 12 itself.
    I don't want to use VNC since it's too slow.
    1
    Hello,
    I want to use Linux on my Galaxy Tab S8+ through Termux and proot distro (Arch, actually).
    (...)
    If you are still interested in Linux (for example, Ubuntu) on a smartphone, then take a look at the thread full of inspiration.