View previous topic :: View next topic |
Author |
Message |
kernelOfTruth Watchman
Joined: 20 Dec 2005 Posts: 6111 Location: Vienna, Austria; Germany; hello world :)
|
Posted: Sun Nov 19, 2006 10:50 am Post subject: [solved] gentoo amd64 with 32bit chroot |
|
|
Hi there,
I just set up my 32bit chroot on amd64 & I noticed that I can only execute applications as root, which is very very bad
the chroot command says that it can only be executed by root since the operation is not permitted
su - user works, but in this way I don't have access to the X-server:
I get:
Quote: | Unable to connect to X server
(firefox-bin:4333): Gtk-WARNING **: cannot open display:
firefox-bin exited with non-zero status (1)
|
have I set up something wrong or is this the only way executing 32bit-firefox on amd64 with mplayerplug-in & other 32bit-apps
if it's only possible to execute those apps as root, is there a possibility to set up / execute them in a sandbox ?
and: how can I set up the sound in the chroot environment properly? e.g. for hearing sound in the movie trailers on apple.com ?
Thanks in advance for you help / answers
kernelOfTruth _________________ https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa
Hardcore Gentoo Linux user since 2004
Last edited by kernelOfTruth on Sun Nov 19, 2006 3:11 pm; edited 1 time in total |
|
Back to top |
|
|
kernelOfTruth Watchman
Joined: 20 Dec 2005 Posts: 6111 Location: Vienna, Austria; Germany; hello world :)
|
|
Back to top |
|
|
kernelOfTruth Watchman
Joined: 20 Dec 2005 Posts: 6111 Location: Vienna, Austria; Germany; hello world :)
|
Posted: Sun Nov 19, 2006 3:14 pm Post subject: |
|
|
solved it:
then execute, for example firefox with the following command:
Code: | gksu -u user firefox |
the important part is, that you also bind / mount your /home directory into your chroot environment that gksu
can copy your .Xauthority file to /tmp/...
here my modified gentoo32 init-script:
Code: | #!/sbin/runscript
depend() {
need localmount
need bootmisc
}
start() {
ebegin "Mounting 32bits chroot dirs"
mount -o bind /dev /mnt/gentoo32/dev >/dev/null
mount -o bind /dev/pts /mnt/gentoo32/dev/pts >/dev/null &
mount -o bind /dev/shm /mnt/gentoo32/dev/shm >/dev/null &
mount -o bind /proc /mnt/gentoo32/proc >/dev/null
mount -o bind /proc/bus/usb /mnt/gentoo32/proc/bus/usb >/dev/null &
mount -o bind /sys /mnt/gentoo32/sys >/dev/null &
mount -o bind /tmp /mnt/gentoo32/tmp >/dev/null &
mount -o bind /usr/portage /mnt/gentoo32/usr/portage/ >/dev/null &
mount -o bind /data /mnt/gentoo32/data >/dev/null &
mount -o bind /home /mnt/gentoo32/home >/dev/null &
eend $? "An error occured while attempting to mount 32bit chroot directories"
ebegin "Copying 32bits chroot files"
cp -pf /etc/resolv.conf /mnt/gentoo32/etc >/dev/null &
cp -pf /etc/passwd /mnt/gentoo32/etc >/dev/null &
cp -pf /etc/shadow /mnt/gentoo32/etc >/dev/null &
cp -pf /etc/group /mnt/gentoo32/etc >/dev/null &
cp -pf /etc/shadow /mnt/gentoo32/etc >/dev/null &
cp -pf /etc/hosts /mnt/gentoo32/etc > /dev/null &
cp -Ppf /etc/localtime /mnt/gentoo32/etc >/dev/null &
eend $? "An error occured while attempting to copy 32 bits chroot files."
}
stop() {
ebegin "Unmounting 32bits chroot dirs"
umount -f /mnt/gentoo32/dev/pts >/dev/null
umount -f /mnt/gentoo32/dev/shm >/dev/null
umount -f /mnt/gentoo32/dev >/dev/null &
umount -f /mnt/gentoo32/proc/bus/usb >/dev/null
umount -f /mnt/gentoo32/proc >/dev/null &
umount -f /mnt/gentoo32/sys >/dev/null &
umount -f /mnt/gentoo32/tmp >/dev/null &
umount -f /mnt/gentoo32/usr/portage/ >/dev/null &
umount -f /mnt/gentoo32/data >/dev/null &
umount -f /mnt/gentoo32/home >/dev/null &
eend $? "An error occured while attempting to unmount 32bits chroot directories"
}
|
_________________ https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa
Hardcore Gentoo Linux user since 2004 |
|
Back to top |
|
|
Ibn al-Hazardous Tux's lil' helper
Joined: 02 Sep 2004 Posts: 133 Location: Somewhere deep in the desert.
|
Posted: Tue Jan 06, 2009 6:16 pm Post subject: |
|
|
Thanks!
I have been racking my head with this problem. In my case it's 32-bit eclipse that would only run as root - with a ton of gtk errors and a segfault logged in as user.
This is an old thread, and it took some digging to find - but this really saved my ass.
PS my gtk error for the benefit of search engines:
Code: | (eclipse:26989): Gtk-CRITICAL **: gtk_icon_theme_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
(eclipse:26989): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
(eclipse:26989): Gtk-CRITICAL **: gtk_icon_size_lookup_for_settings: assertion `GTK_IS_SETTINGS (settings)' failed
(eclipse:26989): Gtk-WARNING **: Invalid icon size 6
(eclipse:26989): Gtk-CRITICAL **: gtk_icon_theme_load_icon: assertion `GTK_IS_ICON_THEME (icon_theme)' failed
Segmentation fault |
_________________ /Ibn |
|
Back to top |
|
|
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5909
|
Posted: Tue Jan 06, 2009 8:41 pm Post subject: |
|
|
question, why would you want to create a 32 bit root in 64 bit? what programs need to work only on 32 bit? _________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein |
|
Back to top |
|
|
Ibn al-Hazardous Tux's lil' helper
Joined: 02 Sep 2004 Posts: 133 Location: Somewhere deep in the desert.
|
Posted: Wed Jan 07, 2009 8:41 am Post subject: |
|
|
That's because my job requires me to run a 32-bit proprietary plugin for eclipse (Adobe Flex Builder). _________________ /Ibn |
|
Back to top |
|
|
kernelOfTruth Watchman
Joined: 20 Dec 2005 Posts: 6111 Location: Vienna, Austria; Germany; hello world :)
|
|
Back to top |
|
|
bghost4 n00b
Joined: 15 Mar 2009 Posts: 1
|
Posted: Sun Mar 15, 2009 5:20 am Post subject: What would it take to "merge" the 32 bit chroot |
|
|
I was just thinking, what would it take/how many more problems would be created if the chroot env was "merged" into the 64 bit root
like linking / mount -o bind /mnt/gentoo32/lib /lib32
and the like
then the bin directories too, so the chroot would be used only for the "building" of those packages?
then you don't have to gksu... or even chroot to use your 32 bit apps, it would be like maintaining your own app-emulation/emul-linux-x86-* with the portage tree in your chroot, this seems to me like it would be a good idea, probably wrong. but I dream big. can anyone tell me why this wouldn't work? |
|
Back to top |
|
|
kernelOfTruth Watchman
Joined: 20 Dec 2005 Posts: 6111 Location: Vienna, Austria; Germany; hello world :)
|
|
Back to top |
|
|
appetitus Apprentice
Joined: 28 Sep 2003 Posts: 210
|
Posted: Tue Oct 13, 2009 9:17 pm Post subject: Re: What would it take to "merge" the 32 bit chroo |
|
|
bghost4 wrote: | can anyone tell me why this wouldn't work? |
Too much work for little gain.
You can just keep around a full 32bit system on another slice of LVM.
Same hardware, etc.
Several ways to access that 32 bit system, pick one.
Some management details for your "users", but LVM can be pretty handy in resolving them.
e.g. users have their own "bin" for locals, which is an appropriate slice of LVM when crossing 32/64 bit work.
I have a slice of hard disk dedicated to a fixit system, which holds all the boots for the various LVM based systems.
Works great, easy to test out new stuff.
Just install into a single partition system (LVM of course) and then copy out the boots to a dedicated subdirectory in the fixit sytems boot directory, grub handles that fine with properly setup paths. Move out whatever to other slices, expand and shrink as required. _________________ Being a Gentoo user means living in a house inhabited by a family of crazed carpenters. When you wake up, the house is different. Maybe there is a new turret, or some walls have moved, or perhaps someone has removed the floor under your bed. |
|
Back to top |
|
|
|