Jump to content

Archlinux container in Termux with graphical environment


Recommended Posts

Hello,

In case of someone would be interested, I try archlinux container in termux with Xfce and it works perfectly for the pro1 with Xserver-XSDL apk. It also works with VNC but without sound.
I can now listen music, use Libreoffice and firefox and play with my programming tools.

Pro1's keyboard works prefectly (qwerty version here)

Very nice discovering a new linux distro.
It's not so hard and the documentation is very complete.
 
Source installing archlinux :
https://github.com/SDRausty/termux-archlinux

When you have done this, $ startarch (in Termux) and you will go in a root session.
Then if you want to create a User, (using sudo for root) :
$ startarch c 'addauser user'
$ startarch l user

Dont forget this in order to make LibreOffice working (in Termux):
$ bash setupTermuxArch.sh re

Make this working with XSDL server :
https://github.com/sdrausty/TermuxArch/issues/73
 

Screenshot_20211006-081456_XServer_XSDL.png

  • Like 7
  • Thanks 2
Link to post
Share on other sites

Nice job! Always good to see I am not the only one using the Pro1 as an actual computer ... 😎

4 hours ago, raymo said:

It also works with VNC but without sound

By using XRDP as a wrapper around VNC, you can forward sound from the VNC session to an RDP client (I recommend MS Remote Desktop 8 as it seems to work best with the Pro1's keyboard). This way you do not need a separate XServer on Android, and the Linux session can run in the background when disconnected. I gave an overview about such a setup in another thread. I do not use termux, but I guess it cannot install XRDP and the required PulseAudio drivers for you. You'll have to do that yourself from within your Arch system.

As I explained in this post, it is even possible to get rid of VNC altogether by using the (better performing) native X.org-backend of XRDP. However, that is even more complicated as it requires traditional shared-memory access from the Linux system.

Happy hacking.

  • Like 1
  • Thanks 1
Link to post
Share on other sites
Posted (edited)

@claude0001 Thanks for your answer. I must say, for me it's awesome what you've done, as I'm not a power-user like you. A Debian CLI with full access in Android, whaow ! So Geil !
It's very interesting, however I'm not sure I have the level to do that (not yet, but you really help opening my mind).

I play a little whith termux, scripting inside Arch in order to automatize display and launching Xfce.
However I don't find solution launching XSDL apk from bash script yet, and java and object-oriented programming languages is not my cup of tea (not yet ?).

As Archlinux run in a container inside Termux, I have full access inside the data/data/com.termux directory. So I'm planning doing something at this level for external files managment.

The really fun is ability controlling hardware parts and toast in lineage via termux-api inside my Linux desktop. I will be happy playing with this for a little time I guess 😄

Edited by raymo
typo
  • Like 2
Link to post
Share on other sites
4 hours ago, raymo said:

I play a little whith termux, scripting inside Arch in order to automatize display and launching Xfce.
However I don't find solution launching XSDL apk from bash script yet,

Termux is a nice project and has some interesting features. But as an in-app solution, I guess it will always be somewhat limited. That is why I decided to install everything from scratch by myself. Note that, in the beginning, I also knew nothing about chrooting Linux distros on phones: the Pro1 is my first Android device. Do not give up!

The reward for all the work and learning is that I have now a GNU/Linux distro running really in parallel to LineageOS, which allows me to use the Pro1 like an actual PC, while neither disturbing the Android environment nor depending on it in any way (except for the kernel, of course). I can SSH into my Pro1 for CLI access or file transfer. I can remote-desktop into it, which will spawn a fresh KDE desktop or reconnect to an existing session. I can start arbitrary GNU/Linux background processes via cron. All without relying on any supporting Android apps -- though it is of course possible and useful (thanks to the keyboard!) to have Android SSH or RDP clients ready for accessing the GNU/Linux environment on-device.  

Yes, it was some work to get there. But it seemed like this was the only way the Pro1 could at last replace my beloved N900 ... 😉 

Edited by claude0001
  • Like 3
Link to post
Share on other sites

Do you mean a Linux distro running really in parallel with Android like @claude001 ?

I'm digging into this, but it will take me lot of time with learning so for this I can't help you at this moment.

For setting the archlinux container in Termux I can maybe help you.

Link to post
Share on other sites
4 hours ago, PokeParadox said:

I've not got around to trying again, do you have a more recent set of steps I could follow? I don't seem to have much luck getting this set up.

I am ready to help, but I would first need to know what you are failing at ...

Please have a look at this post, and try to understand it, following the links I provided.

The first step is to prepare an SD-card with a partition containing the GNU/Linux distribution. This is best done from an existing (x86) Linux-PC using qemu as described in the first link of my post. As most modern Linux distros are based on systemd (which cannot run in an Android chroot), I suggest Devuan which uses traditional System-V init. It is possible to change the init system also in vanilla Debian, but that adds one more layer of complexity to the project you may want to avoid. 😉

Upon startup of LineageOS, that "Linux" partition of the SD-card is mounted via the Chroot script attached to said post of mine. Then, the script starts a few services within the Chroot environment, the most important ones being SSH and XRDP. On LineageOS, running the script can be automated by placing it into /data/local/userinit.d and installing the Run Userinit App from F-Droid. Note that the App -- as the Chroot script itself -- requires a rooted LineageOS.

With the SSH and XRDP servers running in the background, they can then be used for accessing the GNU/Linux environment, either remotely or by using suitable Android client-apps on the Pro1 itself.

Of course, you cannot just copy my Chroot script blindly. You should install your own system step-by-step, adjusting the script as required. Obviously, it is also good to first test the individual commands from an interactive (root) shell of LineageOS before trying to automate things using the script.

If we continue this discussion, it should probably be moved to another/a new thread, as this is explicitly about not using Termux now ...

Edited by claude0001
  • Like 3
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms