Running scripts/commands from a host system in a chroot environment.

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












First of all, I have inside an android Operating System a chroot environment created using Linux Deploy. I am able to access it from Android using a terminal emulator and root permission. I would like to run a script inside it. However, when trying to run the script, or even normal shell commands, it doesn't executes and returns this error:



"No such file or directory"



So, I am wondering, is it there a way to execute, from the host within a chroot environment, commands/scripts? Has the problem to do with the proper setting of the environment PATH variable?



I am able to execute ls command within the chroot environment but when printing with the -la argument it doesn't even show the . and .. directories. Could someone explain why is this happening and how could we overcome this issue?



P.D.: I've posted this issue in unix/linux stack exchange because I thought it concerns more to it. However, if you recommend me to also post it in stackoverflow or any other, I am open to do so.







share|improve this question
















  • 1




    You must of course populate the chroot environment before chrooting into it. To run commands it must have /bin, /sbin etc. with the commands in them.
    – AlexP
    Nov 6 '17 at 11:54










  • Actually, I can find them on the chroot environment. However, when executing it shows the error described above.
    – Santiago Nicolas Martin
    Nov 6 '17 at 13:20










  • If you have a correctly populated the chroot environment (including libraries for example), have you tried invoking the commands using their full pathname?
    – AlexP
    Nov 6 '17 at 17:01










  • I am currently trying to populate the chroot environment. I tried invoking the commands using their full pathname or even changing the PATH environment variable to search on the chroot bin but still didn't work.
    – Santiago Nicolas Martin
    Nov 7 '17 at 12:09














up vote
3
down vote

favorite












First of all, I have inside an android Operating System a chroot environment created using Linux Deploy. I am able to access it from Android using a terminal emulator and root permission. I would like to run a script inside it. However, when trying to run the script, or even normal shell commands, it doesn't executes and returns this error:



"No such file or directory"



So, I am wondering, is it there a way to execute, from the host within a chroot environment, commands/scripts? Has the problem to do with the proper setting of the environment PATH variable?



I am able to execute ls command within the chroot environment but when printing with the -la argument it doesn't even show the . and .. directories. Could someone explain why is this happening and how could we overcome this issue?



P.D.: I've posted this issue in unix/linux stack exchange because I thought it concerns more to it. However, if you recommend me to also post it in stackoverflow or any other, I am open to do so.







share|improve this question
















  • 1




    You must of course populate the chroot environment before chrooting into it. To run commands it must have /bin, /sbin etc. with the commands in them.
    – AlexP
    Nov 6 '17 at 11:54










  • Actually, I can find them on the chroot environment. However, when executing it shows the error described above.
    – Santiago Nicolas Martin
    Nov 6 '17 at 13:20










  • If you have a correctly populated the chroot environment (including libraries for example), have you tried invoking the commands using their full pathname?
    – AlexP
    Nov 6 '17 at 17:01










  • I am currently trying to populate the chroot environment. I tried invoking the commands using their full pathname or even changing the PATH environment variable to search on the chroot bin but still didn't work.
    – Santiago Nicolas Martin
    Nov 7 '17 at 12:09












up vote
3
down vote

favorite









up vote
3
down vote

favorite











First of all, I have inside an android Operating System a chroot environment created using Linux Deploy. I am able to access it from Android using a terminal emulator and root permission. I would like to run a script inside it. However, when trying to run the script, or even normal shell commands, it doesn't executes and returns this error:



"No such file or directory"



So, I am wondering, is it there a way to execute, from the host within a chroot environment, commands/scripts? Has the problem to do with the proper setting of the environment PATH variable?



I am able to execute ls command within the chroot environment but when printing with the -la argument it doesn't even show the . and .. directories. Could someone explain why is this happening and how could we overcome this issue?



P.D.: I've posted this issue in unix/linux stack exchange because I thought it concerns more to it. However, if you recommend me to also post it in stackoverflow or any other, I am open to do so.







share|improve this question












First of all, I have inside an android Operating System a chroot environment created using Linux Deploy. I am able to access it from Android using a terminal emulator and root permission. I would like to run a script inside it. However, when trying to run the script, or even normal shell commands, it doesn't executes and returns this error:



"No such file or directory"



So, I am wondering, is it there a way to execute, from the host within a chroot environment, commands/scripts? Has the problem to do with the proper setting of the environment PATH variable?



I am able to execute ls command within the chroot environment but when printing with the -la argument it doesn't even show the . and .. directories. Could someone explain why is this happening and how could we overcome this issue?



P.D.: I've posted this issue in unix/linux stack exchange because I thought it concerns more to it. However, if you recommend me to also post it in stackoverflow or any other, I am open to do so.









share|improve this question











share|improve this question




share|improve this question










asked Nov 6 '17 at 11:44









Santiago Nicolas Martin

163




163







  • 1




    You must of course populate the chroot environment before chrooting into it. To run commands it must have /bin, /sbin etc. with the commands in them.
    – AlexP
    Nov 6 '17 at 11:54










  • Actually, I can find them on the chroot environment. However, when executing it shows the error described above.
    – Santiago Nicolas Martin
    Nov 6 '17 at 13:20










  • If you have a correctly populated the chroot environment (including libraries for example), have you tried invoking the commands using their full pathname?
    – AlexP
    Nov 6 '17 at 17:01










  • I am currently trying to populate the chroot environment. I tried invoking the commands using their full pathname or even changing the PATH environment variable to search on the chroot bin but still didn't work.
    – Santiago Nicolas Martin
    Nov 7 '17 at 12:09












  • 1




    You must of course populate the chroot environment before chrooting into it. To run commands it must have /bin, /sbin etc. with the commands in them.
    – AlexP
    Nov 6 '17 at 11:54










  • Actually, I can find them on the chroot environment. However, when executing it shows the error described above.
    – Santiago Nicolas Martin
    Nov 6 '17 at 13:20










  • If you have a correctly populated the chroot environment (including libraries for example), have you tried invoking the commands using their full pathname?
    – AlexP
    Nov 6 '17 at 17:01










  • I am currently trying to populate the chroot environment. I tried invoking the commands using their full pathname or even changing the PATH environment variable to search on the chroot bin but still didn't work.
    – Santiago Nicolas Martin
    Nov 7 '17 at 12:09







1




1




You must of course populate the chroot environment before chrooting into it. To run commands it must have /bin, /sbin etc. with the commands in them.
– AlexP
Nov 6 '17 at 11:54




You must of course populate the chroot environment before chrooting into it. To run commands it must have /bin, /sbin etc. with the commands in them.
– AlexP
Nov 6 '17 at 11:54












Actually, I can find them on the chroot environment. However, when executing it shows the error described above.
– Santiago Nicolas Martin
Nov 6 '17 at 13:20




Actually, I can find them on the chroot environment. However, when executing it shows the error described above.
– Santiago Nicolas Martin
Nov 6 '17 at 13:20












If you have a correctly populated the chroot environment (including libraries for example), have you tried invoking the commands using their full pathname?
– AlexP
Nov 6 '17 at 17:01




If you have a correctly populated the chroot environment (including libraries for example), have you tried invoking the commands using their full pathname?
– AlexP
Nov 6 '17 at 17:01












I am currently trying to populate the chroot environment. I tried invoking the commands using their full pathname or even changing the PATH environment variable to search on the chroot bin but still didn't work.
– Santiago Nicolas Martin
Nov 7 '17 at 12:09




I am currently trying to populate the chroot environment. I tried invoking the commands using their full pathname or even changing the PATH environment variable to search on the chroot bin but still didn't work.
– Santiago Nicolas Martin
Nov 7 '17 at 12:09










1 Answer
1






active

oldest

votes

















up vote
0
down vote













It sounds like you may not have fully configured your chroot environment. Here are instructions for setting up a Debian chroot on Android:



  • https://wiki.debian.org/ChrootOnAndroid

There are lots of other OS-specific instructions online for setting up a chroot, e.g.:



  • Ubuntu chroot


  • Debian chroot


  • CentOS chroot


The bottom line is that you typically would install the programs into your chroot environment before trying to execute them. What have you done to setup your chroot?






share|improve this answer




















  • I have just installed a linux image using linux deploy app, which as I understand created a chroot environment. I was able to enter this chroot environment through the terminal emulator. I Don't know if I was totally clear with this, maybe I should rephrase the question.
    – Santiago Nicolas Martin
    Nov 6 '17 at 13:18










  • @SantiagoNicolasMartin Sure. Can you explain why you need (or want) to run scripts/programs from the host environment without installing them in the chrooted environment?
    – igal
    Nov 6 '17 at 14:05










  • Sure, It comes really from the need to install rockchip's gstreamer plugins on linux, as I am working on a video processing project. When running the installation script for this plugins from the chroot environment which is accessed via VNC, it doesn't find some files, which I suppose are on the host system which can't be accessed. Therefore, I am trying to see if running the script on the host environment could fix this issue and install the plugins on the chroot's linux.
    – Santiago Nicolas Martin
    Nov 6 '17 at 14:14











  • Why not install those files in the chroot environment?
    – igal
    Nov 6 '17 at 14:26










  • In fact, I do not know what are those files I am missing because I supposed they were already there on the package one can download from github. It seems I need extra stuff which seems to be no documentation about.
    – Santiago Nicolas Martin
    Nov 6 '17 at 15:30










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f402813%2frunning-scripts-commands-from-a-host-system-in-a-chroot-environment%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













It sounds like you may not have fully configured your chroot environment. Here are instructions for setting up a Debian chroot on Android:



  • https://wiki.debian.org/ChrootOnAndroid

There are lots of other OS-specific instructions online for setting up a chroot, e.g.:



  • Ubuntu chroot


  • Debian chroot


  • CentOS chroot


The bottom line is that you typically would install the programs into your chroot environment before trying to execute them. What have you done to setup your chroot?






share|improve this answer




















  • I have just installed a linux image using linux deploy app, which as I understand created a chroot environment. I was able to enter this chroot environment through the terminal emulator. I Don't know if I was totally clear with this, maybe I should rephrase the question.
    – Santiago Nicolas Martin
    Nov 6 '17 at 13:18










  • @SantiagoNicolasMartin Sure. Can you explain why you need (or want) to run scripts/programs from the host environment without installing them in the chrooted environment?
    – igal
    Nov 6 '17 at 14:05










  • Sure, It comes really from the need to install rockchip's gstreamer plugins on linux, as I am working on a video processing project. When running the installation script for this plugins from the chroot environment which is accessed via VNC, it doesn't find some files, which I suppose are on the host system which can't be accessed. Therefore, I am trying to see if running the script on the host environment could fix this issue and install the plugins on the chroot's linux.
    – Santiago Nicolas Martin
    Nov 6 '17 at 14:14











  • Why not install those files in the chroot environment?
    – igal
    Nov 6 '17 at 14:26










  • In fact, I do not know what are those files I am missing because I supposed they were already there on the package one can download from github. It seems I need extra stuff which seems to be no documentation about.
    – Santiago Nicolas Martin
    Nov 6 '17 at 15:30














up vote
0
down vote













It sounds like you may not have fully configured your chroot environment. Here are instructions for setting up a Debian chroot on Android:



  • https://wiki.debian.org/ChrootOnAndroid

There are lots of other OS-specific instructions online for setting up a chroot, e.g.:



  • Ubuntu chroot


  • Debian chroot


  • CentOS chroot


The bottom line is that you typically would install the programs into your chroot environment before trying to execute them. What have you done to setup your chroot?






share|improve this answer




















  • I have just installed a linux image using linux deploy app, which as I understand created a chroot environment. I was able to enter this chroot environment through the terminal emulator. I Don't know if I was totally clear with this, maybe I should rephrase the question.
    – Santiago Nicolas Martin
    Nov 6 '17 at 13:18










  • @SantiagoNicolasMartin Sure. Can you explain why you need (or want) to run scripts/programs from the host environment without installing them in the chrooted environment?
    – igal
    Nov 6 '17 at 14:05










  • Sure, It comes really from the need to install rockchip's gstreamer plugins on linux, as I am working on a video processing project. When running the installation script for this plugins from the chroot environment which is accessed via VNC, it doesn't find some files, which I suppose are on the host system which can't be accessed. Therefore, I am trying to see if running the script on the host environment could fix this issue and install the plugins on the chroot's linux.
    – Santiago Nicolas Martin
    Nov 6 '17 at 14:14











  • Why not install those files in the chroot environment?
    – igal
    Nov 6 '17 at 14:26










  • In fact, I do not know what are those files I am missing because I supposed they were already there on the package one can download from github. It seems I need extra stuff which seems to be no documentation about.
    – Santiago Nicolas Martin
    Nov 6 '17 at 15:30












up vote
0
down vote










up vote
0
down vote









It sounds like you may not have fully configured your chroot environment. Here are instructions for setting up a Debian chroot on Android:



  • https://wiki.debian.org/ChrootOnAndroid

There are lots of other OS-specific instructions online for setting up a chroot, e.g.:



  • Ubuntu chroot


  • Debian chroot


  • CentOS chroot


The bottom line is that you typically would install the programs into your chroot environment before trying to execute them. What have you done to setup your chroot?






share|improve this answer












It sounds like you may not have fully configured your chroot environment. Here are instructions for setting up a Debian chroot on Android:



  • https://wiki.debian.org/ChrootOnAndroid

There are lots of other OS-specific instructions online for setting up a chroot, e.g.:



  • Ubuntu chroot


  • Debian chroot


  • CentOS chroot


The bottom line is that you typically would install the programs into your chroot environment before trying to execute them. What have you done to setup your chroot?







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 6 '17 at 12:30









igal

4,830930




4,830930











  • I have just installed a linux image using linux deploy app, which as I understand created a chroot environment. I was able to enter this chroot environment through the terminal emulator. I Don't know if I was totally clear with this, maybe I should rephrase the question.
    – Santiago Nicolas Martin
    Nov 6 '17 at 13:18










  • @SantiagoNicolasMartin Sure. Can you explain why you need (or want) to run scripts/programs from the host environment without installing them in the chrooted environment?
    – igal
    Nov 6 '17 at 14:05










  • Sure, It comes really from the need to install rockchip's gstreamer plugins on linux, as I am working on a video processing project. When running the installation script for this plugins from the chroot environment which is accessed via VNC, it doesn't find some files, which I suppose are on the host system which can't be accessed. Therefore, I am trying to see if running the script on the host environment could fix this issue and install the plugins on the chroot's linux.
    – Santiago Nicolas Martin
    Nov 6 '17 at 14:14











  • Why not install those files in the chroot environment?
    – igal
    Nov 6 '17 at 14:26










  • In fact, I do not know what are those files I am missing because I supposed they were already there on the package one can download from github. It seems I need extra stuff which seems to be no documentation about.
    – Santiago Nicolas Martin
    Nov 6 '17 at 15:30
















  • I have just installed a linux image using linux deploy app, which as I understand created a chroot environment. I was able to enter this chroot environment through the terminal emulator. I Don't know if I was totally clear with this, maybe I should rephrase the question.
    – Santiago Nicolas Martin
    Nov 6 '17 at 13:18










  • @SantiagoNicolasMartin Sure. Can you explain why you need (or want) to run scripts/programs from the host environment without installing them in the chrooted environment?
    – igal
    Nov 6 '17 at 14:05










  • Sure, It comes really from the need to install rockchip's gstreamer plugins on linux, as I am working on a video processing project. When running the installation script for this plugins from the chroot environment which is accessed via VNC, it doesn't find some files, which I suppose are on the host system which can't be accessed. Therefore, I am trying to see if running the script on the host environment could fix this issue and install the plugins on the chroot's linux.
    – Santiago Nicolas Martin
    Nov 6 '17 at 14:14











  • Why not install those files in the chroot environment?
    – igal
    Nov 6 '17 at 14:26










  • In fact, I do not know what are those files I am missing because I supposed they were already there on the package one can download from github. It seems I need extra stuff which seems to be no documentation about.
    – Santiago Nicolas Martin
    Nov 6 '17 at 15:30















I have just installed a linux image using linux deploy app, which as I understand created a chroot environment. I was able to enter this chroot environment through the terminal emulator. I Don't know if I was totally clear with this, maybe I should rephrase the question.
– Santiago Nicolas Martin
Nov 6 '17 at 13:18




I have just installed a linux image using linux deploy app, which as I understand created a chroot environment. I was able to enter this chroot environment through the terminal emulator. I Don't know if I was totally clear with this, maybe I should rephrase the question.
– Santiago Nicolas Martin
Nov 6 '17 at 13:18












@SantiagoNicolasMartin Sure. Can you explain why you need (or want) to run scripts/programs from the host environment without installing them in the chrooted environment?
– igal
Nov 6 '17 at 14:05




@SantiagoNicolasMartin Sure. Can you explain why you need (or want) to run scripts/programs from the host environment without installing them in the chrooted environment?
– igal
Nov 6 '17 at 14:05












Sure, It comes really from the need to install rockchip's gstreamer plugins on linux, as I am working on a video processing project. When running the installation script for this plugins from the chroot environment which is accessed via VNC, it doesn't find some files, which I suppose are on the host system which can't be accessed. Therefore, I am trying to see if running the script on the host environment could fix this issue and install the plugins on the chroot's linux.
– Santiago Nicolas Martin
Nov 6 '17 at 14:14





Sure, It comes really from the need to install rockchip's gstreamer plugins on linux, as I am working on a video processing project. When running the installation script for this plugins from the chroot environment which is accessed via VNC, it doesn't find some files, which I suppose are on the host system which can't be accessed. Therefore, I am trying to see if running the script on the host environment could fix this issue and install the plugins on the chroot's linux.
– Santiago Nicolas Martin
Nov 6 '17 at 14:14













Why not install those files in the chroot environment?
– igal
Nov 6 '17 at 14:26




Why not install those files in the chroot environment?
– igal
Nov 6 '17 at 14:26












In fact, I do not know what are those files I am missing because I supposed they were already there on the package one can download from github. It seems I need extra stuff which seems to be no documentation about.
– Santiago Nicolas Martin
Nov 6 '17 at 15:30




In fact, I do not know what are those files I am missing because I supposed they were already there on the package one can download from github. It seems I need extra stuff which seems to be no documentation about.
– Santiago Nicolas Martin
Nov 6 '17 at 15:30

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f402813%2frunning-scripts-commands-from-a-host-system-in-a-chroot-environment%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay