# startx launches xterm - bad displayname etc.



## BitUnique (Feb 16, 2010)

I'm having some issues with xorg on my freeBSD 8.0 i386 machine.



I've finally manged to install a working driver, configured xorg.conf to my likeing. Edited my /etc/rc.conf file accordingly. 
Every thing seems to be working, with the expeption of some miss configuration of which im not sure how to correct. 

As normal user, startx launches xterm instead of gnome, which i have installed. launching gdm poses some no permission errors.

As root, startx launches xterm aslso, but i can get arround this by starting xorg with the gdm command, every thing seems to work flawlessly. How ever, the logs print something like this;


```
xauth:crating new authority file /root/.serverauth.1187
xauth:1: bad displayname ":0 in "add" command

creating new authority file /root/.xautorithy
argv:1: bad displayname ":0" in "list" command
```
regardless of this, gnome works. 


Now, i would like it so that startx launches gnome for both root and user (as of typing this, i just realised i havent added launch_gnome="YES" to my rc.conf file yet)

Either way, i would like some input what to do here. 

Thanks
Bit


----------



## nekoexmachina (Feb 16, 2010)

For the first time until gdm problem fixed - you should try editing your ~/.xinitrc and adding there something like 'exec gnome-session'.


----------



## DutchDaemon (Feb 16, 2010)

Don't run anything X-related as root if you can help it.


----------



## SirDice (Feb 16, 2010)

BitUnique said:
			
		

> Now, i would like it so that startx launches gnome for both root and user (as of typing this, i just realised i havent added launch_gnome="YES" to my rc.conf file yet)


It's *gnome_enable="YES"*

http://www.freebsd.org/gnome/docs/faq2.html#full-gnome


----------



## Time2IPL (Feb 16, 2010)

BitUnique said:
			
		

> As normal user, startx launches xterm instead of gnome, which i have installed.



It sounds to me like "startx" either isn't able to find gnome-session and is falling back to twm. You might want to read through the 'startx' script and see what it does / which files it uses.



> ... launching gdm poses some no permission errors. ...
> 
> ... As root, startx launches xterm aslso, but i can get arround this by starting xorg with the gdm command ...



Sounds like there's something that's either set incorrectly or just not set in the environment from which you're running "startx" (e.g., PATH isn't set properly) or permissions on one or more something aren't right. Or both.

I would check the output of:

```
echo $PATH
which gnome-session
ls -ld /usr/local/bin
ls -ld /usr/local/bin/gnome-session
```



> How ever, the logs print something like this;



Yeah this sounds like an environment thing; if you check the output of

```
echo $DISPLAY
```
my guess is you'll find that it's not set. I'd check the output of "setenv" and "set".

Are you using the default /usr/bin/csh shell or something else?

BTW, I know someone mentioned this already, but I think it bears repeating. In my opinion and in my experience, running X as root is a really, really bad idea. It's your machine, but forewarned is forearmed...

Hope this helps,
Larry


----------



## BitUnique (Feb 17, 2010)

Thanks for the help, ive managed to set every thing up to my liking now  

I edited .xinitrc file and added gnome to it, so now startx loads the propper window manager. I also added my user to the right group. No more error messages. 

For the running xorg as root, that was just during configuration to see if every thing was working. Im not running it as root on a regular basis hehe.


----------

