LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-15-2019, 04:28 PM   #1
gilius
LQ Newbie
 
Registered: Feb 2019
Posts: 13

Rep: Reputation: Disabled
Question 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.
 
Old 02-16-2019, 08:16 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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?
 
Old 02-16-2019, 03:45 PM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
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”.
 
Old 02-17-2019, 07:17 PM   #4
gilius
LQ Newbie
 
Registered: Feb 2019
Posts: 13

Original Poster
Rep: Reputation: Disabled
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
 
Old 02-17-2019, 07:25 PM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
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.
 
Old 02-17-2019, 07:58 PM   #6
gilius
LQ Newbie
 
Registered: Feb 2019
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
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!
 
Old 02-18-2019, 01:59 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by gilius View Post
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 View Post
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 View Post
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?
 
Old 02-18-2019, 01:54 PM   #8
gilius
LQ Newbie
 
Registered: Feb 2019
Posts: 13

Original Poster
Rep: Reputation: Disabled
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?
 
Old 02-18-2019, 02:07 PM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by gilius View Post
I did some research on Google
maybe you should consider escaping the search engine filter bubble.
tried https://www.startpage.com/ or https://duckduckgo.com/ ?

Quote:
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux container host os and container os question jzoudavy Linux - Newbie 1 09-01-2015 05:21 AM
LXer: Inside the Open Container Project: How Docker plans to unite the container market LXer Syndicated Linux News 0 06-23-2015 04:30 AM
chroot install of arch fails, no mounted / in a chroot. Shadow_7 Arch 2 04-20-2015 04:33 PM
why do optical discs have minute limitations as well as size limitations? newbiesforever General 9 02-09-2014 04:35 AM
chroot to run hd-installed distro's programs from chroot in live distro? silencestone Linux - Software 0 10-12-2007 06:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration