# Console blank screen (vt)



## Terpentijn (Sep 9, 2019)

I might be a moron. I checked the handbook and searched online but no matter what I try, I can’t get my console to go dark after 3 minutes. It always stays on. Xfce works just fine, but I want my screen to go blank (off) too, if I’m on the console. Can someone tell me what i exactly need to do to accomplish this simple fact?


----------



## olli@ (Sep 9, 2019)

That's one of the features that were _not_ ported from the old syscons sc(4) to the new vt(4) console driver.

Personally I still use sc. To be honest, I think that vt sucks, because too many important features a missing. The manpage promises that it enables “switching between the X Window System and virtual terminals”, but that didn't work for me when I tried it. So there's no reason for me to use vt.


----------



## Terpentijn (Sep 9, 2019)

olli@ said:


> That's one of the features that were _not_ ported from the old syscons sc(4) to the new vt(4) console driver.
> 
> Personally I still use sc. To be honest, I think that vt sucks, because too many important features a missing. The manpage promises that it enables “switching between the X Window System and virtual terminals”, but that didn't work for me when I tried it. So there;s no reason for me to use vt.


Aha. That explains it. For me vt works ok. I can change from console to X and back without any problems. The one problem I still must solve is that all errror messages are echoed to the first vt (which I’m mostly working on) and that’s rather annoying. If I remember correctly there is a way to reroute the messages to another console but I don’t know how. I’ve used FreeBSD back in the days of version 8 and 9. Then switched over to Sun Solaris and switched to Linux after Oracle had taken over Sun. Spent some time on OpenIndiana but it didn’t feel like Solaris. I’m glad to be back on real Unix though. FreeBSD has come a long way and I love ZFS.


----------



## SirDice (Sep 9, 2019)

Terpentijn said:


> The one problem I still must solve is that all errror messages are echoed to the first vt (which I’m mostly working on) and that’s rather annoying.


Edit syslog.conf and remark the first line:

```
*.err;kern.warning;auth.notice;mail.crit                /dev/console
```


----------



## Terpentijn (Sep 9, 2019)

SirDice said:


> Edit syslog.conf and remark the first line:
> 
> ```
> *.err;kern.warning;auth.notice;mail.crit                /dev/console
> ```


That’s an option but that way I will not know about any errors at all. Hmm. Maybe I should just login on the second console.


----------



## SirDice (Sep 9, 2019)

The same things are logged in /var/log/messages. You can also uncomment this one:

```
# touch /var/log/all.log and chmod it to mode 600 before it will work
#*.*                                            /var/log/all.log
```


----------



## CraigHB (Sep 9, 2019)

olli@ said:


> To be honest, I think that vt sucks, because too many important features a missing.



Still?  I'm still using sc as well.  Haven't checked for a while, but was hoping vt was coming along faster than that.  Would like to use vt ~someday~.


----------



## Terpentijn (Sep 9, 2019)

CraigHB said:


> Still?  I'm still using sc as well.  Haven't checked for a while, but was hoping vt was coming along faster than that.  Would like to use vt ~someday~.


When i want to use sc, which settings do I need to change on a standard FreeBSD-12-RELEASE?


----------



## SirDice (Sep 9, 2019)

In /boot/loader.conf:

```
kern.vty=sc
```

Note however that sc(4) has no support for KVM. So you may have problems with Xorg and the Intel or AMD drivers.


----------



## Datapanic (Sep 10, 2019)

CraigHB said:


> Still?  I'm still using sc as well.  Haven't checked for a while, but was hoping vt was coming along faster than that.  Would like to use vt ~someday~.


Same here.


----------



## Terpentijn (Sep 10, 2019)

SirDice said:


> In /boot/loader.conf:
> 
> ```
> kern.vty=sc
> ...


Hm. I’ll stay on vt then because I also need high ascii. UTF-8 is not or not well supported on sc


----------



## `Orum (Sep 10, 2019)

Out of curiosity, what were you doing originally that didn't work?  If `sysrc saver="green"` doesn't work with vt, I might switch back to sc as well, at least for headless systems.

And for the record, I'm definitely able to get the screen to turn off on my FreeBSD laptop, which runs vt for KMS.  I'd have to look at my configuration again to remember what (if anything) I did to achieve it though.  That said, I never use the console, I always just look at its messages from syslog files.


----------



## SirDice (Sep 10, 2019)

`Orum said:


> And for the record, I'm definitely able to get the screen to turn off on my FreeBSD laptop, which runs vt for KMS. I'd have to look at my configuration again to remember what (if anything) I did to achieve it though. That said, I never use the console, I always just look at its messages from syslog files.


Keep in mind that Xorg has its own power-saving settings and your desktop environment might have its own screensaver. Turning the screen off (power saving) with Xorg is done through DPMS.


----------



## yuripv (Sep 10, 2019)

`Orum said:


> Out of curiosity, what were you doing originally that didn't work? If  sysrc saver="green" doesn't work with vt, I might switch back to sc as well, at least for headless systems.



I'm probably missing something obvious, but.. Why would you care about console driver on a headless system?


----------



## olli@ (Sep 10, 2019)

yuripv said:


> I'm probably missing something obvious, but.. Why would you care about console driver on a headless system?


He probably meant a system without X (not headless).


----------



## Terpentijn (Sep 10, 2019)

`Orum said:


> Out of curiosity, what were you doing originally that didn't work?  If `sysrc saver="green"` doesn't work with vt, I might switch back to sc as well, at least for headless systems.
> 
> And for the record, I'm definitely able to get the screen to turn off on my FreeBSD laptop, which runs vt for KMS.  I'd have to look at my configuration again to remember what (if anything) I did to achieve it though.  That said, I never use the console, I always just look at its messages from syslog files.


I would be grateful if you’d lookup your conf to make this happen. I like to work on the cli although I have xfce running smoothly too.


----------



## `Orum (Sep 11, 2019)

olli@ said:


> He probably meant a system without X (not headless).


No, I mean headless.  Almost all of the servers I deal with have KVM but that's a last resort and basically never used.  They also have KVM over IP (thanks to IPMI), but again, I almost never use it.  My main hope was to save power, and possibly the monitor (both backlight and to prevent burn in) if it's ever accidentally left on.  Because I'm diligent about turning it off, I'm not sure if the green saver is actually working or not, but I should probably test it some time to see.



Terpentijn said:


> I would be grateful if you’d lookup your conf to make this happen. I like to work on the cli although I have xfce running smoothly too.


It's my work laptop, so I'll check when I'm next in at work.  As SirDice pointed out though, it's done through DPMS, so it's completely separate from the sc/vt screensavers.  I am using xfce though, so the config will hopefully be more or less the same for you.

And most of my work is done within a CLI/terminal too, but I just open one within the desktop environment.  It's often handy to have a browser and a terminal up on the same screen.


----------



## `Orum (Sep 16, 2019)

Sorry for the late reply, but I finally remembered to look at this while at work.  I've got x11/i3lock installed, which is what I use to lock the screen when I'm AFK.  I then wrote two scripts to work with it, depending on what I want to do.  If I just want to lock, I run the wrapper script:

```
cat `which i3wrap`
#!/bin/sh
revert() {
    xset dpms 0 0 0
}

trap revert HUP INT TERM
xset +dpms dpms 5 5 5
i3lock -nc 670000
revert
```
Alternatively, if I want to lock the machine and have it sleep, I run this:

```
cat `which i3sleep`
#!/bin/sh
i3lock -c 670000
sudo zzz
```
...which needs security/sudo installed and permissions configured to run `zzz` as root without a password.  I put both of these scripts into /usr/local/bin/ (don't forget to `chmod +x`) and set them to keybinds so I can quickly lock/sleep with just a keypress combination.

*Edit: *Now that I look closer, the "FreeBSD red" is actually #ad221d (and not #670000), so you might want to change the color in the scripts if you're a super-nerd like me.


----------



## Terpentijn (Sep 16, 2019)

Thanks 


`Orum said:


> Sorry for the late reply, but I finally remembered to look at this while at work.  I've got x11/i3lock installed, which is what I use to lock the screen when I'm AFK.  I then wrote two scripts to work with it, depending on what I want to do.  If I just want to lock, I run the wrapper script:
> 
> ```
> cat `which i3wrap`
> ...


Thanks for this informative answer.


----------

