# problem starting "pure" Xorg



## xiaobin (Aug 2, 2016)

I wanted to learn more about the Xorg system, so I wanted to start a "pure" Xorg server. However, when I ran "Xorg" from the command line, the screen was blank (completely black, the screen is lit up, but there was no mouse pointer, nothing at all). I checked the log in /var/log/Xorg.0.log. At the end of the log there were a few lines saying:

```
(WW) config/devd: devd socket is lost
(EE) config/devd: fail to connect to devd
(II) config/devd: terminating backend...
(II) UnloadModule: "mouse"
(II) UnloadModule: "mouse"
(II) UnloadModule: "dbd"
(II) Server terminated successfully (0). Closing log file.
```
Could anyone tell me what I should do to start a "pure" Xorg? I am using FreeBSD release 10.3 on an ASUS F553M laptop. `startx`  and `xinit` works fine.


----------



## tobik@ (Aug 2, 2016)

That's normal. If you want to see something either start an X client on it (at which point you should see a mouse pointer) or run it like e.g. `X -retro :1`.


----------



## xiaobin (Aug 2, 2016)

Thank you, Tokik!
`X -retro :1` works. I can see the mouse cursor now, but how can I go back to the console? I tried Ctrl+Alt+Backspace, Ctrl+Alt+F1-12, Ctrl+Alt+Del. But none of them worked. Normally, if I click the power button on the laptop, the system powers off. However, after running `X -retro :1` or `xinit`, the power button does not work any more. I had to press it for a few seconds to force the system to power off then I could restart it.
Sorry for these naive questions!

Do you know of any good documentation that I can learn more about the Xorg system? I tried the official x.org website but could not find any. The man pages are not systematic to me either.


----------



## Oko (Aug 2, 2016)

xiaobin said:


> Do you know of any good documentation that I can learn more about the Xorg system?





X Power Tools (I wrote the 2 star review )

https://www.amazon.com/X-Power-Tool...&qid=1470169583&sr=8-1&keywords=X+Power+Tools

X Windows System Administrator's Guide, Vol 8 (Little old but still very useful).

https://www.amazon.com/Windows-System-Administrators-Definitive-Guides/dp/0937175838/ref=pd_sim_14_3?ie=UTF8&dpID=51mv-uuCMlL&dpSrc=sims&preST=_AC_UL320_SR244,320_&psc=1&refRID=BEJJWK12SQX545X0Q493


----------



## sidetone (Aug 2, 2016)

Did you try opening a terminal console, and using `pkill` (which matches patterns), `killall` or `kill` to kill X?


----------



## Phishfry (Aug 2, 2016)

How about this in your.xinitrc

`xterm &`
`exec X -retro :1`

Then `startx` will bring up Xorg with a terminal window.
Typing `reboot` does just that from a terminal.
Typing `pkill X` exits.

You can add extra programs above your exec command:

`xclock -geometry 100x100-1-1 &`
`seamonkey &`
`xterm &`
`exec X -retro :1`


----------



## Oko (Aug 2, 2016)

Phishfry said:


> How about this in your.xinitrc
> 
> `xterm &&`
> `exec X -retro :1`



How about starting a X window manager and forgetting about all that retro shit? You are suppose to start X by typing `startx` For example my .xinitrc (if you are going to use X Desktop Manager `xdm` for short softlink .xinitrc to .xsession file)


```
xidle -program "/usr/X11R6/bin/xlock" -timeout 300 &
xidle -program "/usr/bin/ssh-add -D" -timeout 300 &
xclock -update 1 -geometry -0+0 &
feh --bg-scale /home/oko/.unix.jpg &
exec cwm
```


And then doing some fine tuning with editing your .Xdefaults file or .Xresources (please see the link to learn about the difference
http://superuser.com/questions/243914/xresources-or-xdefaults)



```
XTerm*termName: xterm-color
XTerm*loginShell: true
XTerm*faceName: Mono
XTerm*faceSize: 11
XTerm*background: black
XTerm*foreground: gray

Xft.antialias: true

XClock*analog: false
XClock*strftime: %T %A %e %B
XClock*face: ter-d12n
XClock*interval: 1
XClock*margin: 0
XClock*foreground: gray
XClock*background: black
```


----------



## tobik@ (Aug 2, 2016)

xiaobin said:


> I tried Ctrl+Alt+Backspace, Ctrl+Alt+F1-12, Ctrl+Alt+Del.


Ctrl+Alt+Backspace will only work if you explicitly enable it with e.g. `setxkbmap -option terminate:ctrl_alt_bksp` in your X session. (Or in xorg.conf with the DontZap option set to False.) It used to work by default in XFree86 but doen't anymore.

I don't know why the Ctrl+Alt+Fn keys don't work for you. It should just work. This is a long shot since you say it works with `startx`, but we often see users forgetting to add kern.vty=vt to /boot/loader.conf. The default console syscons(4) in FreeBSD 10.3-RELEASE does not allow VT switching with Intel/Radeon GPUs.


----------



## xiaobin (Aug 3, 2016)

Thank you for all your replies! Now X works like this:

I added
	
	



```
kern.vty=vt
```
 to /boot/loader.conf. If I run `startx`, X starts with a few xterm windows. But once I press Ctrl+Alt+Fn, the screen turns black and not responding at all. I can't go back to X, nor can I turn off the computer by pressing the power button (which works normally before I start X). But if I start X and exit the last xterm window, the system goes back to console mode correctly. That is, I have problem switching between X and console modes.

If I start X with `X :1 -retro` or `xinit`, X startx normally but I could not go back to the console no matter what I do. Pressing Ctrl+Alt+Fn again makes the system unresponsive at all. I would have to press the power button for a few seconds to turn off the laptop the hard way.

Do you think this has something to do with the video card driver? The X log shows that it is running under the VESA mode. Or maybe my laptop video card is not supported by FreeBSD?


----------



## sidetone (Aug 4, 2016)

If you changed your /etc/ttys file, restore it from the /etc/ directory of the FreeBSD install cd, then re-edit it cautiously. Make sure that you don't have an xorg.conf file that is conflicting.


----------



## wblock@ (Aug 4, 2016)

The Asus web page is very vague about what video is provided.  What does `pciconf -lv | grep -B3 display` say?


----------



## xiaobin (Aug 10, 2016)

I still have problems with starting X. I think the problem is the video card driver. 
I ran `sudo X -configure` and got an /root/xorg.conf.new file. In this file the device section is as follows:


```
Section "Device"
  Identifier "Card0"
  Driver "intel"
  BusID "PCI:0:2:0"
EndSection
```

Then I tried to run `sudo X -config /root/xorg.conf.new` to start the X server. However, it complains by saying  


```
(EE)
Fatal server error:
(EE) no screens found (EE)
```

The /var/log/Xorg.0.log file says:

```
(EE) No devices detected.
(EE) Fatal server error:
(EE) no screens found (EE)
```

If I change the Driver to "vesa", then when I ran `X -retro :1`. It runs normally. I think X is running with the vesa display driver.
The problem with this driver is that the screen does not loot very pleasant: not enough depth, responding slowly, etc.

When I ran `pciconf -lv | grep -B3 display`, I got 


```
vgapci0@pci0:0:2:0:    class=0x030000 card=0x161d1043 chip=0x0f318086 rev=0x0e hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Atom Processor Z36xxx/Z37xxx Series Graphics & Display'
    class      = display
```

I think the graphic card is not supported by the intel driver FreeBSD offers. Am I right?


----------



## windscape (Aug 11, 2016)

Perhaps, but it would be nice to confirm by you supplying the information that wblock asked for. It would also help if you identify your processor by posting the first 20 lines or so of the /var/log/dmesg.today or dmesg file.


----------



## sidetone (Aug 11, 2016)

I didn't see an Intel that started with a "Z" series at https://wiki.freebsd.org/Graphics#Tested_hardware_matrix . If it's by a different name, I missed it.

Use the grep command, `dmesg | grep CPU` to find the processor. xiaobin provided the output wblock@ asked for, unless he adjusted his comment afterwards.


----------



## windscape (Aug 13, 2016)

Hi sidetone,

Yeah, he did provide the information that wblock asked for. If we could determine the exact processor in use that would certainly help to know definitively if the Intel video driver supports his Integrated Graphics or not.


----------

