Re: Running gobolinux containerized

"Lucas C. Villa Real" <[email protected]> Sun, 21 Jul 2019 19:03:09 -0300
Newsgroups gmane.linux.distributions.gobo.general
Message-ID <CAAvzgtaL_AYKLsD839v7Lj2DqpmNziiEVaM_zEP5BoNF2ZbhvQ@mail.gmail.com>
--===============7141412816548429025==
Content-Type: multipart/alternative; boundary="000000000000f6c0ef058e381de8"

--000000000000f6c0ef058e381de8
Content-Type: text/plain; charset="UTF-8"

On Fri, Jul 19, 2019 at 3:56 AM Anshuman Aggarwal <
[email protected]> wrote:

> On Fri, 19 Jul 2019 at 02:27, Lucas C. Villa Real <[email protected]>
> wrote:
> >
> > On Wed, Jul 17, 2019 at 4:16 PM Anshuman Aggarwal <
> [email protected]> wrote:
> >>
> >> Hi all,
> >>  Now, I am trying to run gobolinux in a container (chroot/lxc/docker
> >> etc.) with Ubuntu 18.04 as host so I can work on it more till it can
> >> become my primary OS. Has this been tried or is there any known reason
> >> why this wouldn't work?
> >>
> >> I tried using chroot but I get this error message when I run commands:
> >>
> >> sudo: no tty present and no askpass program specified
> >>
> >> There are generic solutions online but I was wondering why this was
> >> happening with Gobo since it doesn't happen when I chroot from a
> >> livecd into ubuntu on the hard disk.
> >>
> >> Thanks
> >> Anshu
> >
> >
> > Hi,
> >
> > The chroot issue seems to be related to missing device nodes on /dev. I
> usually run the following script to chroot into Gobo:
> > ```
> > mount -o bind /dev ./GoboLinux/dev
> > mount -o bind /proc ./GoboLinux/proc
> > mount -o bind /sys ./GoboLinux/sys
> > chroot ./GoboLinux
> > umount ./GoboLinux/sys
> > umount ./GoboLinux/proc
> > umount ./GoboLinux/dev
> > ```
>
> Did these bind mounts. It did not fix the tty error.
>
> My non-root user on the Host system did not have the same name as my
> user in Gobo so I created another user with sudo privileges on the
> Host to match the one in Gobo. That also did not fix the tty message.
>
> Since I am unable to sudo, Compile fails with the following error:
>
> make[1]: Leaving directory '/Data/Compile/Sources/libmpdclient-2.2'
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> Compile: Asserting that requirements are met...
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> sudo: no tty present and no askpass program specified
> Compile: LibMPDClient 2.2 - Installation step failed.
>

Sorry, I have no idea what's going on. Does it build when you compile as
root?


> >
> > Ideally, we should have a Docker image so that people could explore Gobo
> more freely. I looked into creating a Docker image based on GoboLinux a few
> months ago, but I've hit a few bumps:
> > 1. Gobohide is currently implemented as a kernel mod, which is not
> expected to be available in the distro where Docker runs
> > 2. We could have an alternative implementation of Gobohide using
> LD_PRELOAD, but that's hackish and relies on passing environment variables
> when starting the container, which I dislike
> > 3. Sandboxing through overlays and union-mounts require special
> permissions
> >
> > I didn't have the time to look into alternatives, so I gave up on that.
> I welcome anybody willing into working around these issues.
>
> Once I get it going with the choot, will try with LXC/Docker also.
>
> Gobohide is mostly visual/cosmetic (even though I think its
> great)...for the moment, anyone using gobo in a container can be
> expected to just marvel at the symlink beauty :)
>
> What are the special permissions that the sandbox/union-mounts need?
> Will running the container as root solve that?
>

Well, the kernel imposes an upper limit on the number of stacked overlays,
so:
- Overlay1: GoboLinux / Docker
- Overlay2: Compile / Runner
- Overlay3: Compile / Runner / UnionSandbox

is guaranteed to hit the limit and lead to failures. We could configure the
UnionSandbox so that it uses a FUSE based unionfs implementation, but then
we would need to run the container as root. I'm not sure if that will solve
all problems, but I believe it would.
Lucas

--000000000000f6c0ef058e381de8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-size:small">On Fri, Jul 19, 2019 at 3:56 AM Anshuman Aggarwal &lt;<a href=
=3D"mailto:[email protected]">[email protected]</a>&gt;=
 wrote:<br></div></div><div class=3D"gmail_quote"><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20=
4,204);padding-left:1ex">On Fri, 19 Jul 2019 at 02:27, Lucas C. Villa Real =
&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">lucasvr@gobo=
linux.org</a>&gt; wrote:<br>
&gt;<br>
&gt; On Wed, Jul 17, 2019 at 4:16 PM Anshuman Aggarwal &lt;<a href=3D"mailt=
o:[email protected]" target=3D"_blank">[email protected]=
m</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi all,<br>
&gt;&gt;=C2=A0 Now, I am trying to run gobolinux in a container (chroot/lxc=
/docker<br>
&gt;&gt; etc.) with Ubuntu 18.04 as host so I can work on it more till it c=
an<br>
&gt;&gt; become my primary OS. Has this been tried or is there any known re=
ason<br>
&gt;&gt; why this wouldn&#39;t work?<br>
&gt;&gt;<br>
&gt;&gt; I tried using chroot but I get this error message when I run comma=
nds:<br>
&gt;&gt;<br>
&gt;&gt; sudo: no tty present and no askpass program specified<br>
&gt;&gt;<br>
&gt;&gt; There are generic solutions online but I was wondering why this wa=
s<br>
&gt;&gt; happening with Gobo since it doesn&#39;t happen when I chroot from=
 a<br>
&gt;&gt; livecd into ubuntu on the hard disk.<br>
&gt;&gt;<br>
&gt;&gt; Thanks<br>
&gt;&gt; Anshu<br>
&gt;<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; The chroot issue seems to be related to missing device nodes on /dev. =
I usually run the following script to chroot into Gobo:<br>
&gt; ```<br>
&gt; mount -o bind /dev ./GoboLinux/dev<br>
&gt; mount -o bind /proc ./GoboLinux/proc<br>
&gt; mount -o bind /sys ./GoboLinux/sys<br>
&gt; chroot ./GoboLinux<br>
&gt; umount ./GoboLinux/sys<br>
&gt; umount ./GoboLinux/proc<br>
&gt; umount ./GoboLinux/dev<br>
&gt; ```<br>
<br>
Did these bind mounts. It did not fix the tty error.<br>
<br>
My non-root user on the Host system did not have the same name as my<br>
user in Gobo so I created another user with sudo privileges on the<br>
Host to match the one in Gobo. That also did not fix the tty message.<br>
<br>
Since I am unable to sudo, Compile fails with the following error:<br>
<br>
make[1]: Leaving directory &#39;/Data/Compile/Sources/libmpdclient-2.2&#39;=
<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
Compile: Asserting that requirements are met...<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
sudo: no tty present and no askpass program specified<br>
Compile: LibMPDClient 2.2 - Installation step failed.<br></blockquote><div>=
=C2=A0</div><div><span class=3D"gmail_default" style=3D"font-size:small">So=
rry, I have no idea what&#39;s going on. Does it build when you compile as =
root?</span></div><div><span class=3D"gmail_default" style=3D"font-size:sma=
ll"></span>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt;<br>
&gt; Ideally, we should have a Docker image so that people could explore Go=
bo more freely. I looked into creating a Docker image based on GoboLinux a =
few months ago, but I&#39;ve hit a few bumps:<br>
&gt; 1. Gobohide is currently implemented as a kernel mod, which is not exp=
ected to be available in the distro where Docker runs<br>
&gt; 2. We could have an alternative implementation of Gobohide using LD_PR=
ELOAD, but that&#39;s hackish and relies on passing environment variables w=
hen starting the container, which I dislike<br>
&gt; 3. Sandboxing through overlays and union-mounts require special permis=
sions<br>
&gt;<br>
&gt; I didn&#39;t have the time to look into alternatives, so I gave up on =
that. I welcome anybody willing into working around these issues.<br>
<br>
Once I get it going with the choot, will try with LXC/Docker also.<br>
<br>
Gobohide is mostly visual/cosmetic (even though I think its<br>
great)...for the moment, anyone using gobo in a container can be<br>
expected to just marvel at the symlink beauty :)<br>
<br>
What are the special permissions that the sandbox/union-mounts need?<br>
Will running the container as root solve that?<br></blockquote><div><br></d=
iv><div><div class=3D"gmail_default" style=3D"font-size:small">Well, the ke=
rnel imposes an upper limit on the number of stacked overlays, so:</div><di=
v class=3D"gmail_default" style=3D"font-size:small">- Overlay1: GoboLinux /=
 Docker</div><div class=3D"gmail_default" style=3D"font-size:small">- Overl=
ay2: Compile / Runner</div><div class=3D"gmail_default" style=3D"font-size:=
small">- Overlay3: Compile / Runner / UnionSandbox</div><br></div><div><div=
 class=3D"gmail_default" style=3D"font-size:small">is guaranteed to hit the=
 limit and lead to failures. We could configure the UnionSandbox so that it=
 uses a FUSE based unionfs implementation, but then we would need to run th=
e container as root. I&#39;m not sure if that will solve all problems, but =
I believe it would.</div><div class=3D"gmail_default" style=3D"font-size:sm=
all"></div></div><div class=3D"gmail_default" style=3D"font-size:small">Luc=
as</div></div></div>

--000000000000f6c0ef058e381de8--

--===============7141412816548429025==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZ29ib2xpbnV4
LXVzZXJzIG1haWxpbmcgbGlzdApnb2JvbGludXgtdXNlcnNAbGlzdHMuZ29ib2xpbnV4Lm9yZwpo
dHRwOi8vbGlzdHMuZ29ib2xpbnV4Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL2dvYm9saW51eC11c2Vy
cwo=

--===============7141412816548429025==--