I've created a chroot system in my Ubuntu using schroot and debrootstrap, based on minimal ubuntu. However whenever I can't seem to add a new user into this chroot environment. Here is what happens.

  1. I enter schroot as root and add a new user.(Tried both adduser and useradd commands)
  2. The username lists up in /etc/passwd file and I can 'su' into the new user. So far so good.
  3. When I log out of schroot, and re-enter schroot, the user I created has vanished!! There is no mention of that user in /etc/passwd either.

How do I make the new user permanent?

link|improve this question
This sounds strange. First try to be sure that the directories are correct, both when you're inside the chroot and outside. Then, do cat /etc/passwd after creating the user, then log out, and cat the same file, now with chroot directory prefixed. Did it change? – maxelost Jan 30 '11 at 22:18
feedback

1 Answer

up vote 4 down vote accepted

Oh, I figured it out myself. Schroot has a feature called "sessions" where current environment can be preserved. Everytime one logs out without creating a "session", schroot brings everything to clean state and hence deletes the user as well. One can start a session using

schroot -c mychroot -b 
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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