yashsingh1/xdaforums huggingface dataset:
[Android Q&A, Help & Troubleshooting] robherc:
OK, from that screenshot (well, what I could make out of it), it looks like you got a copy of busybox installed that has even worse permissions errors on your device than the one that originally came in the Complete Linux Installer App. Unfortunately, as I don't have direct access to your device, or another one of the same model, the best advice I can give you is to try other busybox installers until you find one that works. :/

If you are able to get a busybox executable installed that stops throwing all those "permission denied" errors, but still have a problem loading Linux, I'll be glad to help any way I can, but for right now it looks like it's just a matter of trying new busybox files until one works.

---------- Post added at 09:03 PM ---------- Previous post was at 08:59 PM ----------

I haven't tried yet myself, but I did see this link submitted by someone in the alpha testers' group: http://xdaforums.com/showthread.php?p=52804740
[Android Q&A, Help & Troubleshooting] lionking8600:
Any suggestions on where to start?
[Android Q&A, Help & Troubleshooting] mrhnet:
Thanks for being so helpful and taking time to reply to us! :)

Actually I got to know about selinux from what you explained several posts back. ;). I was thinking.. if I can run a script with "selinux enforcing" and the custom slimkat (kk) rom I'm using is actually running on JB kernel, so maybe the "selinux" not properly working with me. But, what you explained could be the case. It would be nice, if someone can confirm that the "script" method works in a Stock KK rom.

Edit: I can run the script even after commenting out the first "setenforce=0" line. Maybe selinux not working in my rom as intended..

Init.sh had the "external-sd" typo which I corrected, but it didn't solve the issue. (In fact, I was accessing external_sd without problems in JB even with that typo, I think). But now the problem is, BOTH the /sdcard and /external_sd are not accessible without root. Googled a bit, and found this solution (and I'm learning quite a lot btw.. ;)).

Problem was the permissions. If I do "ls -ld /sdcard" it shows that "root" is the owner and GID is 1028. But, in init.sh sdcard-rw group is added with GID 1015. Although user "ubuntu" was added to the sdcard-rw group, "ubuntu" can't access /sdcard because of GID mismatch. That part of init.sh..

# Fix for sdcard read/write permissions by Barry flanagan
chown ubuntu /external_sd/
groupadd -g 1015 sdcard-rw
usermod -a -G sdcard-rw ubuntu

So, the solution is to modify the sdcard-rw group with the correct GID. For that..

groupmod -g 1028 sdcard-rw

..at terminal prompt. (Add sudo if doing in vnc). Exit and start ubuntu again. Now both sd cards are accessible without root.

Now if I do...

root@localhost:/# ls -ld /sdcard
drwxrwx--x. 76 root [Highlight]sdcard-rw[/highlight] 4096 May 29 16:33 /sdcard

.. /sdcard owner is root, but sdcard-rw group has access. :victory: (Pardon if I'm using wrong linux geeky terminology :p, I'm still learning ;)). No idea why the GID changed from 1015 in JB to 1028 in KK??

Off topic: doing "su ubuntu" at terminal (root) prompt lets us to type/work as user "ubuntu" there. I find vnc quite difficult when it comes to typing things in cli. (su=substitute user). Just sharing this..
[Android Q&A, Help & Troubleshooting] pkantue:
Thanks alot for the comment. I actually did have the

if [ $? == 0 ];then USB2Mounted="Yes"; fi

but just didn't write it in the post.

I didn't have check if the directory already exists. I will add that promptly.

Thanks again!
[Android Q&A, Help & Troubleshooting] robherc:
I would probably start by doing a Google Play search for "Busybox." Then simply try each free app that claimed to install a busybox for your android version (or your kernel version) and see if any of them work. Failing that, we may have to look into compiling a custom busybox executable for you, and getting its permissions set correctly.

I'm sorry userdelroot, but I think your message got "chopped" a bit when you posted it, could you please re-post?

Yes, that definitely sounds like SELinux enforcing mode is not enabled in your kernel.

Thanks so much for sharing this! I'm sure it will help several others who run into the same issue. Also, I think this means that I may have to start looking into ways to dynamically modify the bootscript's behavior based on detecting the version of android on a host system (oh boy!).

You're quite welcome, and I'm glad it helped :)
[Android Q&A, Help & Troubleshooting] lionking8600:
Okay been doing that for a better pay off the night and still no joy, found busy box installer had a script that fixed permissions and I saw sound changes just not the one I was looking for, so I'm guessing the latter option will have to do. Am I the only galaxy s5 user who has this problem or the only one here?
[Android Q&A, Help & Troubleshooting] mrhnet:
Or maybe create separate groups (eg: sdcard-rw1, ..2,..) for each GID and add the user to those groups, so would work in any case. I don't know whether linux-wise this is a dirty trick or whether it works. Just a suggestion.. ;)
[Android Q&A, Help & Troubleshooting] fastguy:
I've been investigating

I've been investigating these permission denied errors. I'm not using this Linux-on-Android but the one called "Linux Deploy" that has a github.

I'm trying these on a 4.3 Galaxy Note 10.1 2014 Edition LTE, which has selinux Enforcing. First fact:

1) Samsung kernels including 4.3 and up in my finding does not let you change selinux Enforcing status. So even if you issue setenforce 0, it does nothing. So any script that uses it is just fooling itself. The result of the script needs to be checked with getenforce command and needs to give an error if it sees Enforcing.

So I compiled a new kernel and achived Selinux Permissive. I can also change Enforcing and Permissive on this one using setenforce. However, this is also not enough.

2) Samsung and I guess many other Android systems do not let you run executables from /data partition if they change the owner somehow. This is my own finding, but I'm expecting more experienced developer to give us the exact explanation. What I can say is that using adb shell and su, I can execute the commands. But when the command is run within another script, such as the linuxdeploy script or any other, then you get permission denied errors.

I found a workaround and maybe the developers of these linux installers can use it.

3) If you put all your executables to /system/xbin folder and symlink them to where you need in /data (if needed), then the scripts get executed. For example, to install Ubuntu Trusty using "Linux Deploy", I had to move the executables dd, mke2fs, linuxdeploy, debootstrap, busybox, bzip2 to /system/xbin, then create symlinks in /data/local/linux/bin directory (where they were before). Once I did it, I was able to install any linux I wanted.

There's another problem that I'm facing. But it can be off topic. Sudo does not work inside the chroot. It can be due to selinux reporting disabled inside the chroot Trusty though, I will investigate. I re-compiled sudo binary in Ubuntu Trusty using --disable-setreuid and --disable-setresuid flags, but still getting setuid error. The mount options for the loop device does not have nosuid, and I remounted /data with suid enabled, but still doesn't help. CAn be selinux or kernel related even if selinux is permissive. (I'm seeing seclabel option in the mount options, which I dont' manage to remove).

Back to the topic. Conclusion from my side:

==> I recommend the Linux deployment app builders to install their app as a system app, maybe then it may work. All executables shall be in the /system partition. I did not try putting them anywhere else than /system/xbin, but one can give it a try.
[Android Q&A, Help & Troubleshooting] lionking8600:
Okay that sounds like a lot of work but will give it a go, I also tries Linux deploy but it just failed
[Android Q&A, Help & Troubleshooting] fastguy:
Tough part is selinux, if you already have a permissive kernel, then just check the binaries you have. Normally there are many commands 95% of them point to single busybox binary, so remains a handful like in the case of Linux Deploy. I guess in this linux-on-Android, it's similar. The scripts can remain where they are, just the binaries need to be moved. Then you need to put symlinks to their original location so that existing scripts can still function.
[Android Q&A, Help & Troubleshooting] lionking8600:
You mentioned you made a kernel that worked would it be possible to do the same for the galaxy s5?
[Android Q&A, Help & Troubleshooting] fastguy:
Yes, when Samsung releases the sources, you will probably have many kernel development for this device. You can even check the original and normal android development forums for your device. Maybe someone has already done it.
[Android Q&A, Help & Troubleshooting] lionking8600:
I found only 2 kernels will try them and hope it's not another long drawn process to hit a brick wall.
[Android Q&A, Help & Troubleshooting] userdelroot:
I was not going to post my project in here, but considering the dev's have not had any responses I will post it.

It is not to take away from this project but to assist users. As I may try to get the source for linux on android and incorporate my project script into linuxonandroid.

However for the time being.

If you have not been able to get this to work on your device, and would like another option

http://xdaforums.com/showthread.php?t=2627255

Try the above script. I would also like to see if this works with Enforceing enabled. As you place the script in /data/local

I have not heard of any issues on users devices with SeLinux so it is hard to say.

If you do not use the script it will give users an idea of how the system works from the terminal and you will learn!!!

[MENTION=5818021]robherc[/MENTION] hopefully it will give you some ideas for the bootscript.sh

Also if people are having issues please look through the above thread, as the issues there that have fixes could also fix your problems with Linux on Android.

For those having issues with the sdcards etc try using the following.

SUDO_USER="changeme"

echo "Setting up required android groups"
groupadd -g 1003 aid_graphics
groupadd -g 1004 aid_input
groupadd -g 1007 aid_log
groupadd -g 1009 aid_mount
groupadd -g 1010 aid_wifi
groupadd -g 1011 aid_adb
groupadd -g 1015 aid_sdcard_rw
groupadd -g 1018 aid_usb
groupadd -g 1020 aid_mdnsr
groupadd -g 1023 aid_media_rw
groupadd -g 1028 aid_sdcard_r
groupadd -g 1035 aid_sdcard_all
groupadd -g 2000 aid_shell
groupadd -g 3001 aid_net_bt_admin
groupadd -g 3002 aid_net_bt
groupadd -g 3003 aid_inet
groupadd -g 3004 aid_inet_raw
groupadd -g 3005 aid_inet_admin
groupadd -g 3006 aid_net_bw_stats # read bandwidth statistics
groupadd -g 3007 aid_net_bw_acct # change bandwidth statistics accounting
groupadd -g 3008 aid_net_bt_stack # bluetooth: access config files

echo "Setting up user/groups"
gpasswd -a ${SUDO_USER} aid_net_bt_admin
gpasswd -a ${SUDO_USER} aid_net_bt
gpasswd -a ${SUDO_USER} aid_inet
gpasswd -a ${SUDO_USER} aid_inet_raw
gpasswd -a ${SUDO_USER} aid_inet_admin
gpasswd -a ${SUDO_USER} aid_net_bw_stats
gpasswd -a ${SUDO_USER} aid_net_bw_acct
gpasswd -a ${SUDO_USER} aid_net_bt_stack
gpasswd -a ${SUDO_USER} adm
gpasswd -a ${SUDO_USER} sudo
gpasswd -a ${SUDO_USER} admin
gpasswd -a ${SUDO_USER} aid_graphics
gpasswd -a ${SUDO_USER} aid_input
gpasswd -a ${SUDO_USER} aid_log
gpasswd -a ${SUDO_USER} aid_mount
gpasswd -a ${SUDO_USER} aid_wifi
gpasswd -a ${SUDO_USER} aid_sdcard_rw
gpasswd -a ${SUDO_USER} aid_usb
gpasswd -a ${SUDO_USER} aid_mdnsr
gpasswd -a ${SUDO_USER} aid_media_rw
gpasswd -a ${SUDO_USER} aid_sdcard_r
gpasswd -a ${SUDO_USER} aid_sdcard_all
gpasswd -a ${SUDO_USER} aid_shell

# setup root groups
# is this needed? its root ?
gpasswd -a root aid_inet
gpasswd -a root aid_inet_raw
gpasswd -a root aid_inet_admin

Add the above to a script in the chroot enviroment and run it as root. Exit chroot and reenter chroot and see if the sdcard accessible. It should be.
[Android Q&A, Help & Troubleshooting] devwithzachary:
Of late our lead developer has been very busy with other projects including the very exciting new tablet Vixtel Unity

while this is great it has left LoA at a standstill for the past few months, during this time many community members have taken it on themselves to answer users questions and even work on their own fixes to bugs within the project. This is great but they have been left high and dry due to a lack of communication channels back to the main project.

Because of this we have decided its time to reform the project, moving far more than ever to git repositories allowing push requests for bug fixes. Over the next few weeks there will be alot of reforms to the projects structure and the result will be a cleaner and easier to use system.

With theses changes however come great new opportunity to join the project and help support and push it forward, of cause we will always welcome support from the community but we are now also looking for more people to officially join the team and help in a range of ways.

If you are interested in joining the team please fill out the form found HERE

The rules we are looking to fill are:

App Developer - You will help develop and update the Complete Linux Installer, will require java skills and be happy working with eclipse and git.

Linux Developer - You will help develop and maintain the supported Linux distributions as well as work on the bootscripts used by the app. Knowledge of Bash and C/C++ will be very useful as well as git

Support Assistant - We are regularly asked for support by users and really need more experienced community members to help with this, you will help within the forums as well as on IRC and via email (using our email help system). Good knowledge of LoA is useful but you do not need any programming skills

Designer - As the project has grown so has its need for good designs, from the website, to app UI to banners and adverts you will help shame a unified and recognizable LoA theme. Knowledge of design programs useful (Photoshop/GIMP etc.)

Web developer - We are also looking for web developers to join the team and help with the running of the website and other web based systems.

Applications will be open for up to a week or once we have suitable candidates for all the positions.
[Android Q&A, Help & Troubleshooting] lionking8600:
that's what I'm getting with Linux deploy
[Android Q&A, Help & Troubleshooting] fastguy:
You need to do the symlinking stuff I explained in my previous posts.

---------- Post added at 10:03 PM ---------- Previous post was at 10:01 PM ----------

Why don't you join forces with the Linux Deploy project, it already has a github and active community.
[Android Q&A, Help & Troubleshooting] devwithzachary:
I think there is plenty of space for both projects to co-exist, linux deploy has always been about building the distro on the device etc while we have always focused on pre configured downloadable installs.

Both have there advantages
[Android Q&A, Help & Troubleshooting] fastguy:
Righy, good luck to both them! I'll br willing to test. Waiting for a proper Trusty image, the one in the site seems pretty old alpha.
[Android Q&A, Help & Troubleshooting] lionking8600:
Okay run the script and this is what I keep getting

More permission errors
[Android Q&A, Help & Troubleshooting] lionking8600:
Gentleman we have lift off, all it took was a new kernel
[Android Q&A, Help & Troubleshooting] userdelroot:
awesome.

Apparently, the way it is done now, will not work on the new release of android per chainfire. No exec of binary files in /data and no more write ability to /system
[Android Q&A, Help & Troubleshooting] lionking8600:
Does anyone know where I can get the stock kernel? Switching kernels means I loose all the Se goodies, including private mode and all the files in it.
[Android Q&A, Help & Troubleshooting] robherc:
Stock ROM images all contain stock kernels as part of the image. The stock kernel can be extracted from those, but I think others would be better at helping through that exact process than I.
[Android Q&A, Help & Troubleshooting] userdelroot:
Just flash a stock image for the version you are using. use a recovery without wiping etc. that will fix the problem.
[Android Q&A, Help & Troubleshooting] wrsg:
Has anyone got this working on old or low-powered devices? I'm trying to see if I can get it working on a Galaxy Ace S5830. I think the kernel is probably missing a few needed features because I've been getting a 'Segmentation fault' but I haven't looked into it too deeply yet.
[Android Q&A, Help & Troubleshooting] robherc:
I don't know much/anything about that specific device, but I do know that you'll need a kernel that can support mounting the image file through a loop device. a "quick and dirty" check to see if you can find any loop devices in /dev or /dev/block might help a bit. ;)

Aside from that, I've heard success reports from some devices that were running some pretty old android versions (I think one was using froyo even), but I don't remember much for specifics on those.
[Android Q&A, Help & Troubleshooting] jayachar88:
LoA on any arbitrary device

My question may be bit more of a developer oriented question, but I do not have privileges to ask the question on the developer thread, so asking here. Hopefully it is not against the rules.

Is it possible to have Linux-on-Android running on any arbitrary device, that can be rooted ? I did read about the need to have a kernel that allows mounting a filesystem in loop mode, but beyond that any other requirement ?

Also, does the Linux system have access to Android device peripherals, like the video and audio peripherals ? Linux on PC or servers, require the right set of "device drivers" to access such peripheral devices, but since we seem to be talking of just installing the ARM-hf version of popular Linux distros, they might be lacking the device drivers, which are often proprietary (especially for Android devices).

There's a chance that I've not understood the LoA concept completely, since I've read of mostly accessing the Linux via VNC, but what would be the behaviour of something like a linux xmms (audio player) being run. It's UI would show up on VNC client, but would the audio really play from the Android speaker or head-phone ?
[Android Q&A, Help & Troubleshooting] devwithzachary:
Hello world!

Some kernels do not play well but as a rule of them as long as you have loop device support and SELinux is in passive mode yes it should work

The linux 'install' is a chrooted environment and shares the same Kernel as Android, we also mount Androids /dev partition (to make use of kernel features) so we do have access to everything Android does, graphic frame buffers, audio devices etc. The tricky bit is getting Android to stop using them long enough that you can take control of them in linux

Yes if you can use something like ALSA and find the right audio out device to write to you can play audio through the devices speakers, the tricky bit is in some devices actually working out which is the right device and having Android let you write to it as many devices (im lookng at you samsung) do not make this easy
[Android Q&A, Help & Troubleshooting] robherc:
Actually, considering that most of what you were asking about either is already included in Linux On Android, or is entirely device-specific, so must be completed by the end user, I would say that you asked this question in the perfect place :)

Aside from that, I don't think I have much to add to zachtheshpack's answers, so give him a "Thanks" if that helps you! ;)
[Android Q&A, Help & Troubleshooting] Sadigh:
Hi... can I use backtrack on LG G2?
[Android Q&A, Help & Troubleshooting] robherc:
I haven't heard any reports of that not working, Sadigh, so yes, you shouldn't have many problems there.
[Android Q&A, Help & Troubleshooting] wrsg:
I'm having problems running the Ubuntu image in LoA on a Galaxy Ace S5830 (aka cooper). The ROM is Omni 4.4.2 from a couple months ago.

I tried the instructions here https://android.stackexchange.com/q...-if-my-devices-kernel-has-loop-device-support to check if I have loop device support in the kernel (MA6) and I do.

http://pastie.org/9267702

That's the error. Anyone know what may be causing this?
[Android Q&A, Help & Troubleshooting] robherc:
My first guess would be that you're using one of the v7.8-v8.0 bootscripts, which attempt to mount all images as ext2 filesystems. If that is the case, then updating to the v9.0 bootscript.sh file according to the instructions in my FAQ should fix the error (or at least fix the *first* error).

If, however, you are already using the bootscript.sh v9.0 AND you are using an image file of ext4 type (android 4.3 & above doesn't necessarily like ext2 filesystems), then try editing the line in bootscript.sh (line 137) that currently reads:

$bbox mount -t auto /dev/block/loop255 $mnt

to make it read:

$bbox mount -t ext4 /dev/block/loop255 $mnt

After that edit, you'll likely need to reset the file's permissions with the following terminal command(s):

su
chmod 0755 /data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh
[Android Q&A, Help & Troubleshooting] mscion:
Note: Moved from development thread

Thanks for the rapid reply! Sorry about posting here. I actually forgot where I was and had thought I was in Q&A! Once this post is up I'll copy it and post it in Q&A. Anyways, The version I had tried to run was fedora 19 with Mate desktop (Mate is nice) . I tried what you suggested and it didn't work although I now have a more secure password! Anyways, I tried another image I had on my external sdcard ubuntu 13.10 with LXDE and it worked fine. That will do for now but if you have any other suggestions let me know. Thanks again!
[Android Q&A, Help & Troubleshooting] Kite-G:
Probably been mentioned a billion times, but im getting this

Is it a kernel issue? i'm using a stock kernel on my Nvidia Shield. i did all the settings right, i've run this on other devices.
[Android Q&A, Help & Troubleshooting] robherc:
Looks like your vnc server never started...did you get the "New X desktop is localhost:0" message in Android Terminal Emulator?

If not, then please post any error messages you get in the terminal emulator window, as these will help us find your problem easier.
[Android Q&A, Help & Troubleshooting] lionking8600:
It's official kali linux is ruining smoothly on my galaxy s5
[Android Q&A, Help & Troubleshooting] mscion:
Just an update. I had a backup of the Fedora IMG file and that one worked. So I'm good to go. Thanks!