sarge in chroot

0 views
Skip to first unread message

Gudjon I. Gudjonsson

unread,
Sep 9, 2005, 1:40:16 PM9/9/05
to
Hi
I have set up a sarge amd64 system in a chroot on my computer to run matlab
and cadence there. I tried to add /var/chroot/sarge-amd64/.../lib into
ld.so.conf and not so surprisingly, nothing worked after ldconfig. Does
anyone know how to avoid library conflict in this case?
Matlab wants to access some device on my computer. Is it ok to mount
the /dev directory into chroot with bind?
Hope my questions are not too silly.

Thanks
Gudjon


--
To UNSUBSCRIBE, email to debian-amd...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Lennart Sorensen

unread,
Sep 9, 2005, 1:50:18 PM9/9/05
to
On Fri, Sep 09, 2005 at 07:32:10PM +0200, Gudjon I. Gudjonsson wrote:
> I have set up a sarge amd64 system in a chroot on my computer to run matlab
> and cadence there. I tried to add /var/chroot/sarge-amd64/.../lib into
> ld.so.conf and not so surprisingly, nothing worked after ldconfig. Does
> anyone know how to avoid library conflict in this case?

If you run 64bit normal system and 64bit chroot, yeah that could cause
problems. The ld.so.conf stuff is only for mixing 32/64 together.

> Matlab wants to access some device on my computer. Is it ok to mount
> the /dev directory into chroot with bind?
> Hope my questions are not too silly.

bind mounting /dev and /home is generally a good idea for the chroot.
mounting /proc is also required (no bind needed of course).
/tmp may also make sense to bind mount since some things use sockets in
/tmp.

Len Sorensen

Matthias Julius

unread,
Sep 9, 2005, 2:30:15 PM9/9/05
to
lsor...@csclub.uwaterloo.ca (Lennart Sorensen) writes:

> If you run 64bit normal system and 64bit chroot, yeah that could cause
> problems. The ld.so.conf stuff is only for mixing 32/64 together.

And for that to work you also need the 64bit linker in /lib/ (or
/lib64/ ?).

Matthias

Gudjon I. Gudjonsson

unread,
Sep 9, 2005, 3:00:18 PM9/9/05
to
Þann Föstudagur 9. september 2005 19:44 skrifaði Lennart Sorensen:
> On Fri, Sep 09, 2005 at 07:32:10PM +0200, Gudjon I. Gudjonsson wrote:
> > I have set up a sarge amd64 system in a chroot on my computer to run
> > matlab and cadence there. I tried to add /var/chroot/sarge-amd64/.../lib
> > into ld.so.conf and not so surprisingly, nothing worked after ldconfig.
> > Does anyone know how to avoid library conflict in this case?
>
> If you run 64bit normal system and 64bit chroot, yeah that could cause
> problems. The ld.so.conf stuff is only for mixing 32/64 together.
>
> > Matlab wants to access some device on my computer. Is it ok to mount
> > the /dev directory into chroot with bind?
> > Hope my questions are not too silly.
>
> bind mounting /dev and /home is generally a good idea for the chroot.
> mounting /proc is also required (no bind needed of course).
> /tmp may also make sense to bind mount since some things use sockets in
> /tmp.
>
> Len Sorensen
Thanks for the answer. Now matlab starts halfway and exits with the following
commands:
gudjon@mve035:~$ dchroot -c amd64 -d matlab
(amd64) matlab
??? MATLAB was unable to open a pseudo-tty: No such file or directory [2,1]
The unix() and ! commands will not work in this MATLAB session. Other
commands which depend upon unix() and ! will also fail. Your system may
be running low on resources. If the problem persists after a reboot,
check with your system administrator and confirm that your pty subsystem
is properly configured.

Failed to start the Desktop: Unable to register Command Window
dchroot: Child exited non-zero.
dchroot: Operation failed.

I searched for pseudo-tty and found the following email:
http://lists.debian.org/debian-user/1997/07/msg00312.html
and from that I did the following
for i in /dev/pty* ; do fuser -v $i ; done
The result in sarge-amd64 is:
mve035:/home/gudjon# chroot /var/chroot/sarge-amd64/
mve035:/# for i in /dev/pty* ; do fuser -v $i ; done
/var/chroot/sid-ia32/home: No such file or directory
/var/chroot/sid-ia32/home: No such file or directory
/var/chroot/sid-ia32/home: No such file or directory.......
and so on
but in sid-ia32 it is
mve035:/home/gudjon# chroot /var/chroot/sid-ia32/
mve035:/# for i in /dev/pty* ; do fuser -v $i ; done
/var/chroot/sarge-amd64/home: No such file or directory
/var/chroot/sarge-amd64/tmp: No such file or directory
/var/chroot/sarge-amd64/dev: No such file or directory
/var/chroot/sarge-amd64/proc: No such file or directory
/var/chroot/sarge-amd64/home: No such file or directory
/var/chroot/sarge-amd64/tmp: No such file or directory.......

My /etc/fstab looks the following way:
proc /proc proc defaults 0 0
/dev/sda6 / ext3 defaults,errors=remount-ro 0 1
/dev/sdb1 /home ext3 defaults 0 2
/dev/sda5 none swap sw 0 0
/dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
/dev/sdc1 /media/usb0 auto rw,user,noauto 0 0
# ia32 chroot
/home /var/chroot/sid-ia32/home none bind 0 0
/home /var/chroot/sarge-amd64/home none bind 0 0
/tmp /var/chroot/sid-ia32/tmp none bind 0 0
/tmp /var/chroot/sarge-amd64/tmp none bind 0 0
/dev /var/chroot/sarge-amd64/dev none bind 0 0
proc /var/chroot/sid-ia32/proc proc bind 0 0
proc /var/chroot/sarge-amd64/proc proc bind 0 0

I tried to comment sid-ia32 out of fstab but it did not help. The change is
that
mve035:/home/gudjon# chroot /var/chroot/sarge-amd64/
mve035:/# for i in /dev/pty* ; do fuser -v $i ; done
does not give any output but matlab crashes as before.

Thanks
Gudjon

Lennart Sorensen

unread,
Sep 9, 2005, 3:10:09 PM9/9/05
to
On Fri, Sep 09, 2005 at 08:59:33PM +0200, Gudjon I. Gudjonsson wrote:
> Thanks for the answer. Now matlab starts halfway and exits with the following
> commands:
> gudjon@mve035:~$ dchroot -c amd64 -d matlab
> (amd64) matlab
> ??? MATLAB was unable to open a pseudo-tty: No such file or directory [2,1]
> The unix() and ! commands will not work in this MATLAB session. Other
> commands which depend upon unix() and ! will also fail. Your system may
> be running low on resources. If the problem persists after a reboot,
> check with your system administrator and confirm that your pty subsystem
> is properly configured.
>
> Failed to start the Desktop: Unable to register Command Window
> dchroot: Child exited non-zero.
> dchroot: Operation failed.

Did you bind mount /dev or rbind mount /dev (rbind would also
recursively have included /dev/pts/ which is where the tty's are
stored).

Gudjon I. Gudjonsson

unread,
Sep 9, 2005, 3:20:17 PM9/9/05
to
Þann Föstudagur 9. september 2005 21:02 skrifaði Lennart Sorensen:
> On Fri, Sep 09, 2005 at 08:59:33PM +0200, Gudjon I. Gudjonsson wrote:
> > Thanks for the answer. Now matlab starts halfway and exits with the
> > following commands:
> > gudjon@mve035:~$ dchroot -c amd64 -d matlab
> > (amd64) matlab
> > ??? MATLAB was unable to open a pseudo-tty: No such file or directory
> > [2,1] The unix() and ! commands will not work in this MATLAB session.
> > Other commands which depend upon unix() and ! will also fail. Your
> > system may be running low on resources. If the problem persists after a
> > reboot, check with your system administrator and confirm that your pty
> > subsystem is properly configured.
> >
> > Failed to start the Desktop: Unable to register Command Window
> > dchroot: Child exited non-zero.
> > dchroot: Operation failed.
>
> Did you bind mount /dev or rbind mount /dev (rbind would also
> recursively have included /dev/pts/ which is where the tty's are
> stored).
>
> Len Sorensen
That did the trick. Now I get the following message when starting matlab

gudjon@mve035:~$ dchroot -c amd64 -d matlab
(amd64) matlab
Failed to start the Desktop: Unable to register Command Window
dchroot: Child exited non-zero.
dchroot: Operation failed.

and if I use strace then I get the output:
dchroot: chroot: Operation not permitted
--- SIGCHLD (Child exited) @ 0 (0) ---
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 4868
plus a lot more of course
Do you have any idea what that might be. The string "dchroot: chroot:
Operation not permitted" did not give any reasonable hints by google.

Thanks
Gudjon

Lennart Sorensen

unread,
Sep 9, 2005, 3:30:17 PM9/9/05
to
On Fri, Sep 09, 2005 at 09:16:01PM +0200, Gudjon I. Gudjonsson wrote:
> That did the trick. Now I get the following message when starting matlab
> gudjon@mve035:~$ dchroot -c amd64 -d matlab
> (amd64) matlab
> Failed to start the Desktop: Unable to register Command Window
> dchroot: Child exited non-zero.
> dchroot: Operation failed.

Maybe it can't connect to X.

Is /tmp and /home mounted?

Is DISPLAY set?

Gudjon I. Gudjonsson

unread,
Sep 9, 2005, 3:40:17 PM9/9/05
to
Þann Föstudagur 9. september 2005 21:23 skrifaði Lennart Sorensen:
> On Fri, Sep 09, 2005 at 09:16:01PM +0200, Gudjon I. Gudjonsson wrote:
> > That did the trick. Now I get the following message when starting matlab
> > gudjon@mve035:~$ dchroot -c amd64 -d matlab
> > (amd64) matlab
> > Failed to start the Desktop: Unable to register Command Window
> > dchroot: Child exited non-zero.
> > dchroot: Operation failed.
>
> Maybe it can't connect to X.
>
> Is /tmp and /home mounted?
>
> Is DISPLAY set?
>
> Len Sorensen
Thank you for your patience Lennart and excuse me for the last email. Now
everything is running perfectly. I forgot to install libxtst6.
Now I can run matlab without having to downgrade my system

Thanks a lot
Gudjon

Reply all
Reply to author
Forward
0 new messages