Editing .bash_profile cause GUI crash

Latest response

Our Server is started in Runlevel 3. I want to Setup an user, so that when he logs in, it starts the GUI and TeamViewer. I added at the end of .bash_profile, startx. When I log in, the GUI starts. I then set up TeamViewer to start, with StartProgram. Then exited. At the next log in, TeamViewer starts sometimes, but most of the time not. If I take the startx out of .bash_profile and log in and then startx, TeamViewer starts all the time. TeamViewer only works this way too.
When I have the startx in .bash_profile and TeamViewer starts, as soon as I make a Connection from my Workstation to Server, TeamViewer quits and the GUI crashes, black Screen. I can make the Connection from Server to Workstation though, that seems to work fine. Without the startx in .bash_profile, it always works fine.

I have Teamviewer 12.0.76279 installed on a RHEL 7.3 Server.

Responses

That is how it works, because after you switch to GUI the loaded environment is different not the same as one used before when in CLI. I guess you may have to add it to "start up applications" list.

So it makes a difference when I type the command form CLI as to when I put the same command in .bash_profile?

It is not just a "command", you are switching from cli to gui, hence, I said your login environment would gets changed.,

In your case bash environment gets changed after it triggers "startx" which once started would come up with fresh gnome (gui) session, so your now in gnome environment, all those environment variables would be different., also, gnome doesn't got any control on the commands that you added after the "startx" line in your .bash_profile file.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.