Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] gentoo amd64 with 32bit chroot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Sun Nov 19, 2006 10:50 am    Post subject: [solved] gentoo amd64 with 32bit chroot Reply with quote

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 8O

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 :D


Last edited by kernelOfTruth on Sun Nov 19, 2006 3:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Sun Nov 19, 2006 12:08 pm    Post subject: Reply with quote

I now solved the sound problem by adding the alsa use-flag :)

however ... , is there a possibility to run the chroot-applications in user-mode (not root) ?
_________________
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 :D
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Sun Nov 19, 2006 3:14 pm    Post subject: Reply with quote

solved it:

Code:
emerge gksu


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 :D
Back to top
View user's profile Send private message
Ibn al-Hazardous
Tux's lil' helper
Tux's lil' helper


Joined: 02 Sep 2004
Posts: 133
Location: Somewhere deep in the desert.

PostPosted: Tue Jan 06, 2009 6:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5909

PostPosted: Tue Jan 06, 2009 8:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ibn al-Hazardous
Tux's lil' helper
Tux's lil' helper


Joined: 02 Sep 2004
Posts: 133
Location: Somewhere deep in the desert.

PostPosted: Wed Jan 07, 2009 8:41 am    Post subject: Reply with quote

That's because my job requires me to run a 32-bit proprietary plugin for eclipse (Adobe Flex Builder).
_________________
/Ibn
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Wed Jan 07, 2009 8:18 pm    Post subject: Reply with quote

Ibn al-Hazardous wrote:
That's because my job requires me to run a 32-bit proprietary plugin for eclipse (Adobe Flex Builder).


++

sometimes the compatibility libraries just don't do it

in former times when java, flash, <insert non-working app on amd64> weren't working on amd64 properly or at all,

this was the only solution

glad it worked for you :)
_________________
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 :D
Back to top
View user's profile Send private message
bghost4
n00b
n00b


Joined: 15 Mar 2009
Posts: 1

PostPosted: Sun Mar 15, 2009 5:20 am    Post subject: What would it take to "merge" the 32 bit chroot Reply with quote

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
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Mon Jun 15, 2009 8:10 pm    Post subject: Reply with quote

this could work BUT for this you must run 64bit WITHOUT multilib support, then there should be no problem

I haven't tested this and won't for some time since I'm running amd64 with multilib and currently am busy so you won't likely see any feedback regarding this question

if you have the time and are willing to experiment:

give it a try and please report back how it worked out for you


BUT before: please create a stage4-tarball and safe your current system :idea:

good luck :)
_________________
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 :D
Back to top
View user's profile Send private message
appetitus
Apprentice
Apprentice


Joined: 28 Sep 2003
Posts: 210

PostPosted: Tue Oct 13, 2009 9:17 pm    Post subject: Re: What would it take to "merge" the 32 bit chroo Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum