Chroot: Difference between revisions

From 太極
Jump to navigation Jump to search
(Created page with "* https://help.ubuntu.com/community/BasicChroot * https://help.ubuntu.com/community/DebootstrapChroot * http://www.thegeekstuff.com/2010/01/debootstrap-minimal-debian-ubuntu-i...")
 
No edit summary
Line 1: Line 1:
= Intro =
* https://help.ubuntu.com/community/BasicChroot
* https://help.ubuntu.com/community/BasicChroot
* https://help.ubuntu.com/community/DebootstrapChroot
* https://help.ubuntu.com/community/DebootstrapChroot
Line 37: Line 39:
* [https://www.stgraber.org/2012/02/03/ever-wanted-an-armel-or-armhf-container-on-an-x86-machine-its-now-possible-with-lxc-in-ubuntu-precise/ Create an armhf container on your x86 machine?]
* [https://www.stgraber.org/2012/02/03/ever-wanted-an-armel-or-armhf-container-on-an-x86-machine-its-now-possible-with-lxc-in-ubuntu-precise/ Create an armhf container on your x86 machine?]
* [https://www.linuxuprising.com/2021/02/archbox-makes-it-easy-to-install.html Archbox Makes It Easy To Install Software From Arch Linux On Other Linux Distributions (Using A Chroot Environment)]
* [https://www.linuxuprising.com/2021/02/archbox-makes-it-easy-to-install.html Archbox Makes It Easy To Install Software From Arch Linux On Other Linux Distributions (Using A Chroot Environment)]
= vmlinux =
* https://en.wikipedia.org/wiki/Vmlinux
* [https://www.bilibili.com/read/cv15626523 用户态linux简明指南]
* [https://www.jianshu.com/p/38ea929e1668 用户态(user mode)与内核态(kernel mode)]

Revision as of 19:17, 25 March 2022

Intro

Note that we have to change the conf file a little bit. The 'location' word needs to be changed to 'directory'. Also at the last step when we are ready to test a 32-bit GUI app, we need to issue DISPLAY in a separate line; such as

export DISPLAY=:0.0
su brb # brb is my root user in the host system that can invoke the schroot program
       # firefox does not allow to use root to start it
firefox

For a recap:

1. Install the packages
sudo apt-get install debootstrap schroot -y
2. Create a schroot configuration file
sudo nano /etc/schroot/chroot.d/precise_i386.conf
3. Install 32-bit ubuntu with debootstrap
sudo mkdir -p /srv/chroot/precise_i386
sudo debootstrap --variant=buildd --arch=i386 precise /srv/chroot/precise_i386 http://archive.ubuntu.com/ubuntu/
4. Test the chroot environment
schroot -l
schroot -c precise_i386 -u root
uname -a
cat /etc/issue
5. Additional configuration
apt-get install ubuntu-minimal
# That's all.

The article also mentioned the home directories (Documents, Downloads, ...) of the users within the chroot are shared with the host. How to access them from the host?

vmlinux