yashsingh1/xdaforums huggingface dataset:
[Android Q&A, Help & Troubleshooting] Kite-G:
Alright thanks for the response. Below is exactly what I got in terminal just now after launching. Usually it would only get to line 4, i would wait and since nothing happened i would type "exit" to close it. However, this time i deleted the Ubuntu.img and copied it again from my PC, and after typing exit it started. after all of that, i opened VNC and server started, got a gray screen. i'm thinking that i was supposed to type something other than "exit" for Ubuntu to start in the first place? I'm not an expert at this since i haven't used Linux terminal for almost a year.

u0_a85@roth:/ $
u0_a85@roth:/ $ cd /sdcard/ubuntu
u0_a85@roth:/sdcard/ubuntu $ su
root@roth:/ # exit
uxonandroid/files/bootscript.sh /sdcard/ubuntu/ubuntu.img <
/data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh[39]: dirname: not found
MD5 file found, use to check .img file? (y/n)
Checking loop device... MISSING
Creating loop device... OK
/data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh[151]: dirname: not found
mount: can't read '/etc/fstab': No such file or directory
mount: mounting /storage on /data/local/mnt/external_sd failed: Invalid argument
No user defined mount points
net.ipv4.ip_forward = 1
/data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh[231]: basename: not found
Starting first boot setup.......
groupadd: group 'android_bt' already exists
groupadd: group 'android_bt-net' already exists
groupadd: group 'android_inet' already exists
groupadd: group 'android_net-raw' already exists
mkdir: cannot create directory `/var/run/dbus': File exists

Now give your user account (named ubuntu) a password

Please enter the new password below

Enter new UNIX password: ubuntu

Retype new UNIX password: ubuntu

passwd: password updated successfully
chown: cannot access `/external-sd/': No such file or directory
groupadd: group 'sdcard-rw' already exists
Start VNC server? (y/n)
y
Start SSH server? (y/n)
y
Now enter the screen size you want in pixels (e.g. 800x480), followed by [ENTER]:
800x400

New 'X' desktop is localhost:0

Starting applications specified in /home/ubuntu/.vnc/xstartup
Log file is /home/ubuntu/.vnc/localhost:0.log

If you see the message 'New 'X' Desktop is localhost:0' then you are ready to VNC into your ubuntu OS..

If connection from a different machine on the same network as the android device use the address below:
eth0: error fetching interface information: Device not found

If using androidVNC, change the 'Color Format' setting to 24-bit colour, and once you've VNC'd in, change the 'input mode' to touchpad (in settings)
* Starting OpenBSD Secure Shell server sshd [ OK ]
Save settings as defaults? (y/n) (You can always change it later in the app)
y
Config saved to /root/cfg/linux.config

To shut down the Linux environment, just enter 'exit' at this terminal - and WAIT for all shutdown routines to finish!

root@localhost:~#
[Android Q&A, Help & Troubleshooting] robherc:
OK, I'm noticing a couple of things in your output that you pasted there:

#1: It looks like you're using a CyanogenMod ROM, probably build 11 or later. For some unfortunate reason, CM11+ doesn't seem to like the CompleteLinuxInstaller app, and tries to block it from running bootscript.sh, even when SELinux is set to permissive.

The "usual" workaround that I suggest for making this work would be to manually type in:

/data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh /PATH/TO/IMAGEFILE.img

with "PATH/TO/IMAGEFILE.img" replaced by the actual path to your linux .img file on your device. I'm rather surprised that "exit" worked for you, interesting, but I'm not sure how stable that workaround might be.

#2: Considering that CM11 is android 4.4.2-based, have you upgraded your bootscript.sh script to the v9.0 script following the instructions in my FAQ? The v7.8-v8.0 scripts that come with the CompleteLinuxInstaller app don't correctly mount the ext4 images that are required by android versions 4.3 and newer.
[Android Q&A, Help & Troubleshooting] Kite-G:
Followed the instructions on your FAQ to update my bootscript.sh, everything went fine. However, using "/data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh /PATH/TO/IMAGEFILE.img" didn't really change anything. Here's the terminal output. My device is on stock 4.3, so if SELinux is the problem, would going back to 4.2.2 make this work? or did I do something wrong?

u0_a85@roth:/ $ su
root@roth:/ # /data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh /sdcard/Ubuntu/ubuntu.img
nandroid/files/bootscript.sh /sdcard/Ubuntu/ubuntu.img <
/data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh[39]: dirname: not found
MD5 file found, use to check .img file? (y/n)
n
Checking loop device... FOUND
/data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh[151]: dirname: not found
mount: can't read '/etc/fstab': No such file or directory
mount: mounting /storage on /data/local/mnt/external_sd failed: Invalid argument
No user defined mount points
net.ipv4.ip_forward = 1
/data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh[231]: basename: not found
Config file loaded

New 'X' desktop is localhost:0

Starting applications specified in /home/ubuntu/.vnc/xstartup
Log file is /home/ubuntu/.vnc/localhost:0.log

If you see the message 'New 'X' Desktop is localhost:0' then you are ready to VNC into your ubuntu OS..

If connection from a different machine on the same network as the android device use the address below:
eth0: error fetching interface information: Device not found

If using androidVNC, change the 'Color Format' setting to 24-bit colour, and once you've VNC'd in, change the 'input mode' to touchpad (in settings)
* Starting OpenBSD Secure Shell server sshd [ OK ]

To shut down the Linux environment, just enter 'exit' at this terminal - and WAIT for all shutdown routines to finish!

root@localhost:/#

Thanks for your assistance.
[Android Q&A, Help & Troubleshooting] cb@note2:
Anyone else here using LoA on Samsung Note2 (GT-N7100) or a similar Sammy device (eg S3, S4)?

I did *not* upgrade to Android 4.4 (if it works, dont fix it) - so my Note2 is running 4.3 stock rom & kernel.

It took a bunch of investigations and mods to get Debian 8 up and running smoothly ...

There is a problem with the bootscript (v9), selinux and Debian 7.1 and up (incompatibility issue:

since Wheezy, the selinuxfs mountpoint is mounted under /sys/fs/selinux and not under /selinux anymore. Since jessie, the /selinux mountpoint is even completely gone.)

Although I found a workaround for the sudo/su -not-working issue, probably some of you have found better /native solutions?

Possibly we could help each other by sharing information and 'know-how' ...
[Android Q&A, Help & Troubleshooting] robherc:
OK, that's a bit strange that you're seeing that glitch on a stock 4.3 ROM. You're actually the first one I've seen a report of that from, every other person with that glitch of not automatically starting the bootscript was running a CyanogenMod11 ROM.

Anywise, the error about mount failing to mount "/storage" to "external_sd" can be ignored, that just means you don't have an SD card plugged into your device.

The errors about "dirname"and "basename" are problematic, however, as they signify a problem with the sh executable (probably built into a busybox) in your device "not playing with a full deck," to put it bluntly. I'd like to get those fixed before we go too far down other paths trying to find a culprit for a few things, as they're actually quite likely to be causing problems. I'll start working on another script (with full install instructions, making it as easy to install as the v9.0 bootscript.sh script) for you to use & see if we can workaround that error by using the sh portion of the LinuxOnAndroid included busybox.

Finally, can you verify for me exactly what image you're using? I want to be sure that you got an ext4 image, and not an ext2 image, as several people have had the "grey screen with a black 'X'" problem when using ext2 images on android 4.3 and later devices.

---------- Post added at 07:33 PM ---------- Previous post was at 07:26 PM ----------

Admittedly, I haven't gotten any of the debian images running myself yet. Since debian isn't one of my "personal favorite" distributions, I spent most of my effort so far on improving support for the distributions that I *was* able to get running.

With that said, I am of course interested in improving the script to make it more portable. Could you please let me know exactly how you were able to modify the script in order to get Debian v8 working on your device?
[Android Q&A, Help & Troubleshooting] Kite-G:
Alright thanks for helping me out and explaining everything in detail. :)

My Ubuntu.img is 13.04, the one linked from the app. It did say ext4 on the zip. I might download another img to try.
[Android Q&A, Help & Troubleshooting] robherc:
OK, I compressed a couple of files here for you: Download This

After downloading, please copy that file to /data/data/com.zpwebsites.linuxonandroid/files then execute the following commands in a rooted terminal:

cd /data/data/com.zpwebsites.linuxonandroid/files
tar -zxf scripts.tar.gz
exit
exit

That will install a softlink to /data/data/com.zp......./files/busybox ash and a script named start that you can use in place of busybox.sh when you manually run /data/data/com.zpwebsites.linuxonandroid/files/start /PATH/TO/IMAGEFILE.img

Next, here's a link to a "known working" ubuntu v13.04 ext4 version img file: Download Me

Once you've extracted that .img file, copy it to your chosen directory, and launch using the CLI app + the command I typed in above (the one using .../files/start /PATH/...)
[Android Q&A, Help & Troubleshooting] jayachar88:
Thanks for the answer.

Is there a deterministic way to check if the kernel has SELinux setup in passive mode ?

Are there any known and documented "tips, tricks and gotchas" for the "tricky bit" to get Android to stop using those devices "long enough" for us to take control of them in Linux ?

So the 2 key problems to solve would be to:

1. Find out the right device ! Is it tricky because the device names are unintelligible / encoded or there are more than one candidate devices for a given purpose ?

2. Get Android to relinquish control of the device for a Linux app to gain access to it. If so, then my other previous query about "tips, tricks, gotchas" should apply here.

Are there any known ways and means for an Android application to interact with a Linux application (or daemon, for instance) ?
[Android Q&A, Help & Troubleshooting] robherc:
Yes, first-off, if you're using a kernel from android version 4.2.x or earlier, this is not even a consideration, only 4.4.x and (maybe) 4.3.x support SELinux Enforcing mode.

If you are using one of the newer versions, then simply opening a Terminal Emulator window, typing "su" to switch to root (make sure your prompt changes from $ to #), then attempting to run a shell script (like /data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh if you're already installed the Complete Linux Installer app) will either tell you "Permission Denied: ...." if SELinux is in Enforcing mode, for run the script if SELinux is in Permissive mode.

There are other ways to tell, but "test-running" a script is the most effective, as that's where the issues arise for the LinuxOnAndroid work. ;)

I can't remember exactly where, but I've seen a few links to xda threads about "getting sound to work in a chroot environment" or something like that. That's not "my part" of development, so I can't help with many specifics, but a forum search might be a good "starting point."

If you go to the FAQ at: http://sourceforge.net/p/linuxonandroid/wiki/General FAQ/ and look around (I think in the "Advanced FAQ" section, there's a piece about "escaping the chroot environment" that deals with linux/android interactions specifically. ... It might be of help to you.
[Android Q&A, Help & Troubleshooting] cb@note2:
At least on my devices, the LoA (2.7.2) built-in busybox won't accomplish proper super user rights, whereas e.g. Stephen Erickson's bbox pro does (systemwide install to /system/xbin). So I had to edit bootscript.sh (v8, not 9 indeed! Where to find v9?) lines 30+ :: comment out the whole if clause, only leaving #35 pointing to the appropriate binary [export bbox=/path/to/working/busyboy]. But I think that's (almost) common knowledge, as many others encountered this problem too...

The more severe problem is at line 153 [$bbox mount -o bind /sys/fs/selinux $mnt/selinux] :

The selinuxproject & several distros were looking to standardize kernel subsystem file systems to be mounted under /sys/fs, which mostly means to move /selinux to /sys/fs/selinux. In Debian this was introduced by Wheezy, since jessie, the /selinux mountpoint is completely gone.

For Wheezy, that means: load_policy will first check if /sys/fs/selinux exists and mount the selinuxfs at this location, if it does not exist it will fall back to mounting the file system at /selinux (if it exists).

For Jessie (and up), that means: load_policy will check if /sys/fs/selinux exists and mount the selinuxfs at this location, if it does not exist it will return false (or *ptr -> NULL (?)) [so dpkg (and other selinux-aware tools) might fail - which they did on my side].

According to [0][1], the init functions of selinux will now check if /sys/fs/selinux is mounted, if it is and has an SELinuxfs mounted on it, the code will then check if the selinuxfs is mounted rw, if it is, libselinux will set the mountpoint, if it is readonly, libselinux will return no mountpoint. In Jessie [and other distros, which?] a check for RO is implemented to allow tools to be able to tell a chroot that SELinux is disabled while enforcing it outside the chroot.

As selinux implementations may vary on different platforms, imho and according to [2][3] the selinuxfs on the chroot should probably in general be mounted as readonly so the userspace in the chroot would think that selinux is disabled ('best practice') [again -otherwise, dpkg (and other selinux-aware tools) might fail - which they did on my side].

So, code of line 153+ then reads:

mount --bind /sys/fs/selinux $mnt/sys/fs/selinux

mount -o remount,ro,bind $mnt/sys/fs/selinux

...which fixes dpkg errmsg on 'missing security handles', messed-up apt database, etc (on my side :).

[0] http://comments.gmane.org/gmane.comp.security.selinux/15349

[1] http://permalink.gmane.org/gmane.comp.security.selinux/15870

[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734193

[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734454

---------- Post added at 06:06 PM ---------- Previous post was at 05:41 PM ----------

Uhm ... what does 'getenforce' (in terminal or adb shell) show?

It should display one of: Disabled, Enforcing or Permissive if your kernel is built with libselinux support, otherwise you should probably get something like 'sh: getenforce: command not found'.
[Android Q&A, Help & Troubleshooting] robherc:
Yes, now that work is resuming towards releasing a new version of the Complete Linux Installer app soon, I think that's one of the things that I'll suggest we work on...including a better busybox executable to address a few errors. If you check in my FAQ, I included a link to download the bootscript v9.0 script in there, along with instructions for getting it properly installed. However, both of the issues you addressed in your post will still require modifying the v9.0 bootscript, although it does address a couple of other bugs from the v8.0 version.

I'll definitely look into this, and see about adding a mount to bind /sys/fs/selinux to both $mnt/selinux and $/mnt/sys/fs/selinux to see if that will resolve the issue on Debian, without causing any potential issues with other/older builds. Thanks for the info :)
[Android Q&A, Help & Troubleshooting] cb@note2:
Thanks for your good work & sorry, I somehow missed your FAQ. I've already fetched the v9.0 script.

I'm not sure, but I don't think there's anything 'wrong' with LoA busybox binary - afaik SEandroid simply does, what it's made for ..implement & enforce access control over processes even running with superuser privileges, especially when run in /data/.

Please don't get me wrong, but I'd guess one bbox binary per system should be sufficient :) -so the bootscript could first check for bbox and continue (if it exists), else or in case of failure ('dirty flag') suggest /provide a small 'tailored'l bbox?

Anyway, I'd still be glad if there were more people around using LoA with Debian (or *bunu) on recent Sammy devices... especially if someone already found a ('native') solution for the su /sudo failure (Jessie).
[Android Q&A, Help & Troubleshooting] fastguy:
There are somehow different versions or implementations of busybox, this is what I've seen with many Linux installers (including the Debian kit one). The best and safest is to push your busybox binary (can be busybox.loa) and any other shell script to /system/xbin, this will solve many selinux related issues.

Now in Debian and Ubuntu, I have been unable to use sudo even if selinux was set permissive outside the chroot and even if the chroot recognized selinux as disabled.

---------- Post added at 10:14 AM ---------- Previous post was at 10:11 AM ----------

Btw, i even recompiled sudo without re- something support but then it gave suid related error when trying to use sudo.

This is all happening on Samsung 4.3 self compiled selinux permissive kernel.

I think I also need to enable suid and root Config parameters in kernel build.
[Android Q&A, Help & Troubleshooting] robherc:
Well, yes and no. SElinux blocking things *is* what it's made for, but in at least some devices (esp. Samsung devices running android 4.4.2), there are errors being thrown that can be corrected by simply overwriting our binary with another busybox binary in the same place. Errors like that tell me that it's time we look into upgrading our busybox binary. ;)

Well, firstly, many manufacturers include their own copy(s) of busybox in a build that are (ahem) custom tailored to "their requirements" (read "hacked to bits & intentionally not working right"). In my tablet, there are actually 2 different busybox installations that the manufacturer put in there, of two entirely different busybox versions, and still, neither of them has many needful applets configured to work right!

I think part of the purpose for the LoA busybox binary, besides obviously handling functions for the LoA bootscript, is to allow users to a more functions, and less constrictive busybox on devices where the user hasn't downloaded and installed their own custom busybox yet.

---------- Post added at 07:59 AM ---------- Previous post was at 07:57 AM ----------

I've seen the suggested at least a couple of other places, and will be sure to bring it up with whomever ends up "in charge of" that part of the project, once we get everything sorted for this upcoming build. Thanks :)
[Android Q&A, Help & Troubleshooting] Hod_:
Hi... I've purchase the pay version of program Complete Linux Installer, but, until now, I've no success about my tentatives;

I've followed all passages about the upgrade package, unzip and rename file that are placed in sdcard1/ubuntu/ubuntu.img

When terminal start, I've no resluts

I've a atrix hd, mb886 with a CM11... I'm so sorry, because, I've read a lot of messages like mine, but I've proceed with all alternatives without success.

what I have to do to proceed?
[Android Q&A, Help & Troubleshooting] robherc:
Yep, looks like something strange was going on with your ROM, since that's the biggest change you made this last time. Glad to hear everything's working right for you now :D
[Android Q&A, Help & Troubleshooting] fastguy:
I self compiled a Samsung kernel but disabled Samsung specific setuid and root protection defconfig parameters. This seems to work, even if I did not touch selinux settings, I can now set selinux permissive and the scripts run properly even if I don't move stuff to /system/xbin. So the key in Samsung stuff seems to be those few keys in the defconfig
[Android Q&A, Help & Troubleshooting] :
Just a heads up, I think i found some arm ports for chromeos?

http://chromium.arnoldthebat.co.uk/

not sure if this could be used in your project or not?
[Android Q&A, Help & Troubleshooting] robherc:
Thanks, I'll definitely be looking into that to see if maybe we could at least get one of their images setup to give users another OS option with LinuxOnAndroid.
[Android Q&A, Help & Troubleshooting] enedil:
Note that it is not a port of Chrome OS - it is a base for Chrome OS, it's Chromium OS. And it is known to work on ARM.

---------- Post added at 11:40 PM ---------- Previous post was at 11:39 PM ----------

Can you write a simple instruction how to accomplish that? I would be pleased.
[Android Q&A, Help & Troubleshooting] fastguy:
sure. just go to arch/arm/configs directory in your kernel source, check the .defconfig files. two of them start with msm.... one of these two has a section with necessary lines. search for SETUID keyword inside these files, find that section, convert their value from y to n

you have to do this after you issues the make command with parameters, before you issue make command alone to build.

the rest is to replace the zImage inside original boot img with the one you compiled and flash the boot image to the correct partition.
[Android Q&A, Help & Troubleshooting] Faizalfahmy:
Ubuntu permissive

I use note n7000..i use ultimate jelly bean 4.1.2..i download vnc for ubuntu..but if i open ubuntu from vnc show ubuntu need permissive..i want download selinux mode change..but cannot download becouse compatible for this version..please help me..i want ubuntu run on my android..
[Android Q&A, Help & Troubleshooting] Bait-Fish:
Heads up for anyone interested in getting Jump Desktop (RDP & VNC) free from Amazon's app store. It's a pretty good VNC client. Today, Saturday, is the end of the offer. Then it returns to $9.99.
[Android Q&A, Help & Troubleshooting] MarHazK:
happened to me too, any idea how to fix this?
[Android Q&A, Help & Troubleshooting] vpwrf:
I have also now got Jump Desktop but can't get double clicking to work. Is anyone else having this problem?

---------- Post added at 06:36 PM ---------- Previous post was at 06:29 PM ----------

I think it's something to do with Samsung's kernel and root protection. You could try a custom kernel and see if it solves the problem.
[Android Q&A, Help & Troubleshooting] robherc:
If you're having trouble with setgid, etc, when trying to su/sudo from inside VNC desktop on a LinuxOnAndroid image, try giving your VNC user sudo/su privileges from the Android Terminal Emulator session your linux is running in. In that session, you already have linux root access, so you can do things like: change root password for your linux image, and add/change users to/in the sudoers and setgid groups. ;)
[Android Q&A, Help & Troubleshooting] fastguy:
Samsung kernel has a setuid protection. I compiled a kernel without it and I was able to sudo after flashing it. (note 10.1 2014)
[Android Q&A, Help & Troubleshooting] emphiris:
hi,

I use ubuntu 12.04 lts large image with lxde. I login via terminal as root, but when in vnc precisely as" ubuntu" user instead of" root" user. In addition, I do not be able to access sdcard Because" read only". How to be able to access my sdcard ?

The way in the previous page was I do all.

For information, I use gionee e3 mtk6589 with gpu sgx544.

Please help

please more detail Where this command must be added?

sorry my speak English very bad
[Android Q&A, Help & Troubleshooting] emphiris:
(SOLVED) access vnc as root & sdcard-rw

very simple ..... :

1. open launcher LoA. Automatic as localhost:0 on vnc => user non root

2. via terminal. Type :

sudo vncserver :1 -geometry 1280x720 -depth 24

=> Creating default startup script /root/.vnc/xstartup

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/localhost:1.log

3. open androidvnc or bvnc, and change 5900 to be 5901

4. connect

5. and then.....tarraaa..... vnc as root, & sdcard + external_sd as RW

SO....:

localhost : 0 as non root user

localhost : 1 or 2...etc as root

enjoy .....