chroot vs lxc

New to Debian (Or Linux in general)? Ask your questions here!

chroot vs lxc

Postby Chrisdb » 2018-04-18 10:38

I would like to install some packages which aren't available in the repositories and for this I would like to use a virtual enviroment.

Can someone explain what the basic difference is between chroot and lxc?
Which one is best suited for this case?

Thx!!
Chrisdb
 
Posts: 23
Joined: 2018-04-10 07:16

Re: chroot vs lxc

Postby GarryRicketson » 2018-04-18 12:11

User avatar
GarryRicketson
 
Posts: 4797
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: chroot vs lxc

Postby Chrisdb » 2018-04-18 12:50

I've already looked around the internet, but I actually wanted to know which one would best suit my case and why:

Chrisdb wrote:I would like to install some packages which aren't available in the repositories and for this I would like to use a virtual environment


The reason why I choose a virtual environment is because I want to be certain not te break the system with third party packages....
Chrisdb
 
Posts: 23
Joined: 2018-04-10 07:16

Re: chroot vs lxc

Postby GarryRicketson » 2018-04-18 14:49

Well that is true, if one wants to experiment with packages which aren't available in the repositories, using a VM (virtual machine or environment)VE is the best and safest way to do that.
Personally I prefer a VM, and use QEMO, for that.
Others claim a VE , like Docker (for example only) and other methods, is more like "bare metal"
hardware,.... The only way I can think of to decide which is best for your particular needs is to experiment, try both methods, then decide for your self which one would best suit your case and why.
I've already looked around the internet

Just "looking around" is use less, you will see some people like a VM better, others prefer a VE, you need to actually try both methods, or select the one that
you understand well enough to install and setup.
In the search string I showed, but instead of just "looking" try reading some of the material, there are many results that go into great detail on the differences, for example: https://stackoverflow.com/questions/20578039/difference-between-kvm-and-lxc
OR here:https://www.quora.com/What-is-the-downside-of-chroot-compared-to-LXC-container-based-virtualization
Conceptually, lxc can be seen as a further development of the existing 'chroot' technique with extra dimensions added. Where 'chroot'-ing only offers isolation at the file system level, lxc offers complete logical isolation from a container to the host and all other containers"

I am sure others will jump in here with their opinions, shortly.
User avatar
GarryRicketson
 
Posts: 4797
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: chroot vs lxc

Postby Head_on_a_Stick » 2018-04-18 16:58

Chrisdb wrote:I would like to install some packages which aren't available in the repositories and for this I would like to use a virtual enviroment

Virtualisation is relatively slow (even with hardware acceleration) and resource-intensive so I would always prefer the container approach, where possible.

viewtopic.php?f=16&t=129390

See also viewtopic.php?f=16&t=47078
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 7455
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable