+ The Oktave Forum » Technical » Engineering
|-+ chroot question
Username:
Password:

Pages: [1]
Topic Tools  
Read April 09, 2009, 10:46:09 am #0
sri

chroot question

Anyone here knows how to run an X application from a chroot'ed shell?

I have two versions of Linux on my machine and some X applications like KOffice only in the old version. From the new version, I mount the old version onto /mnt, do a chroot /mnt and try to run kpresenter. But it gives me an error that it is not permitted to connect to DISPLAY on :0.0. I tried xhost + on the running X server, for adding permissions, but still no success.

Any pointers welcome. Thanks in advance.
Offline  
Read April 10, 2009, 06:25:19 am #1
harsha.k

Re: chroot question

Assuming both the Linux are on the same machine,

I have experienced the same problem. use the sudo option instead. after you mount (use mount with options umask=000 "mount <drive> -o umask=000,rw").
use sudo kpresenter filename. This should work.
Offline  
Read April 10, 2009, 10:32:30 am #2
sri

Re: chroot question

No luck Sad

Might be missing something here. It is not accepting a umask option for ext3 file system at all. The man pages also place umask as an option only for vfat and other msdos like file systems. The sudo isn't working either.

I even tried to set DISPLAY to localhost:0.0, even if it means slower execution. But still no success. The $? is 1 which is "Operation not permitted."

Thanks for the pointers anyway; any further directions welcome.
Offline  
Read April 11, 2009, 08:28:08 am #3
harsha.k

Re: chroot question

I forgot the easiest way  Roll Eyes
try "kdesu kpresenter"
then open form the file toolbar
Smiley

If that did not work then proceede.....

Do you see a readonly symbol after you mount when you open the folder in the file browser.
use tune2fs to change the user and group.
use tune2fs -u <username> <device> (Example: tune2fs -u bubby /dev/sda9)
you can even give access by putting the -g option for your group. (say man tune2fs for more options)

If I had to guess I would say that your normal user does not have the permission to view the partation and therefore the Xserver cannot open it.
If you login as root then you will not have the same problem.

If you are on ubuntu you cannot login to x as root  Smiley

You can try this to login as root:
Go to the GDM (login) settings in ubuntu and there should be a option to allow root access form gdm. Then try mounting then and access. This time it will work Smiley

If you cannot find the settings, then go edit "/etc/inittab".
Edit the line for Default runlevel:
"id:3:initdefault:" Set the runlevel to 3. (It will be 4 or 5 by default)
and reboot.
You will boot into system without X. Then log into root and say "statx".
You have a root X server shell. It has to work now Smiley
Offline  
Read April 12, 2009, 10:10:55 am #4
sri

Re: chroot question

Thanks for the detailed response. But nothing worked.. (except the last brahmastra one, which I have not tried..) Wink

I forgot the easiest way  Roll Eyes
try "kdesu kpresenter"
then open form the file toolbar
Smiley

If that did not work then proceede.....

Nopes.. no luck..

Quote
Do you see a readonly symbol after you mount when you open the folder in the file browser.
use tune2fs to change the user and group.
use tune2fs -u <username> <device> (Example: tune2fs -u bubby /dev/sda9)
you can even give access by putting the -g option for your group. (say man tune2fs for more options)

No, there is no readonly symbol. It is not a mount problem as I am able to rw into the mounted filesystem without any problem.


Quote
If I had to guess I would say that your normal user does not have the permission to view the partation and therefore the Xserver cannot open it.
If you login as root then you will not have the same problem.

If you are on ubuntu you cannot login to x as root  Smiley

You can try this to login as root:
Go to the GDM (login) settings in ubuntu and there should be a option to allow root access form gdm. Then try mounting then and access. This time it will work Smiley

If you cannot find the settings, then go edit "/etc/inittab".
Edit the line for Default runlevel:
"id:3:initdefault:" Set the runlevel to 3. (It will be 4 or 5 by default)
and reboot.
You will boot into system without X. Then log into root and say "statx".
You have a root X server shell. It has to work now Smiley


I need this chroot mechanism for the long term -- as a permanent setting. So am still trying get it working on my user X server itself.
Offline  
Pages: [1]
Jump to: