Chroot: Difference between revisions

From 太極
Jump to navigation Jump to search
No edit summary
 
Line 39: 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)]
* [https://www.makeuseof.com/chroot-in-linux/ What Is chroot in Linux and How Does It Work?] 5/15/2023


= vmlinux =
= vmlinux =

Latest revision as of 20:05, 15 May 2023

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