Re: How to startx inside a pbuilder-managed chroot?

2011-09-18 Thread Jaromil

hi Francesco,

On Sat, 10 Sep 2011, Francesco Poli wrote:

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

maybe worth mentioning also this approach: I'm using Xepyr to do this,
with some small drawbacks, having also implemented it as common
development flow inside the dyne:III SDK

here an excerpt of the relevant steps:

after a mount -o bind of the usual /sys /proc and /dev i'll start
Xephyr from the host system:

Xephyr -screen $resolution :1 !

then chroot inside the guest system and give these commands:

export DISPLAY=localhost:1

and

gnome-session (or another window manager)

will start the gnome desktop inside a nested X window.

the drawback is that daemons listening on sockets will overlap and
stuff like gnome-settings will keep spitting back connections errors,
maybe someone has even a solution here so solve that.

FYI the dyneSDK I'm writing to absolve this and other tasks on top of
debian's live-build is here

https://github.com/dyne/dynebolic/blob/master/dyneIII/dynesdk

ciao


-- 
jaromil,  dyne.org developer,  http://jaromil.dyne.org
GPG: B2D9 9376 BFB2 60B7 601F 5B62 F6D3 FBD9 C2B6 8E39





signature.asc
Description: Digital signature


Re: How to startx inside a pbuilder-managed chroot?

2011-09-18 Thread Osamu Aoki
Hi,

On Sun, Sep 18, 2011 at 12:15:17AM +0200, Francesco Poli wrote:
 On Sun, 18 Sep 2011 02:42:54 +0900 Osamu Aoki wrote:
...
 I thought I could use a virtual machine, like, say, kvm, but there's a
 problem, it seems.
 
 If I understand correctly, with kvm, the guest system runs on a virtual
 machine with virtual hardware that is not identical to the actual
 hardware the host system runs on.

Correct :-)  That is usually good enough environment if you were looking
for evaluationg unstable/experimental gnome packages.  But it seems you
want more.

 The most important tests I have to perform involve the
 xserver-xorg-video-intel package: I need to run Intel video drivers
 on an Intel integrated graphics chip, with DRI 3D acceleration
 activated. If kvm makes the guest system see an emulated video card,
 the guest system won't run Intel video drivers, and I won't be able
 to reproduce the bugs...

If this is the case, then do not bother any fancy ways.  You do not want
to waste your time debugging virtual environment systems.  Just create a
dual (or multi) boot environment.  One. your main development platform.
The other small partition as your evaluation environment.  I would even
suggest you to keep disk image of system testing environment so you can
always reset it.

 Did I misunderstand something?
 May I run Intel video drivers on my actual hardware from inside a kvm
 virtual machine?

Maybe but why make things too complicated.  If you need to ask (also I
need to ask), it means this is not good baseline configuration we want
to base your work.  Creating dual boot is quite simple with grub as long
as you have extra disk space.  If you have time, you may look into
debian live CD/USB.  Then you can always create a toss-away system to
evaluate your driver.

Good luck.

Osamu


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110918122414.ga6...@goofy.lan



Re: How to startx inside a pbuilder-managed chroot?

2011-09-18 Thread Francesco Poli
On Sun, 18 Sep 2011 03:22:24 +0300 Georgios M. Zarkadas wrote:

 Hi,

Hi everyone!

First of all: thanks to Georgios and to Osamu for their kind replies.

I have good news: I managed to start X inside my pbuilder-managed
chroot environment!   :-)
It was tricky and dirty, but it worked.
Moreover, the X session was not fully functional (xterm was not able to
start, as getpty returned an error: I had to start GVim and type in
commands through its :! shell...).
Anyway, I was able to perform the tests I had in mind.

If someone is interested in what was missing in my previous attempts,
I had to do the following (before  su - niceguy ):

  # mount -t sysfs sysfs /sys
  # vim /etc/init.d/udev
  (turn the first if statement in mount_tmpfs() into a comment, so that
   the script does not attempt to remount /dev after incorrectly
   assuming it is already mounted)
  # /etc/init.d/udev start

For this to succeed, I also had to stop udev *outside* the chroot
environment:

  # /etc/init.d/udev stop
  # umount /dev

All in all, it was very unpractical and dirty.
I would *not* recommend this procedure to anyone...

 
 From the answers of the other participants of this thread so far, I
 think that the simpler solution for your case is to: 
 
 i) Make a minimal sid installation in a usb hard disk with only the
 packages contained in the chroot plus the ones you want to test.
 
 ii) Boot the real hardware (the box with the graphics card) from the usb
 disk, start X the usual way and perform the tests.
[...]
 This does not answer your original question of course (I don't have a
 good answer to that either) but it will allow you to do the job, with a
 different type of throw-away test environment.

I agree with Georgios' suggestion: next time I need something like
this, I'll look into live-build and try to create a custom Debian Live
with the packages I need.
Once this customized Debian Live image is written to a USB stick, I
will be able to boot the real hardware from the USB mass storage device
and perform all the tests I want.


-- 
 http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt
 New GnuPG key, see the transition document!
. Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE


pgpfy55iYqSAH.pgp
Description: PGP signature


Re: How to startx inside a pbuilder-managed chroot?

2011-09-17 Thread Osamu Aoki
Hi,

On Sat, Sep 10, 2011 at 10:07:21PM +0200, Francesco Poli wrote:
 Hello,
 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
 boxes).
 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.

I used to do this long time ago (4-5 years ago, I had methods in

Since X requires many devices to be shared, virtual environment seems to
be realistic and simple for this.

Use kvm, qemu, virtualbox-ose, etc.  These are much safer through away
environment with less complication.

Then you can have multiple desktops :-)

Osamu


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110917174254.gc12...@goofy.lan



Re: How to startx inside a pbuilder-managed chroot?

2011-09-17 Thread Francesco Poli
On Sun, 18 Sep 2011 02:42:54 +0900 Osamu Aoki wrote:

 Hi,

Hi Osamu, thanks a lot for your kind reply!

 
 On Sat, Sep 10, 2011 at 10:07:21PM +0200, Francesco Poli wrote:
[...]
  What I am trying to do (and failing miserably at) is to start an X
  session inside a throw-away sid chroot environment.
 
 I used to do this long time ago (4-5 years ago, I had methods in
 
 Since X requires many devices to be shared, virtual environment seems to
 be realistic and simple for this.
 
 Use kvm, qemu, virtualbox-ose, etc.  These are much safer through away
 environment with less complication.

I thought I could use a virtual machine, like, say, kvm, but there's a
problem, it seems.

If I understand correctly, with kvm, the guest system runs on a virtual
machine with virtual hardware that is not identical to the actual
hardware the host system runs on.
The most important tests I have to perform involve the
xserver-xorg-video-intel package: I need to run Intel video drivers
on an Intel integrated graphics chip, with DRI 3D acceleration
activated. If kvm makes the guest system see an emulated video card,
the guest system won't run Intel video drivers, and I won't be able
to reproduce the bugs...

Did I misunderstand something?
May I run Intel video drivers on my actual hardware from inside a kvm
virtual machine?

-- 
 http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt
 New GnuPG key, see the transition document!
. Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE


pgpoPW6WotNa1.pgp
Description: PGP signature


Re: How to startx inside a pbuilder-managed chroot?

2011-09-17 Thread Paul Wise
On Sun, Sep 18, 2011 at 6:15 AM, Francesco Poli wrote:

 May I run Intel video drivers on my actual hardware from inside a kvm
 virtual machine?

It looks like kvm is supposed to support PCI pass-through, but not for
graphics cards:

http://phoronix.com/forums/showthread.php?33506-QEMU-0.14-Improves-Linux-Virtualization

Apparently Xen does support that for GPUs though.

-- 
bye,
pabs

http://wiki.debian.org/PaulWise


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CAKTje6GxtWEfn950kce2rxy_K+EkSx0T5jPxsQQs4dOXdYu=r...@mail.gmail.com



Re: How to startx inside a pbuilder-managed chroot?

2011-09-17 Thread Arno Töll
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

On 18.09.2011 00:24, Paul Wise wrote:
 Apparently Xen does support that for GPUs though.

yes it does, but don't expect too much from it. Passing through video
cards is a complicated, error-prone operation. For some video cards
(notably Nvidia's) this is known not to work at all in some cases. If I
didn't scare you off yet, have a look to [1] and [2].

Finally please note, passing through a PCI devices implies to hide it
from your host system. This means, you have /no/ video card output at
all from your host system, unless you have a spare video card. This
turns your testing system into a headless one.

[1] http://wiki.xensource.com/xenwiki/XenPCIpassthrough
[2] http://wiki.xen.org/xenwiki/XenVGAPassthrough
- -- 
with kind regards,
Arno Töll
IRC: daemonkeeper on Freenode/OFTC
GnuPG Key-ID: 0x9D80F36D
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOdR9+AAoJEMcrUe6dgPNt1CEP/jCUdA+7wztL28QlxdjQ4bxN
RjNF7bpYQk2aLQNSys66Juj2HRn3YWrekIMVypzs3tI/Nt9+kXbT7pkcx/P75R/q
0FqEnhlC93ZHQVUiEBkueiuMLWuAXH1kDnr9hfUgB2qrS3XcVTP/e9Mo/YWvGBEV
Ocs5Kr7+nbIQui1/LhCxHax8+bwhgIn0Hb0bFlLKCleIDHCoUk4ermKUB5/mrGgh
qtS2XoopI0F10CuOXO54qqiHF0AGg0DERww4SXTqmnJu1ytHPIgCG+1qJybjXIOw
GmpFFPMm7x03tGIHCHKaPXbgRN/+s4Cv0wlHZVWb8NQErZd0QchvjBTZTJmdCxfX
3EzgC3gL7GNQDcQKHRYQNlkxvao4L32LAkW4lW5X0wHzdJZJ1WLo+OC03iQkZ2ev
06CgiyR8d8/iPLydFzDiRS4bcLYNOGhG4hpQcu1dRA1wf+F01T9eJ6Gdi+UDm9gi
OH4QvvdCGPAvWEQ6U1KrSorGp3r6s0ZU6ePljSj4YC0EWjYd9xYlMItmjoCeH9oY
ylOu1xyD4EZbf2wBPNVyVKDAI5KhRrncyae0Ct9OO345ZJrsDBowYMe6dlk2e7ms
ysm0sClVXjRG9MT+SMnHOkOlcxz+BZrxGnTutO3XOBWpS4/hdtt3WRJ+YjHUknsr
dtbqCHa6ukbZhDnHvjQ5
=3vvz
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4e751f7f.6050...@toell.net



Re: How to startx inside a pbuilder-managed chroot?

2011-09-17 Thread Georgios M. Zarkadas
Hi,

From the answers of the other participants of this thread so far, I
think that the simpler solution for your case is to: 

i) Make a minimal sid installation in a usb hard disk with only the
packages contained in the chroot plus the ones you want to test.

ii) Boot the real hardware (the box with the graphics card) from the usb
disk, start X the usual way and perform the tests.

If you want complete security of your normal system's data, unplug the
internal hard disk of the test box whenever you intend to boot from the
usb disk (or make a complete backup beforehand).

This does not answer your original question of course (I don't have a
good answer to that either) but it will allow you to do the job, with a
different type of throw-away test environment.

regards
George Zarkadas


signature.asc
Description: This is a digitally signed message part


How to startx inside a pbuilder-managed chroot?

2011-09-10 Thread Francesco Poli
Hello,
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
boxes).
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
updated.
A description of how I set up the sid chroot environment (by using
pbuilder) may be found at
http://www.inventati.org/frx/doc/nanodocs/testing_workstation_programming.html#setting-up-chroots-for-building-debian-packages

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
  wait $MANAGERPID
  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:
http://www.netfort.gr.jp/~dancer/software/pbuilder-doc/pbuilder-doc.html#chroot

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
wrong!
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!


-- 
 http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt
 New GnuPG key, see the transition document!
. Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE


pgpTQAhrx2zbH.pgp
Description: PGP signature


Re: How to startx inside a pbuilder-managed chroot?

2011-09-10 Thread Francesco Poli
On Sat, 10 Sep 2011 22:07:21 +0200 Francesco Poli wrote:

 Hello,
[...]

I forgot to add that I am not subscribed to the list, hence please Cc:
me on replies.
Thanks!

-- 
 http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt
 New GnuPG key, see the transition document!
. Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE


pgp2BOsi2rq8U.pgp
Description: PGP signature