Linux chroot under OpenBSD /bin/bash: Exec format error
*BSDThis forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
First off, the operating system syscall numbers (which any non-trivial program is more than likely going to call) are different, as well as the method for calling syscalls.
Second, Linux-compiled libraries will need to be present (i.e. a Linux binary wouldn't be able to call an OpenBSD library of the same name as the Linux library it needs).
Third (and perhaps most critically), even if you got everything else to line up properly, the calling conventions are different between Linux and OpenBSD (Linux passes parameters in registers and uses the stack for overflow parameters, OpenBSD passes all parameters on the stack).
Fourth, Linux emulation was removed from OpenBSD many, many moons ago (which required syscall emulation and linux libraries to be installed).
FreeBSD has Linux emulation. I'm not sure about OpenBSD. However, do take heed that the Linux emulation binaries are not as modern as a true Linux system.
Ahh, you're right. There was a discussion around removing it, but it wasn't actually removed (I don't use Linux compat, so I never bothered following the conversation to completion). Looking at CURRENT sources, I see /usr/src/sys/compat/linux...so the code is still there, it seems.
It's no longer in the default kernel build, however, so running Linux binaries would require a custom kernel.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.