I have recently set up Xvfb on Centos 7 machine.
It is working absolutely fine.
Only problem is that if I quit putty session (remote access) it would keep running Xvfb in background but display will be gone.
So next time when I take remote access via putty first I have to type export DISPLAY=:99
again, then I start my tests.
How can I make it permanent? I don't see solution to my problem in this thread How to make exported shell variables permanent?
Update: .profile contents:
export M3_HOME=/home/aditi.a/apache-maven-3.5.4/bin
export PATH=$PATH:$M3_HOME
export JMETER_HOME=/home/aditi.a/apache-jmeter-5.0/bin
export PATH=$PATH:$JMETER_HOME
export JAVA_HOME=/usr/java/jdk1.8.0_192-amd64
export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export DISPLAY=:99
echo variables output:
$ echo $JAVA_HOME
/usr/java/jdk1.8.0_192-amd64
$ echo $M3_HOME
/home/adit.a/apache-maven-3.5.4/bin
$ echo $DISPLAY
$
which shell I am running
$ ps -p $$
PID TTY TIME CMD
30678 pts/14 00:00:00 sh
export DISPLAY=:99
in.profile
file where JAVA, MAVEN environment variables are saved. Quit putty session and ran the tests, tests failed because display wasnt there, exported the display again and test run fine this time – Aditi Apte Oct 30 '18 at 10:47~/.profile
as a fallback, if some other startup file isn't present. – JigglyNaga Oct 30 '18 at 10:57.profile
, and confirm that the other variables set there do take effect (when you connect through putty/ssh)? – JigglyNaga Oct 30 '18 at 17:58echo $JAVA_HOME
, orecho $M3_HOME
, orecho $DISPLAY
, what is the result? – JigglyNaga Oct 31 '18 at 07:41bash
, do either.bash_profile
or.bash_login
exist? – JigglyNaga Oct 31 '18 at 12:29ps -p $$
– Aditi Apte Oct 31 '18 at 14:24.profile
, it will setDISPLAY
along with the other variables. When I recreate the exact steps you've described (Centos 7, shell=/usr/bin/sh
, setDISPLAY
in~/.profile
, connect via Putty),DISPLAY
is set. So there must be something else non-standard about your setup, or a missing step you've not mentioned. If your problem can't be reproduced by anyone else, there's no way to investigate, and a "fix" won't be useful to anyone else. – JigglyNaga Oct 31 '18 at 15:31echo display=$DISPLAY
lines at the start and end of.profile
to see whether.profile
isn't being (fully) used, or something else is unsetting the variable afterwards. – JigglyNaga Oct 31 '18 at 15:32