Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have used cowbuilder to set-up a chainroot with ubuntu+1 (essentially minimal ubuntu installation in a sub-folder, which you can "change" into, for example for building packages in a clean environment).

How can I start gnome-session from there? Ideally I want it to appear on a new VT. I hope to achieve poor-man's virtualisation ;-)

share|improve this question
Please elaborate, what is "chainroot"? – LassePoulsen Aug 15 '10 at 18:19
@Source Lab: Done =) – Dima Aug 16 '10 at 0:37
Does chainroot have a homepage somewhere? I can't find it in the Ubuntu repos and though I do find a few references through Google, nothing very helpful. – Roger Pate Aug 16 '10 at 1:13
@ROger Pate: google for debootstrap, pbuilder, cowbuilder. In essence you know you have / mounted? with chainroot command you can pretend your / is temporarly somewhere else, which allows you to run "bootstrapped" debian/ubuntu releases. – Dima Aug 16 '10 at 1:31
up vote 3 down vote accepted

You should be able to do this with a combination of startx and /etc/X11/Xsession, as long as you've got the necessary trees bind-mounted (I'd guess that you'll need /dev, /sys, and /proc)

Chroot into your… chroot and run

sudo startx bash

which should give you an X term with a shell. To start a GNOME session you can simply run


from that shell.

You should be able to get this on the VT of your choice; check out the man page for startx for this, and other potentially interesting options.

Note that this doesn't make for a secure chroot - since /proc and /sys and /dev are mounted in the chroot a sufficiently advanced malicious user break out of the chroot with ease.

share|improve this answer
Thanks for the security comment =) – Dima Aug 16 '10 at 22:44

I have used such a setup a long a time ago. I believe it was just as simple as starting X from the chroot specyfing a different display name:

startx -- :1

Switch to it with: CTRL-ALT-F9

share|improve this answer
Short and sweet. Thanks. – Dima Aug 16 '10 at 22:45

Your Answer


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.