[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to startx inside a pbuilder-managed chroot?

I am not sure which list I should direct this question to: it's a
problem I am facing because I need to try and reproduce some bugs
inside a throw-away test environment (without risking to crash my real
If there's a better Debian list where I can ask this question, please
suggest: I apologize in advance, if this is the case.

What I am trying to do (and failing miserably at) is to start an X
session inside a throw-away sid chroot environment.

The chroot environment has already been set up long ago and I keep it
A description of how I set up the sid chroot environment (by using
pbuilder) may be found at

Here's what I tried. I closed my real X session, and logged in on my
first virtual console. From there, I logged into my sid chroot (in a
throw-away manner):

  $ sudo pbuilder login --configfile ~/.pbuilder/sid.conf

Then, inside the chroot, I installed the needed packages, among which:

  # aptitude install xorg
  # aptitude install fluxbox

I created a temporary regular user:

  # adduser --disabled-login niceguy
  # adduser niceguy video
  # adduser niceguy adm
  # passwd niceguy

and prepared a simple ~/.xsession file:

  # cat ~niceguy/.xsession
  fluxbox & MANAGERPID=$!
  xset r rate 400 40
  xset b off
  savelog -p -c 4 ~/.xsession-errors

I changed "allowed_users=console" into "allowed_users=anybody"
in /etc/X11/Xwrapper.config and then became the regular user
(but please note that I got the same errors as root!):

  # su - niceguy
  $ startx

I got an error that told me that X could not open tty0.
Indeed there's no /dev/tty0 in my sid chroot: it seems that
only /dev/tty is present.
Please note that I don't have external directories bind-mounted in the
chroot environment, since the pbuilder documentation seems to say that
it is considered harmful for the throw-away mode:

I tried to manually create the device file:

  # mknod /dev/tty0 c 4 0
  # chown niceguy:tty /dev/tty0

After that, X refused to start with a different error message: cannot
open virtual console 7...

Please, someone more knowledgeable than me, tell me where I went
I searched the web about running X inside chroot environments, but I
failed to find useful hints about my issue.
Thanks for any help you may provide!

 New GnuPG key, see the transition document!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE

Attachment: pgpmroXtCjQdZ.pgp
Description: PGP signature

Reply to: