Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Cannot make SCHROOT work for me

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
mabra
Posts: 110
Joined: 2010-10-16 16:53

Cannot make SCHROOT work for me

#1 Post by mabra »

I try to use a chroot with schroot on debian bullseye. I setup a chroot fpr 'nomacs', an application,
I need the whole day, but is not in bullseye. I created a chroot for it, just to protect my host from garbage in its filesystem (the installation itself) -- strictly spoken, I do not need the protection of the host filesystem from the chroot, I want to access nearly all (homedir/net mounts - came not that far).

I tried to follow the instructions I found for schroot, but it does not work for me - instructions in the internet describe different settings, like own subdir for each chroot, with its own 'fstab', for example.
My example/setup changed nothing else (so "default" fstab from schroot subdirs should apply).

In the existing 'schroot.conf', everything is a comment and I added:

Code: Select all

[buster-test]
description=Run nomacs from buster
type=directory
directory=/opt/apps/deb10-apps
users=mbu
root-groups=root
profile=desktop
personality=linux
preserve-environment=true

Code: Select all

$ schroot -l
chroot:buster-test
My '/opt/apps/deb10-apps' is mounted with dev,exec,suid, it is a zfs filesystem,
mounted at: '/opt/apps/deb10-apps/'

Code: Select all

ls /opt/apps/
drwxrwxrwx 18 root root 24 2023-06-08 17:51:01 deb10-apps/
My user has bash as its shell.

Using chroot as root:
'chroot /opt/apps/deb10-apps/ bash'
I can see:

Code: Select all

(buster-test)root@mtx:/# cat /etc/issue
Debian GNU/Linux 10 \n \l
There wre no issues setting the chroot up.

From my user, I started:

Code: Select all

schroot -c buster-test
and this raises errors:
>W: Failed to change to directory ‘/home/mbu/work’: No such file or directory
I: The directory does not exist inside the chroot.  Use the --directory option to run the command in a different directory.
W: Falling back to directory ‘/home/mbu’
BTW, the message: "‘/home/mbu/work’: No such file or directory" may result from a chdir in my users .bashrc, but it appears even, when the chdir is set to be a comment. The same BAD appears, if I use schroot for the root-user - its home directory is empty.

issuing 'pwd' says: '/home/mbu', but 'ls -al' shows nothing, ls ..

Code: Select all

(buster-test)mbu@mtx:~$ ls -al
total 10
drwxr-xr-x  2 root root  2 Jul 21 09:28 .
drwxr-xr-x 11 root root 12 Jul 25 13:20 ..
(buster-test)mbu@mtx:~$ ls -al ..
total 52
drwxr-xr-x 11 root    root    12 Jul 25 13:20 .
drwxrwxrwx 18 root    root    24 Jun  8 17:51 ..
drwxr-xr-x  2 root    root     2 Jan  2  2023 mbt
drwxr-xr-x  2 root    root     2 Jul 21 09:28 mbu
lrwxrwxrwx  1 root    mbg-adm  6 Sep 28  2022 root -> /root/
drwxr-xr-x  2 root    root     2 Oct 10  2022 shared
mount:

Code: Select all

(buster-test)mbu@mtx:~$ mount
combopool/apps/deb10-apps on / type zfs (rw,xattr,posixacl)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=32842992k,nr_inodes=8210748,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
syspool/home on /home type zfs (rw,xattr,posixacl)
syspool/tmp on /tmp type zfs (rw,xattr,posixacl)
syspool/ROOT/debian on /var/lib/dbus type zfs (rw,xattr,posixacl)
Some help would be great!
I would not know a way to start the app (with its necesary environment)
from the chroot or even a container (container as VM is easy).

Regards,
Manfred

lindi
Debian Developer
Debian Developer
Posts: 467
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 88 times

Re: Cannot make SCHROOT work for me

#2 Post by lindi »

I used to use something like https://lindi.iki.fi/lindi/schroot.txt when I needed to run software from debian unstable regularly. I haven't checked these instructions recently but maybe they can help you?

User avatar
mabra
Posts: 110
Joined: 2010-10-16 16:53

Re: Cannot make SCHROOT work for me

#3 Post by mabra »

Tjanks for your reply.
But uups, this - to my understanding fo schroot - should be done by schroot itself.
This looks like some workaround? But I am unable to understand and this looks
like hand-woven chroot? The mentioned fstab, which one would this be?
There is already one in the tree of /etc/schroot - but what is in there, is NOT mounted.
What I found out later, there is also a systemd-unit - no documentation to find ....
Thanks anyway!
Regards,
Manfred

lindi
Debian Developer
Debian Developer
Posts: 467
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 88 times

Re: Cannot make SCHROOT work for me

#4 Post by lindi »

Yes you are right, I wanted to have the filesystems always mounted probably to speed up schroot and make it more naturla to have long-running daemons there.

lindi
Debian Developer
Debian Developer
Posts: 467
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 88 times

Re: Cannot make SCHROOT work for me

#5 Post by lindi »

So eassentially I am using schroot only to allow regular users to chroot, I wasn't using any other features.

Post Reply