Magisk-Modules-Alt-Repo / chroot-distro

install linux distributions on android
GNU General Public License v3.0
143 stars 9 forks source link

Add desktop environment support using Termux X11 #49

Open nglmercer opened 3 weeks ago

nglmercer commented 3 weeks ago

I think it would be great to add support for running a desktop environment in the chroot distro using Termux X11..

Basic implementation would include:

  1. Add Termux X11 dependencies:

  2. Create a simple startup script:

Benefits:

jjkola commented 3 weeks ago

Thanks for the idea. Just to clarify, do you mean that Termux will run X11 server, and the distro in the rootfs will connect to that?

nglmercer commented 3 weeks ago

Yes, exactly!

jjkola commented 3 weeks ago

Unfortunately I only have one device which is rooted, and it is Android 7 device. Thus, I can't help with this as Termux X11 requires at least Android 8. Pull requests are welcome to address this case in the README file.

kivinblue1 commented 2 weeks ago

I think it would be great to add support for running a desktop environment in the chroot distro using Termux X11..

Basic implementation would include:

1. Add Termux X11 dependencies:

2. Create a simple startup script:

Benefits:

* Native graphical application support

* Better user experience for desktop users

* No need for VNC or external X servers

Unfortunately I only have one device which is rooted, and it is Android 7 device. Thus, I can't help with this as Termux X11 requires at least Android 8. Pull requests are welcome to address this case in the README file.

This is my own script for using termux-x11:

`echo "Creating Termux-X11 server process"

XDG_RUNTIME_DIR=${TMPDIR} termux-x11 :0 -ac &

sleep 0.5

echo "Created"

echo "Mounting X-Server…" su -c busybox mount --bind $PREFIX/tmp /data/local/chroot-distro/deb>

bind for termux-x11 server in chroot mode

sleep 0.5 echo "Completed"

echo "Creating shm…" su -c mkdir /dev/shm

make shm folder in default android tmpfs /dev

sleep 0.3 echo "Completed"

echo "Fix chmod…" su -c chmod 1777 /dev/shm

sleep 0.2 echo "Completed"

any user can use /dev/shm

echo "Mounting to fix sudo…" su -c busybox mount -o remount,dev,suid /data

remount for suid usage under /data folder

sleep 0.5 echo "Completed... Login in to root..." sleep 0.5

su -c chroot-distro login debian`

Then when you're inside chroot just type: export DISPLAY=:0

dbus-launch --exit-with-session startxfce4 &

nglmercer commented 2 weeks ago

It works but for some reason the process ends suddenly, gives some warnings with dbus, and I tried it on different devices anyway thanks for the contribution