Skip to content
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

Hi, how to run inside a proot-distro #138

Closed
xx1182 opened this issue Jul 15, 2022 · 14 comments
Closed

Hi, how to run inside a proot-distro #138

xx1182 opened this issue Jul 15, 2022 · 14 comments
Labels
bug Something isn't working

Comments

@xx1182
Copy link

xx1182 commented Jul 15, 2022

I usually run termux-x11 then proot-distro login Debian, export the display and xdce4-session and it says, cannot connect to display .

@xx1182
Copy link
Author

xx1182 commented Jul 15, 2022

@xx1182, run in Termux:

Lalalalalllalalallalala

Thanks it works, but I think it would be good to integrate into TERMUX, of course you can just edit .profile or whatever, but, would be good to pheraps include a termux-x11-proot-setup, which just edits .profile and aliases proot-distro login ... --shared-tmp

Regards

@waldhef
Copy link

waldhef commented Jul 15, 2022

@xx1182,
yes you can automate it with alias in your .bashrc or .profile file, but I for myself wrote a small shell script which runs all needed commands for me. It is for me simpler to backup if I need to reinstall Termux or like that.

The shell script looks like:

#!/data/data/com.termux/files/usr/bin/bash

# Enable PulseAudio over Network
pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1

# Prepare termux-x11 session
export XDG_RUNTIME_DIR=${TMPDIR}
termux-x11 :0 >/dev/null &

# Wait a bit until termux-x11 gets started.
sleep 3

# Login in PRoot Environment. Do some initialization for PulseAudio, /tmp directory
# and run xfce as user galaxy.
# See also: https://github.com/termux/proot-distro
# Argument -- acts as terminator of proot-distro login options processing.
# All arguments behind it would not be treated as options of PRoot Distro.
proot-distro login debian --shared-tmp -- /bin/bash -c  'export PULSE_SERVER=127.0.0.1 && export XDG_RUNTIME_DIR=${TMPDIR} && su - galaxy -c "env DISPLAY=:0 startxfce4"'

exit 0

Save it as start-xfce.sh for example and make it executable with:

chmod +x start-xfce.sh

As you can see in line 18 of the script, it starts the xfce session as user galaxy. It is because some apps are refusing to start as root user, eg. VLC. So you have first to create a user galaxy or some other name of you wish.
Therefore you have first to log in in your PRoot environment with:

proot-distro login debian

and create a new user

adduser SOME_NICE_NAME in my case: adduser galaxy

the script will ask you for a new password type one, all the other question you can skip.
After you are done, simple log out wit exit

Now you can start the script with ./start-xfce.sh (assuming you are in the same directory where the script is)
or with /path/to/script/start-xfce.sh if the shell script is in a different directory.

I think with Termux:API add-on or at least with Tasker add-on you can even make a starter on your home screen, which will start the script for you, so you even won't see Termux at all. But don't ask me how, never played with this add-ons.

@waldhef
Copy link

waldhef commented Jul 15, 2022

ACCIDENTALLY deleted previously comment:

@xx1182,
run in Termux:

export XDG_RUNTIME_DIR=${TMPDIR}
termux-x11 :0 >/dev/null &

Then log in in your PRoot environment with:

proot-distro login debian --shared-tmp

and run:

export XDG_RUNTIME_DIR=${TMPDIR}
env DISPLAY=:0 startxfce4

There is a HowTo for Ubuntu but you can do the same steps also for Debian:
RandomCoderOrg/ubuntu-on-android#152

PS.: if you want sound support, then run also in Termux:

pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1

and in your PRoot environment:

export PULSE_SERVER=127.0.0.1

just before starting the xfce4 session.

@twaik
Copy link
Member

twaik commented Jul 26, 2022

Can I close this issue?

@waldhef
Copy link

waldhef commented Jul 28, 2022

I think yes.
Since @xx1182 said:

Thanks it works

so his initially question is answered and this issue can be closed.

@xx1182
Copy link
Author

xx1182 commented Jul 28, 2022

Well, to be fair:
Ah it's all your fault, retard program not working, signal 9, fix it! It's your job!!! (It's not your fault)

Second, as suggested, when termux-x11 :1 , just automatically export display, just for convenience, regards.

@twaik
Copy link
Member

twaik commented Jul 28, 2022

  1. You did not post logs.
  2. It is not possible. termux-x11 does not start any session so it can not export variables.

@twaik twaik added the bug Something isn't working label Jul 29, 2022
@termux termux deleted a comment from v8karlo Aug 7, 2022
@twaik
Copy link
Member

twaik commented Aug 7, 2022

@v8karlo Issues are not the right place to advertise your project.

@zairullahdev
Copy link

zairullahdev commented Aug 7, 2022

Close this issue as not planned

@OrdinaryEnder
Copy link

Can someone filter this

@twaik
Copy link
Member

twaik commented Aug 7, 2022

@zairullahdev

Your phone is retard becuz it using android 12 so if your can't code a big project shut up

Termux organization members may be small and please don't try suing them. it is very unhelpful and they have life as well. Disruptive comments will be deleted

@OrdinaryEnder
Copy link

He already delete that so everything ok, can we close this?

@twaik
Copy link
Member

twaik commented Aug 7, 2022

I think so. I was waiting for positive response from xx1182 but he reported signal 9 (SIGKILL). I am planning to rewrite a significant part of code to get rid of this and then close 4 or 5 issues as cometed at once.

@twaik twaik closed this as completed Aug 22, 2022
@xx1182
Copy link
Author

xx1182 commented Aug 22, 2022

If anyone is interested, some guy just made a Termux plus visuals working on a single app, yeah it's a hack and whatever:

It's called VHEditor... It's not my project, I'm not advertising it, I just think that for the average person(how to hack Instagram account? Any of you know how to unlock iPhone trough termux) is a better alternative.

Of course I was joking, you do it in your free time, I'm not entitled to anything, if it doesn't work I should make it myself and fuck me.

I'm saying this, because maybe you can look in it's source code, as it's a simple VScode editor, and it doesn't sig-9, but I think it's because of termux because it's "an utility app" and android has specific blocks and dicks for specific: "file manager/video player etc".

Regards, again this is just news, suggestion, as I'm not entitled to anything, but just want to contribute. Thanks again! Bye.

@termux termux locked and limited conversation to collaborators Jul 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants