-
Notifications
You must be signed in to change notification settings - Fork 377
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
termux.com #224
Comments
Do you want to run docker containers on android? Is there a docker for android?
Another approach mentioned there is X server XSDL. I'd assume that it is more performant than a VNC setup. If docker runs on android, an x11docker option |
I don't think it is possible to run docker containers on android. Anyway, that's not my target. x11docker/runx provide multiple features to set up servers/clients to get remote X11 access. Tricks such as using xvfb and xpra might be useful as an alternative to VNC. Does it make sense? |
x11docker or runx do not really provide remote setups. They only make it easy to run an X server. x11docker wiki describes setups how to remotely access the X server. |
It is possible to run docker containers on Android (it's also available in Termux), but most stock Android kernels do not come with the relative features configured in the kernel like cgroups etc., so a recompile is normally necessary. Another option for Android is to add another backend option instead of docker, podman. Chroot works out of the box on rooted Android handsets: https://ericcurtin.wordpress.com/2022/01/14/more-than-a-pi-alternative-aarch64-environments/ https://github.com/ericcurtin/limux In fact I think many would appreciate this. Linux on Android works great as a desktop replacement, once you have a USB-C dock you can attach physical keyboard & mouse, HDMI monitor, etc. |
Thank you for the suggestion! I'll have a look how this could be done. Basically it should be possible to use Just to note, a chroot environment does provide no security at all compared to a container. One target of x11docker is to provide a sandbox-like environment which is impossible with I've never used a smartphone and have no experience with Android. Is there an Android VM that I could use for test runs? I once tried one for other reasons but failed to set it up, and never tried again. Is (To be honest, I am suspicious about smartphones at all ;-). I use a phone to phone and a computer for computer things.) |
chroot is not possible without a rooted device, but there is an alternative called proot that does not require a rooted device. Performance is not as good using proot (vs chroot), but still much faster than a Raspberry Pi 4 (at least on my mid-range Qualcomm 765, see blog post above), so still worth it. udocker supports proot as one of it's options, good find! Android works, because it's still a Linux kernel, albeit a modified one. |
Tested udocker unrooted (good idea, didn't know about this), it works just fine without UI once you do a:
Also a minor thing about the documentation, is assuming you are not using an x86 Android device, you should probably do this: https://github.com/indigo-dc/udocker/pull/354/files But because udocker on Android instructions suggest proot, there is a performance hit and I could not get UI working (not because of performance, performance is still decent unrooted). I've only successfully got UI working on rooted devices with chroot. But there's loads of options, maybe one of them works unrooted, I have never attempted any of these:
as suggested on the udocker page. |
I don't know |
First success! Setup:
In another terminal run an X server with:
Get the shown
Running
|
The above error for xterm is possibly because your container does not have the correct access to /dev/pts on the Android host, this is a snippet from a script I wrote, note /dev and /dev/pts must be mounted separately:
|
I am still on a regular Debian laptop, no Android involved yet. :-) proot provides a mount option that does not need root privileges. Edit: |
Some code pieces:
First test with fakechroot, but somehow it does not find executeables in
Reduced setup for proot to get xterm running. (Option
|
Recent master introduces experimental support for Run x11docker with:
If Some features like Currently I have unexpected issues to generate a rootfs without using docker or podman. I can pull images with The intention is to provide a rootless tool independend from docker or podman that pulls an image with the help of |
Just asking for help: So I have a base layer tar, and to this I want to add the content of another layer tar. (Possible existing same files in the base layer tar should be overwritten.) Edit: never mind, I found a solution with |
I do the opposite kinda here (pipes always comes to mind first for me too for this type of behaviour 😄 ):
in this script. https://github.com/ericcurtin/limux/blob/main/limux.sh It extracts a tarball from a tarball without an extraction to disk in-between by using stdout/stdin |
I've written a script Current syntax: It needs By default the image is pulled from Docker hub. Alternatively the image name can be specified with the |
Meanwhile I consider to add support for I did some first tests with There seems to be no |
chroot performs twice as well as proot on Android and I've yet to see a UI working with proot (but haven't tried this yet) so it has some value. But I'll try and test I have not used command line options on Android XSDL, I just start the XSDL app, then in termux (or ssh) set the following environment variables before you run the DE and it normally works:
|
Out and about, but just tried an install on my unrooted Android device this is how it went, will have a peek later:
|
What a mess ... :-) There seem to be severe differences between a regular Linux and Android. Today I have installed an Android VM to try out. |
Just noted that you tried an unrooted Android. There you cannot install x11docker in the system, obviously. You can download it with:
If possible, run However, from further error messages I see that it won't work yet. Edit: I did some fixes, it will run less messy now. However, I'll need to run some tests in an Android environment myself. |
I got a basically working setup with If I share everything that is needed to get a graphical terminal running in chroot (same as in your Limux script), it will mess up the host. Thunderbird has graphical issues and won't start again, new terminals cannot be started. Using I'd say Some code for After all, Limux already supports
Why does your Currently I think it makes more sense to enhance Limux where desired than to adopt x11docker to Android. |
Gonna try proot soon, it's a good start. I had to unroot my device anyway as some apps were refusing to operate while my device was rooted. I thought your suite of container images could be useful :) Since many DE's don't work well out of the box in containers. |
They are available for Limux, too, if converted to a rootfs with image2rootfs. KDE and Gnome3, Cinnamon and others based on gnome-shell won't work ootb; the according x11docker images rely on systemd. They would need to be based on a system like alpine using another init system like openrc. If you have issues with desktops in proot/chroot, I am happy to help. Side note: Instead of using XSDL a setup with Running xpra server with X server Xvfb in the container and xpra client on android host could be an interesting setup. However, no GPU support here, too. Edit: A thread on GPU acceleration in Termux: https://forum.xda-developers.com/t/guide-running-linux-on-android-with-3d-acceleration-opengl-root-required.4093343/ Currently I try some setups with |
Closing due to inactivity. As already said, I won't adopt x11docker to Android yet. maybe I'll give it another try if I have a valid Android device, maybe a fairphone. If you need help setting up desktops in proot with Limux, I am happy to help. Most desktop issues can be fixed with a valid user setup in |
OnePlus 6's are brilliant too. They can run many Linux distros. Reasonably priced 2nd hand. |
Currently, the suggested approach to use X11 apps in termux is tigervnc: https://wiki.termux.com/wiki/Graphical_Environment
@mviereck, can x11docker be useful in this environment?
The text was updated successfully, but these errors were encountered: