setting environment variable DISPLAY
root@main:~# echo $DISPLAY
root@main:~# xhost + xhost: unable to open display "" root@main:~# it seems that the DISPLAY environment variable on my host PC is empty....but how come that i can still run/display X-window applications on it?? |
export DISPLAY=<machine>:0.0
machine: localhost or where your display lives... as it seems to be unset on your sys check /etc/security/pam_env.conf and set a default there or in any other environment file like profile, bashrc,... sl mritch. |
what if i don't want to do "xhost +" each time....i want to make it a default initially. then
which file should i modify?? Jimmy |
rather use xauth (see "man xauth") and work aver a ssh if you use it over the net. it's far more secure.
to make it permanent anyway (better use "xhost + <machine-name>") locate your X startup script (usually .xsession in your home directory) and add a line: xhost + <machine-name> & if you are in some windowmanager like kde or gnome just make a small script and start it with you wm: in an xterm do: $ mkdir scripts; cd scripts $ echo "#!/bin/sh" > xhost_access.sh $ echo "xhost + <allowed_machine>" >> xhost_access.sh $ chmod a+x xhost_access.sh if yuo're in gnome start the gnome-control-center: $ gnome-control-center doubleclick comlex/advanced > sessions (or so..) > tab startprograms (..or so) now ad the script from your /home/you/scripts/xhost_access.sh here and finito. http://www.linuxquestions.org/questi...4&goto=newpost in kde there sure is a quite similar way. sl mritch. |
as root:
export XAUTHORITY=/home/your_user_name/.Xauthority reboot |
All times are GMT -5. The time now is 09:30 PM. |