How to install a full GNU/Linux distro into a chroot container? And what are the limitations?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
How to install a full GNU/Linux distro into a chroot container? And what are the limitations?
Is it possible to install a full GNU/Linux distro into a chroot container and then VNC into it with graphics? How might we do it? And why is there no tutorials on that?
Somebody likened it to running a distro off a live CD, and modern docker/containers could be viewed as a similar concept to a chroot jail in terms of apps or whole operating systems as an alternative to virtualization.
And this concept resulted in a very popular application on Android named Linux Deploy; however, it seems that chroot is not without it's limitations, resulting in only a minimalistic installation of GNU/Linux with restrictions on what can be done inside.
Unfortunately, there's just not enough information/discussion on how it works and why there would be limitations sharing the same kernel. For example, apparently not all commands will work under a chroot container - but since nobody seems to be testing full distros outside of Linux Deploy it's hard to know.
i'm pretty sure linux deploy weren't the only ones using this technique, and i'm pretty sure it can run a GUI, too, yes.
isn't e.g. Ubuntu on ChromeOS (crouton?) essentially the same?
It doesn’t work because apart from the files, the chroot’ed system would share everything with the main system, in particular the process table (how can you run two copies of init?), networking and inter-process communication.
Now there is a technology that separates the process table, networking, IPC, the mount table etc. and allows you to run several Linuxes on top of the same kernel. It’s named “containers”.
Yeah, containers/dockers would be the ultimate, but I don't think this is possible on Android without redoing the whole kernel. Therefore, LinuxDeploy appears to have been achieved entirely from CHROOT and BusyBox.
LinuxDeploy downloads a minimalistic distribution and then somehow gets it up and running within a CHROOT jail, albeit usable for the most part, but not fully functional; hence many apps like GParted doesn't start up and neither do heavyweight desktop environments.
I tried to do a CHROOT myself inside a rooted android phone, but I kept coming across commands that didn't work, and I wouldn't know what sources to consult for CHROOT jails anyhow.
Can anyone reproduce a list of commands that might be used by LinuxDeploy to get an OS up and running on a restricted Android version of Linux? https://github.com/meefik/linuxdeploy
You may want to ask your question in the Android forum. Before you do that, mark it as Closed here, so that it doesn't attract other forum participants.
You may want to ask your question in the Android forum. Before you do that, mark it as Closed here, so that it doesn't attract other forum participants.
I would rather get to know CHROOT itself under a normal environment before I focus on Android, so this is more a general topic to try to get further info about CHROOT and it's capabilities/constraints as a function within Linux at large. Again, I came here because I don't understand how the kernel/distro work together (see my other topic), and I want to know the best resources for CHROOT as a precursor to containers. I've seen it used for bringing the main data partition back to life, so I will also start a new topic about GRUB and UEFI and how we can manage "dead" partitions. I got a book called Linux Server Administration, but it's explanation of GRUB was pitiful to say the least.
So what's the furthest anyone has got with CHROOT beyond the basics? I really want to know what it can do in terms of getting close to running full GNU/Linux distros in parallel. Please don't answer all at once!
Is it possible to install a full GNU/Linux distro into a chroot container and then VNC into it with graphics? How might we do it? And why is there no tutorials on that?
Quote:
Originally Posted by gilius
Can anyone reproduce a list of commands that might be used by LinuxDeploy to get an OS up and running on a restricted Android version of Linux? https://github.com/meefik/linuxdeploy
you are asking questions in a way that answering them would mean to give you a full, step-by-step walkthrough of something you envisioned.
in other words, a satisfactory answer would mean doing all of your work.
also this is becoming increasingly android-specific, and android instructions are often device-specific, and rarely a simple "list of commands".
Quote:
Originally Posted by gilius
So what's the furthest anyone has got with CHROOT beyond the basics? I really want to know what it can do in terms of getting close to running full GNU/Linux distros in parallel.
you keep saying there's no information on the subject, but have you researched?
may i ask which search engine and which terms you are using?
Yeah, I am after a step-by-step guide unless one already exists?
I did some research on Google, which revealed a few use case scenarios that were not tailored to my goal of a full distro. I also found a couple of books were published, but I don't know how comprehensive they are.
Therefore, all the info I came across seemed very fragmented, so not a good starting point for me.
Is Android Linux really that different? I thought it used the Linux kernel like all the desktop distros - but with Java on top instead of a desktop environment. Could it be that they use stripped-down kernels? One of my questions in another topic is: does the kernel exist in as many variations as the distros?
Is Android Linux really that different? I thought it used the Linux kernel like all the desktop distros - but with Java on top instead of a desktop environment. Could it be that they use stripped-down kernels?
yes, and yes, and yes, not only stripped down but also containing blobs.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.