Re: Mono C# In chroot
Originally Posted by
Paris.K
Hello,
I 'd like to run some C# programs in a chroot. I copied the following inside my jail
- My program (program.exe)
- /bin/sh and libraries found by ldd
- /bin/bash and libraries found by ldd
- /usr/bin/mono
- /usr/lib/mono
When I try to run my program like this:
Code:
sudo chroot jail ./program.exe
, I get the error message that this program does not exist. Mono C# does not do Dynamic Linking, so I cannot find the libraries on which my program depends, by using ldd. Could you please help me with that?
Thanks
running Mono executables directly, as "./program.exe" (rather than as "mono program.exe") requires that /proc be mounted, and that the binfmt_misc kernel module be loaded, and that binfmt_misc be mounted to /proc/sys/fs/binfmt_misc, and that ':CLR:M::MZ::/usr/bin/mono:' be echoed into /proc/sys/fs/binfmt_misc/register
It's automated by the binfmt-support package
And I'd certainly not consider doing it inside a chroot. The Mono app deployment guidelines strongly caution against using "./foo.exe" rather than "mono foo.exe" precisely because it causes this kind of problem.
Understanding is a three-edged sword: Your side, their side, and the truth
Bookmarks