pkgsrc-Users archive

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

Re: Problem using a second pkgsrc unprivileged



On Tue, Oct 27, 2020 at 11:49 AM Sad Clouds <cryintothebluesky%gmail.com@localhost> wrote:
>
> On Mon, 26 Oct 2020 22:48:10 +0100
> Connor McLaughlan <cont6pro3%gmail.com@localhost> wrote:
>
> > One last step missing is that i can't access the Xserver from within
> > the chroot. The error is not talking very much beside:
> > localhost$ xclock
> > Error: Can't open display: :0.0
>
> That is probably because it doesn't know there is Xserver running
> outside chroot. You need to allow TCP connections to Xserver and then
> set DISPLAY env variable to a correct value and allow X11 authorization
> via mit-magic-cookie. I don't remember the details, but there are
> plenty of tutorials out there.


Thank you all for your input.

In the end i am using both chroot and recompiling approaches.

With chroot i was able to compile packages of different pkgsrc-trees
with standard paths (/usr/pkg).
A last problem that i have not been able to solve is to have a program
running in the chroot open a window on the outside running Xserver.
First i tried the tcp based approach. provided the xauth token to the
chroot and enabled tcp on the Xserver("-nolisten tcp" has been
removed) , but no success. Accessing the Xserver works fine when i ssh
into the box. As soon as i switch to the chroot, it says that a
connection is not possible. Unfortunately there is not a good way to
debug this.

The second approach was to access the socket of the Xserver in /tmp
from within the chroot by mounting it into the chroot. I was able to
do this without a problem on linux, but not on netbsd. Reading about
the problem on the internet is yielding a possible discrepancy in the
behavior between a linux "mount --bind" and a netbsd "mount_null".

So for now i gave up running stuff from within the chroot that needs
access to the Xserver.

I went on to do what i was trying to avoid: recompiling packages. So i
set pkgsrc up in a different location, bootstrapped it with a prefix,
varbase and unprivileged options set, adjusted my path to exclude any
/usr/pkg* and included the new pkgsrc locations /usr/qt3/pkg* and went
on compiling. Aside from the time needed to compile stuff, everything
runs as expected for me.

So thanks again to everyone for providing thoughts and hints.

Regards,
Connor


Home | Main Index | Thread Index | Old Index