how to run a command in chroot environment

i have command like simple helloworld print exe i need to run in chroot environment what are the steps i need to follow in Fedora 6
Who is Participating?
In a nutshell you  need to put everything the programm will need in the directory where you whant chroot to.
- the program itself
- libraries it is linked to
- configuration files
- optionally you'll need to create inodes for devices it will access

Example is attached

Another example of root usage would be to have a whole unix system and run a chrooted shell, I do that often with debian when I don't want to mess with the hosting system.
# ldd /bin/echo =>  (0xb7f28000) => /lib/i686/cmov/ (0xb7dbe000)
        /lib/ (0xb7f29000)
#mkdir -p /tmp/chroot/lib/
#cd /lib
#cp /tmp/chroot/lib/
#cp /bin/echo /tmp/chroot/
#chroot /tmp/chroot ./echo toto

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.