I am trying to use schroot to handle multiple chroot environments to produce clean development builds for specific versions of ubuntu. The host environment is Ubuntu 16.04.

I created /etc/schroot/chroot.d/test.conf with the following config:

[test]
description=ubuntu trusty
type=directory # DO NOT FORGET THIS LINE
directory=/var/chroot/test
shell=/bin/bash
groups=sudo
profile=desktop
personality=linux
preserve-environment=true
message-verbosity=verbose

I then created the chroot with:

sudo debootstrap --arch amd64 --variant=buildd trusty /var/chroot/test http://archive.ubuntu.com/ubuntu

The command works fine, and the chroot is created. I then enter the chroot this way:

schroot -c test
groups: cannot find name for group ID 1000
groups: cannot find name for group ID 108
groups: cannot find name for group ID 124
groups: cannot find name for group ID 135
groups: cannot find name for group ID 137
I have no name!@xps-dev:/$ 

No matter what I have tried, I can't get files like /etc/passwd, /etc/group, /etc/hosts to be properly copied over or synchronized with the chrooted environment. In this example I have set the profile to "desktop", which should make use of the setup info in /etc/schroot/desktop, but I have also tried creating my own profile without success. In any case, the desktop profile does specify it should copy over those files, or synchronize them:

awake@xps-dev:/etc/schroot/desktop$ cat copyfiles 
# Files to copy into the chroot from the host system.
#
# <source and destination>
/etc/resolv.conf
awake@xps-dev:/etc/schroot/desktop$ cat nssdatabases 
# System databases to copy into the chroot from the host system.
#
# <database name>
passwd
shadow
group
gshadow
services
protocols
networks
hosts

I have tried removing "passwd" and "group" from the nssdatabases file to add "/etc/passwd" and "/etc/group" to copyfiles so that the files would get copied over directly, rather than synchronized, but it didn't work.

I have tried the following command to enter the chroot as root with verbose output:

sudo schroot -v --debug=notice -c test -u root

The log is here: http://pastie.org/10947460

I don't see anything in the log that confirms the setup scripts have been executed.

I am obviously doing something wrong. Does anybody have an idea?

Thanks!

share|improve this question

I found the solution to my problem: without the "type=directory" line in the test.conf file, the type becomes "plain", which means the setup scripts from the profile do not get called. After adding the line, the setup scripts started getting called, and everything is now working as it should.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.