EXALAB / AnLinux-App

AnLinux allow you to run Linux on Android without root access.
Apache License 2.0
1.65k stars 243 forks source link

[Help] Remote control (AnLinux-Windows/Ubuntu) #133

Open FranGamer1892 opened 5 years ago

FranGamer1892 commented 5 years ago

I've tried both NoMachine (couldn't connect yet) which either uses NX or SSH, or TeamViewer (doesn't work at all). I really want to control my AnLinux (Ubuntu with XFCE4) from my PC.

Any suggestions for connecting from my PC (Windows/Ubuntu) to AnLinux, please feel free to leave them.

I'd rather not using root, but if I need to I will (maybe if I got to use SSH).

Another question, does no-root openssh support work on LAN or just within the cellphone?

anony11 commented 5 years ago

It works really well with the VNC protocol? Just look up for VNC Windows client. As why it doesn't work, it's probably cause you didn't configure NX or SSH trough X(The Display Manager), cause usually on Android the display 0 is already used so you have to set 1 line in the config to say "USE DISPLAY 1"(it's pseudoconfig, i don't know which clients you use), in the X startup script of the various Clients.

And not problems with using non-root ssh, but also ssh has to be configured(even on PC if it is not installed, like an Ubuntu Minimal)

FranGamer1892 commented 5 years ago

Right, but, just to clarify, what are...

  1. The advantages of using termux with root permissions (regarding OpenSSH).

  2. The exact instructions to connect from my Windows/Linux PC (Connect with phone's public or local IP, which port to use, etc)

Also, why can't I vncserver-start when launching my AnLinux Ubuntu from "Rooted Termux" sort to speak.

anony11 commented 5 years ago

1)If by rooting you mean, ROOTed phone, that means you could simply run X and access every device(screen, sensors) and proprietary driver at a kernel level, and you could run Android in Linux.

If you mean rooted Ubuntu, root it's just in simple terms Administrator account(windows speaking), basically an used whereas root is the "root of operation".(I don't know your expertise so could not be simple to explain)

2)If you follwed instructions, you could simply run vncserver-start and input your lan ip(192.168.memes.number) in a vnc client(look vnc client on google), and the default port... And you can't connect to the phone while you are on cellular network, cause the infrastructure it's different, Pheraps you could, Pheraps you can't... your carrier knows, and you could ask them to give you a public ip, etc... whereas your home internet is more controllable.

3) You can, but think of like this, The Ubuntu you install is a "program"(you run start-ubuntu) and when you install things it installs them inside that "program" vncserver-start it's just inside ubuntu-fs/bin/vncserver-start. You could try copy that file inside /bin folder I didn't try if it works from outside Ubuntu, simply cause the scripts calls some variables that Termux hasn't set, for exemple:

[Memes.sh] cd ./$HOME/myfolder

Would open the folder in the "system variable " HOME. So in termux it is sent differently.

It's kind how the OPERATIVE SYSTEM is set. Ubuntu it's just a """suite of programs

FranGamer1892 commented 5 years ago

I get that. Thanks. Also, on point number 1 I think you got the wrong idea, I know the meaning of "root" and that stuff. To be honest, you were closer at first. What I meant was this: and this:

FranGamer1892 commented 5 years ago

Summed up: What's the difference of running ./start-ubuntu.sh with root permissions or none? And why can't I use vncserver-start when having Root permissions?

FranGamer1892 commented 5 years ago

Tried these:

Considered

  1. Both PC and Phone connected to same Wifi
  2. No firewall
  3. No vpn
  4. Using same port I use on my cellphone

Tried all of them but all expire/fail.

FranGamer1892 commented 5 years ago

By the way, used hostname -I on Termux > Ubuntu to get those IPs

anony11 commented 5 years ago

Well, the description is a bit off Like said, Ubuntu it's just a "collection of programs" try to do apt install in Termux, it it's just aliased to pkg". Basically won't work with SU, cause the way the Kernel is modified, they advise you to install tsu, a modified version of SUDO 1)By running Ubuntu with root, you just have all the programs Ubuntu give you, + ROOT, that means accessing everything and you could break "the system" 2)It changes much cause of Proot whicnh is like running Ubuntu as a separate process, Google for "chroot proot differencies" 3)About ssh, it says this server you can install it in termux and configure it by your own... 4)SSH and VNC are 2 different things, SSH is like "remote command line" while vnc is desktop, you should look first in "install DE" section so you can run VNC

FranGamer1892 commented 5 years ago

Didn't understand point 3. Also, already got the "collection of programs" thingy and what's addressed on point 4. I just want to know how to use VNC since I've followed your instructions, and it hasn't worked for me and why can't I run vnc using tsu (obviously inside Ubuntu)

anony11 commented 5 years ago

The explanation is a bit off: They mean: "the script which install ssh is configured to allow certain acess"; you could just apt install ssh, but then you have to configure it by yourself...

About VNC, if you followed the instructions on " install DE" it's just a matter of "vncserver-start", now, could you tell what errors does it give to you? And, have you tried connecting from your own device (installing a vnc client on android)?

Pheraps the VNC server is configured to only allow localhost.(Which then it's just as easy as changing 1 line in the config)

Lastly, tsu is installed in Termux and not in Ubuntu... Like said, Ubuntu runs in Proot, which is vaguely(really vaguely) like running a Virtual Machine. Ubuntu should "already be root"

FranGamer1892 commented 5 years ago

I know tsu is installed in Termux. But if you do:

tsu ./start-ubuntu.sh

What are the advantages ssh-wise and why can't I run vnc-server on Ubuntu when tsu (on Termux) previously launched?

Also, I can enter with localhost:5901 from my Android device. It's probably what you said. What line do I need to add, and where?

FranGamer1892 commented 5 years ago

Not add, change*

anony11 commented 5 years ago

Apologises for the late reply, but: By running with su or sudo (what's tsu?) you have elevated privileges, by that, you have access to all the device filesystem, this means you could do "rm -rf /" and delete the entire content of the phone making it Unbootable, one easy advantage would be this: The x display manager is "The thing" that makes " things have graphics", to function it needs access to the screen device, usually you can't, you don't have privileges, but with privileges you can use the screen, by this I mean without VNC any other things... That's was just an exemple, an analogy to "I have a bike, what's the advantages of having a wrench?" many things, depends.

On the second question I could just advice you(don't know the program): Usually settings files are located it /etc/programname , you are looking for VNC, there should be some conf or textfiles, and there should be a line that says: ADRESS/BIND(or something similar) set to 127.0.0.1 or localhost, you should set that to 0.0.0.0(which roughly means "ANY ADRESS")

REGARDS

anony11 commented 5 years ago

0.0.0.0 means anyone can connect, even from internet, if you want only from your local network, you should set it to your phone LAN IP "192.168.me.me" (the last two aren't me.me but, some numbers, like 1.2 or 0.2"

FranGamer1892 commented 5 years ago

tsu is the command/program the tutorial uses for root on termux. it's written in the root section of the app

FranGamer1892 commented 5 years ago

i know i should be able to connect from my pc with 192.168.(something).(something) plus the port (:5901) but I can't and I have no clue why. By the way, I'm using VNC Viewer in my pc.

PS: I'm using hostname -I to get my local ip. I tried all ips provided.

anony11 commented 5 years ago

Oh, I've seen it, basically it's a modified "SU/SUDO" program. Advice to not run as root if you aren't familiar with linux. Pheraps it could not be your fault, but there was a time a popular package(gnome maybe?) had an update with a 1 line messed up, with rm / instead of rm ~/ and you can guess, it deleted the entire system! It was fixed few hours later, but still

anony11 commented 5 years ago

Look on your router what is the adress of your phone, cause it works for me

FranGamer1892 commented 5 years ago

Alright, I'll do it when I'm back home.

El lun., 12 de ago. de 2019 11:28, anony11 notifications@github.com escribió:

Look on your router what is the adress of your phone, cause it works for me

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EXALAB/AnLinux-App/issues/133?email_source=notifications&email_token=ADEKT6FP3FT6AJH6S5HTER3QEFXPPA5CNFSM4IGZRL52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4CWRIQ#issuecomment-520448162, or mute the thread https://github.com/notifications/unsubscribe-auth/ADEKT6DTH4GSY23ISMWFLYTQEFXPPANCNFSM4IGZRL5Q .

exalab999 commented 5 years ago

tsu was actually usable on ly if your device already have root access, it is a wrapper that transfer device root access to Termux. Actually most of the connection from other device won't work without running with tsu for security reasons.