LinuxQuestions.org
Visit Jeremy's Blog.
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 12-28-2022, 04:36 PM   #1
no-windose
Member
 
Registered: Jun 2018
Posts: 94
Blog Entries: 2

Rep: Reputation: Disabled
chroot for beginners


I am beginning to experiment with chroot. I am using the Ubuntu Help page although I am running Debian:

https://help.ubuntu.com/community/BasicChroot

Here is my progress so far:

Quote:
# apt install schroot debootstrap
# cd /etc/schroot/
# nano schroot.conf
# tail -7 schroot.conf
[bullseye]
description=Debian Bullseye
location=/var/chroot
priority=3
users=user
groups=sbuild
root-groups=root
# uname -a
Linux desktop 5.10.0-20-amd64 #1 SMP Debian 5.10.158-2 (2022-12-13) x86_64 GNU/Linux
# head -1 /etc/apt/sources.list
deb http://ftp.us.debian.org/debian/ bullseye main
# /usr/sbin/debootstrap --variant=buildd --arch amd64 bullseye /var/chroot/ http://ftp.us.debian.org/debian/dist/bullseye
E: Unable to execute target architecture
May I ask why I am getting this error message and what to do about it?
 
Old 12-28-2022, 05:29 PM   #2
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Question

Hi

Why are you experimenting with it, on what hardware; I assume that's different commands of [code] not quotes?
 
Old 12-28-2022, 05:36 PM   #3
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Quote:
Originally Posted by no-windose View Post
Code:
 # /usr/sbin/debootstrap --variant=buildd --arch amd64 bullseye /var/chroot/ http://ftp.us.debian.org/debian/dist/bullseye
Is "--variant=buildd" correct? Is it supposed to be two 'd's?
 
Old 12-29-2022, 02:40 AM   #4
xlfs-0.2
Member
 
Registered: Oct 2022
Posts: 207

Rep: Reputation: 44
# /usr/sbin/debootstrap --variant=buildd --arch amd64 bullseye /var/chroot/ http://ftp.us.debian.org/debian/dist/bullseye


Your trying to run an (old) installer script that makes a DEBIAN ROOT for install disks: but your getting an error from UBUNTU who apparently would rather that job be left to themselves? Otherwise it'd be working! it wasn't (maybe is now, but wasn't) made for making configure chroots.

Try making your own chroot using Busybox, a slackware boot disk, something. There's not much to it: just a standard list of files that need to be copied.

INFACT: JUST

# cp -a /dev /lib /lib64 /bin /sbin /tmp/foo
# mkdir -p /tmp/foo/var /tmp/foo/tmp ...
# chroot /tmp/foo

(now, that'll be a huge chroot in ubuntu, perhaps you need a huge one perhaps your seeking a busybox size one and can preen things)

NOTE: CHROOT AND JAILS ARE NOT SECURE (freebsd jails if kernel supported ... have some extra security)

It only tells the kernel where to read files for (the session / logged in user). It literally does NOTHING else.

But the effect is as strong as you think: you can run older, same, even newer "roots" without effecting the root you booted from in the other console window. (um, you can effect the other window easily - it's just you have to want to. no applications will do that usually no worry there. there's no security, as i said, between chroots.)

Last edited by xlfs-0.2; 12-29-2022 at 02:43 AM.
 
Old 12-29-2022, 06:40 AM   #5
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Maybe a virtual machine (Virtualbox, KVM, GNOME Boxes &c...) would work?
 
Old 12-29-2022, 09:49 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
... or a container.

"chroot" is a comparatively weak technology. Containers have taken the whole idea much farther, using newly-added kernel features to create strong isolation (and phantom perceived environments) while the processes in question continue to run natively on the host. They're also generally much easier to manage. There's Docker, of course, but also "lxc/lxd."

The clear advantage of containers is that they are lightweight. The processes are "wearing rose-colored glasses," but they are still running "on the host." Container technology now is quite mature, with several good options to choose from, so that's how I would do it today.

Last edited by sundialsvcs; 12-29-2022 at 09:53 AM.
 
3 members found this post helpful.
  


Reply

Tags
chroot



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
[SOLVED] in chroot compiled programs do not work in chroot graphit Linux From Scratch 2 04-11-2010 03:04 AM
chroot to run hd-installed distro's programs from chroot in live distro? silencestone Linux - Software 0 10-12-2007 06:29 AM
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 10:30 AM
mount command not working in chroot. and now chroot not working mohit.jain Linux From Scratch 5 07-14-2006 03:57 AM
to chroot or not to chroot complus Linux - Security 4 02-29-2004 04:07 PM

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

All times are GMT -5. The time now is 03:54 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