I use Arch Linux as my primary OS and I work on a web app built for Centos. Initially I was using
LXC Container in my Arch to run a Centos, however due to problems configuring Network over Wifi etc I decided to find an alternative and someone suggested that
chrooting directly might work instead.
Currently I just use
LXC commands to create a Centos and just
chroot into it and work. I also mount the
/sys into my
chrooted environment. My web app works just fine with no problems.
Are there any concerns/caveats in this approach? I still haven't tried advanced things like
Java JVM yet. I know it uses the host system's Kernel, and I guess
System Calls are backward compatible in Linux (which is why this idea works), so everything should work as seamless as you would expect.
Still I would like to know if there are scenarios where you could get into problems using
chroot? Like are there any scenarios where
chroot might not work like a normal system? Logically I can't see anything as long as Kernels are backward compatible. The one place I can think of is when the Host system's Kernel has a different implementation compared to original Kernel and if there are bugs in that which is usually unlikely.
While I use Arch, I would like to get a general perspective. My main idea is to recommend this to my colleagues who don't use Centos as their primary OS due to various reasons. There are also use cases where you need a 32-bit machine on a 64-bit. Lot of them spent a lot of time setting up VM's etc but is that really needed for a Linux on a Linux "virtualization"? I personally feel
chroot is awesome and not just a debugging tool, however I wanted to get some expert opinion.