# Screen turn off after startx?



## Panadestein (Apr 30, 2017)

Hello everyone!

I recently installed FreeBSD 11.0 for the first time and now I'm trying to set my DE. I successfully installed X.Org and Xfce. After I configured properly my .xinitrc adding this line 
	
	



```
exec /usr/local/bin/startxfce4
```
. After rebooting, I got some error messages when I issued `startx`, all of them related with vesa driver. So I tried installing the xf86-intel-video driver, and got a better font rendering on my screen (system terminal). After rebooting again, and issuing `startx`, my screen virtually turned off! NO video at all, none of the virtual terminals. At this point, I humbly ask for your help.

This is my /var/log/Xorg.0.log: https://pastebin.com/wubKprpZ.

Edit: I forgot to mention that at the beginning (just before installing Xfce and the xf86-intel-video driver) I tried i3wm and I was able to `startx` successfully, however, applications like Firefox didn't work.


----------



## Phishfry (Apr 30, 2017)

Add `dbus_enable="YES"` to /etc/rc.conf  for Xfce4.

That or one start it.
https://forums.freebsd.org/threads/60634/#post-348862


----------



## Panadestein (Apr 30, 2017)

Phishfry said:


> Add `dbus_enable="YES"` to /etc/rc.conf  for Xfce4.


Just tried this my friend, and the same result: screen turned off. This is really strange...


----------



## Phishfry (Apr 30, 2017)

For Intel video try this in /etc/rc.conf
`kld_list="i915kms"`


----------



## Phishfry (Apr 30, 2017)

I see from your xorg log that your using a Q35 chipset board with Intel video.
You would think that it would be supported by the Intel xf86 driver.
There is a backup driver that works when vesa fails. Checkout scfb.
https://wiki.freebsd.org/Graphics/SCFB


----------



## Handy92 (Apr 30, 2017)

i had the same problem Someone broke xorg pkg just missing some files. Upgrade freebsd, portstree and reinstall xorg from ports. I was install from DVD.

`make reinstall clean batch=yes` from x11/xorg folder and go to sleep...

After that add your username into /etc/group VIDEO


----------



## Panadestein (May 1, 2017)

Handy92 said:


> Someone broke xorg pkg just missing some files. Upgrade freebsd, portstree and reinstall xorg from ports.


This sounds like a very long process. I don't understand, I didn't mess up with the configuration of X.Org, I just followed the handbook to install it, and this is pretty straightforward. The user that I created belongs to the wheel group, isn't that enough to have video?


----------



## Handy92 (May 1, 2017)

Did You install FreeBSD from memstick? Can You show, photo, Your /etc/pkg/FreeBSD.conf?

On the new compilation of pkg requed is add user to video group. Handbook is old. Did You tried to reinstall Xorg from ports, before that upgrade system?  Use pw() or `ee /etc/group` find video and add your username.

1. `freebsd-update fetch`
2. `freebsd-update install`
3. `portsnap fetch`
4. `portsnap extract`
5. `[B]cd /usr/ports/x11/xorg[/B]`
6. `make install clean BATCH="YES"` - batch If defined, only operate on a port if it can be installed 100% automatically. Without "enter" all the time.
7. `ee /etc/group`
8. video:*:44:YOUR_USERNAME


----------



## Panadestein (May 1, 2017)

Handy92 said:


> Did You install FreeBSD from memstick? Can You show, photo, Your /etc/pkg/FreeBSD.conf?


Hello, I attach to this message the picture of the file /etc/pkg/FreeBSD.conf (sorry for the quality). Unfortunately, I did all your suggested steps and that didn't work: screen turns off again. I updated the system, reinstalled X.Org via ports, added my user to the video group, and still no luck.


----------



## SirDice (May 1, 2017)

What kind of hardware does the machine have? Specifically the video card and the exact model of the CPU/GPU.


----------



## Panadestein (May 1, 2017)

SirDice said:


> What kind of hardware does the machine have? Specifically the video card and the exact model of the CPU/GPU.


This is my video card:

```
VGA compatible controller: Intel Corporation 82Q35 Express Integrated Graphics Controller (rev 02)
```
And my CPU:

```
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 15
Model name:            Intel(R) Core(TM)2 Duo CPU     E4600  @ 2.40GHz
Stepping:              13
CPU MHz:               1200.000
CPU max MHz:           2400.0000
CPU min MHz:           1200.0000
BogoMIPS:              4789.54
L1d cache:             32K
L1i cache:             32K
L2 cache:              2048K
NUMA node0 CPU(s):     0,1
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm dtherm
```


----------



## Handy92 (May 1, 2017)

https://forums.freebsd.org/threads/44597/

```
[LIST=1]
[*][  1770.319] (II) UnloadModule: "mouse"
[*][  1770.320] (II) UnloadModule: "kbd"
[/LIST]
```


did You have hald_enable="YES" and dbus_enable="YES" set into /etc/rc.conf?


----------



## SirDice (May 1, 2017)

Xorg doesn't use HAL anymore. It's using devd(8) by default now. 

Panadestein can you post a recent Xorg.0.log? Did you create a xorg.conf? Did you add frequencies to the Monitor section? I'm thinking it may try to open a screen with too high frequencies and the monitor switches off in order to protect itself.


----------



## Panadestein (May 1, 2017)

Handy92 said:


> did You have hald_enable="YES" and dbus_enable="YES" set into /etc/rc.conf?


I have dbus_enable="YES" in my /etc/rc.conf but not hald_enable="YES", however:


SirDice said:


> Xorg doesn't use HAL anymore. It's using devd(8) by default now.



This is my /etc/rc.conf:

```
dbus_enable="YES"
hostname="panadestein"
create_args_wlan0="country FR"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
#ifconfig_ue0="DHCP"
#wlans_urtwn0="wlan0"
#ifconfig_wlan0="WPA SYNCDHCP"
```


----------



## Panadestein (May 1, 2017)

SirDice said:


> Panadestein can you post a recent Xorg.0.log? Did you create a xorg.conf? Did you add frequencies to the Monitor section? I'm thinking it may try to open a screen with too high frequencies and the monitor switches off in order to protect itself.


The log that I posted at the beginning was created the first time the problem appeared, this is the last log Xorg.0.log.

I didn't create a xorg.conf, because I thought it was automatically created...


----------



## Handy92 (May 1, 2017)

How did You paste log on Pasterbin without Xorg.


----------



## Panadestein (May 1, 2017)

Handy92 said:


> How did You paste log on Pasterbin without Xorg.




```
sudo mount -r -t ufs -o ufstype=ufs2 /dev/sda1 /mnt/FreeBSD/
```
 from Arch Linux


----------



## SirDice (May 1, 2017)

Handy92 said:


> How did You paste log on Pasterbin without Xorg.


Quite a useful tool: misc/pastebinit.


----------



## Handy92 (May 1, 2017)

Android... 



> Edit: I forgot to mention that at the beginning (just before installing Xfce and the xf86-intel-video driver) I tried i3wm and I was able to  startx successfully, however, applications like Firefox didn't work.



Can You strat Xorg withount any Windo Manager and run from console firefox, and paste here respond.


----------



## Panadestein (May 1, 2017)

Handy92 said:


> Can You strat Xorg withount any Windo Manager and run from console firefox, and paste here respond.


No, just tried. Impossible to startx in any way, same result: screen turns off and have to reboot because mouse and keyboard are useless.

Impossible as a normal user and as root.


----------



## Handy92 (May 1, 2017)

But first time only Xorg start normally write?


----------



## Panadestein (May 1, 2017)

Handy92 said:


> But first time only Xorg start normally write?


Yes, the first time (after install X.Org and i3wm) I could get into the i3wm session, but as I commented, some applications were misbehaving (or not starting at all), then I installed the other driver and Xfce4 (also tried to remove xf86-intel-video-vesa but I couldn't because it wanted to remove the hole X.Org) and that started the problem.


----------



## Handy92 (May 1, 2017)

If it the fresh installation of FreeBSD Can You reinstall system, upgrade them, upgrade package using `pkg update -f` and install only Xorg again : `pkg install x11/xorg`


----------



## Panadestein (May 1, 2017)

Handy92 said:


> When Xorg startet, You can see something it isnt Driver prioblem. Is library or something.


I know it should be something related with the vesa driver, because in Arch Linux I had exactly the same issue (not screen turned off, but X not starting), when I purged vesa it was fixed.


----------



## Handy92 (May 1, 2017)

FreeBSD is not Linux. Before change driver to VESA Xorg start normally, I don't know what You are exactly do and what messages was printing into console when You tried to run FF, so i suggested reinstall system and install it stedy, once again.

PS. Did You do that?

```
To set the VESA driver in a configuration file:
```
https://www.freebsd.org/doc/handbook/x-config.html
point 5.3


----------



## Panadestein (May 1, 2017)

Handy92 said:


> FreeBSD is not Linux.


I know this very well, that's in the first place, the reason for which I'm installing it (when I met Arch, I stopped distro hopping in the Linux world).

I will try your suggestion of manually configure xorg (even when it's not recommended https://www.freebsd.org/doc/handbook/x-config.html). Thanks


----------



## Panadestein (May 1, 2017)

Ok I did the last step, and got a segmentation fault when configuring X.Org manually:
The file /root/xorg.conf.new

```
Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        Screen      1  "Screen1" RightOf "Screen0"
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
        ModulePath   "/usr/local/lib/xorg/modules"
        FontPath     "/usr/local/share/fonts/misc/"
        FontPath     "/usr/local/share/fonts/TTF/"
        FontPath     "/usr/local/share/fonts/OTF/"
        FontPath     "/usr/local/share/fonts/Type1/"
        FontPath     "/usr/local/share/fonts/100dpi/"
        FontPath     "/usr/local/share/fonts/75dpi/"
EndSection

Section "Module"
        Load  "glx"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option      "Device" "/dev/sysmouse"
        Option      "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Monitor"
        Identifier   "Monitor1"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "ShadowFB"                  # [<bool>]
        #Option     "DefaultRefresh"            # [<bool>]
        #Option     "ModeSetClearScreen"        # [<bool>]
        Identifier  "Card0"
        Driver      "vesa"
        BusID       "PCI:0:2:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "SWcursor"                  # [<bool>]
        #Option     "kmsdev"                    # <str>
        #Option     "ShadowFB"                  # [<bool>]
        #Option     "AccelMethod"               # <str>
        #Option     "PageFlip"                  # [<bool>]
        #Option     "ZaphodHeads"               # <str>
        Identifier  "Card1"
        Driver      "modesetting"
        BusID       "PCI:0:2:1"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
                Viewport   0 0
                Depth     1
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     4
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     4
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection

Section "Screen"
        Identifier "Screen1"
        Device     "Card1"
        Monitor    "Monitor1"
        SubSection "Display"
                Viewport   0 0
                Depth     1
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     4
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection
```

The new /var/log/Xorg.0.log.


----------



## Handy92 (May 1, 2017)

> /root/xorg.conf.new



How Did You starting Xorg?


----------



## Panadestein (May 1, 2017)

Handy92 said:


> How Did You starting Xorg?


I did not:

```
sudo Xorg -configure
```
That generates a new config, but it failed as you can see.


----------



## Handy92 (May 1, 2017)

```
[   292.059] (**) ModulePath set to "/usr/local/lib/xorg/modules"
[   292.060] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[   292.060] (WW) Disabling Mouse0
[   292.060] (WW) Disabling Keyboard0
[   292.060] (EE) open /dev/dri/card0: No such file or directory
[   292.060] (WW) Falling back to old probe method for modesetting
[   292.059] (==) Automatically adding devices
[   292.059] (==) Automatically enabling devices
[   292.059] (==) Not automatically adding GPU devices
```

Youst reinstall system will be faster and easier.


----------



## Panadestein (May 1, 2017)

Handy92 said:


> reinstall system will be faster and easier.


OK, I appreciate a lot your suggestions, but let me humbly argue, is that what you should usually do when you have this kind of issue? Take the former statement as a question if you want...


----------



## Handy92 (May 1, 2017)

I thing if vesa driver something broke, reinstall xorg from ports upgrading vesa driver too. You shold first install Xorg, then configure cp into xorg catalog, anfter that install some WM. Now You have mess


----------



## SirDice (May 1, 2017)

Reinstalling is just going to be a waste of time. It's a configuration issue. I'm wondering why the 'manual' configuration picked up two video cards. Is this a laptop? Does it have one of those combined video cards? NVidia/Intel? Can you turn one or the other off in the BIOS?


----------



## Panadestein (May 1, 2017)

SirDice said:


> Reinstalling is just going to be a waste of time. It's a configuration issue. I'm wondering why the 'manual' configuration picked up two video cards. Is this a laptop? Does it have one of those combined video cards? NVidia/Intel? Can you turn one or the other off in the BIOS?


No, is a desktop and not particularly new: Dell OptiPlex 755. 
And it has only an Intel integrated video card (I already posted).

P.D: I totally agree with you, reinstall is just a waste of time!


----------



## Panadestein (May 2, 2017)

OK, this is really frustrating. Yesterday I purged X.Org, Xfce and i3wm. And reinstalled only X.Org and i3wm, same results, no video at all.

I don't know what else to do, I'm really lost here. Please, help me.


----------



## SirDice (May 2, 2017)

From your posted xorg.conf, remove Screen1, Monitor1 and Card1. Don't forget to adjust ServerLayout too.


----------



## Handy92 (May 2, 2017)

How meny people that meny solution. I do not like mess into machine. .

And I must sorry. Maybe really is driver problem. 3D Support. 'Q'.

Remove all Xorg file with dependiences but is hard. Easy is reinstall system if it fresh, update it and install Clean Xorg again. Then do nothing and write massage on forum. Or Use PC-BSD (if it still alive). is better for new FreeBSD users family.

No Offence but I consider if operating system is not a draft. And I do not accept ANY part of every program, systems or aplication what is *absolutelly* nessesery for work the program. I understand if programmers in corporation must do something, that is the once of reason why I am using alternate systems (or F I X cause to work windows aplikations) Is isnt broke via Corporation. Second is *Still High *code quality, fasting of working resulting from begining of todays computer History(virtual Windows10 installation work better, for native instalation!). Linux if it working some time, slowlig. Windows too. *BSD not. Only hardware, only performance Only assembler. Only science Please do not broke it.



> I'm wondering why the 'manual' configuration picked up two video cards.


 So he's doesn't say all the true. Interesing if he read manuals and use something solution from here. I thing if not...


----------



## Panadestein (May 2, 2017)

Yes, I don't really understood you, but at the same time, I think I did it (just to follow your ramblings, which I do appreciate a lot). Anyway, I'm leaving now, just tried the last SirDice suggestion without luck, and that's it. Thank you all of you for your help...Bye.


----------

