# ttys disappeared after installing xorg



## winkoe (Dec 6, 2021)

12.2-RELEASE-p7 as dual installation on elderly IMac.

After booting I get the login shell on ttyv0. With `startx` the KDE desktop starts on ttyv8. However trying to switch back to any ttyv0 ... ttyv7 results in a black screen. Only ctrl-alt-F9 offers the expected response i.e. brings back the KDE desktop.

Is that a well known hangup? Is there an easy remedy? How should I proceed?

Thank you
winkoe


----------



## SirDice (Dec 6, 2021)

Using an older NVidia driver I guess?


----------



## winkoe (Dec 6, 2021)

Yes, the 340 type.  That was the successful one on a previous installation of 11.0-RELEASE


----------



## SirDice (Dec 6, 2021)

The older NVidia drivers weren't KMS aware.


----------



## winkoe (Dec 6, 2021)

But the previous installation with the same NVidia driver did not show the same behaviour.  According to Handbook 5.4.3. I tried /boot/loader.conf with and without 
	
	



```
kern.vty=vt
```
.  Also /usr/local/share/X11/xorg.conf.d/10-xorg.conf is identical.


----------



## SirDice (Dec 7, 2021)

winkoe said:


> I tried /boot/loader.conf with and without


`kern.vty=vt` is the default. It's not going to change anything if you set it. You might have more luck setting this to sc(4) though.


----------



## Andriy (Dec 7, 2021)

`# For nvidia use this
kern.vty="vt"
hw.vga.textmode=1
# ... OR this
#kern.vty="sc"`
This should be FAQ.


----------



## SirDice (Dec 7, 2021)

No need for text mode or setting `kern.vty` (setting it to something it's already on by default is pretty useless too) on the latest NVidia drivers. It's the old drivers that aren't KMS aware.


----------



## shkhln (Dec 7, 2021)

KMS has nothing to do with it. I don't think it even works with Nvidia on FreeBSD (all driver versions).


----------



## winkoe (Dec 7, 2021)

I did 
	
	



```
kern.vty="sc"
```
 but now booting comes to a halt even before 'single user' is reached. 
With a live Linux Kali disk I can mount and read the faulty /boot/loader.conf,  but write i can't.
`mount -t ufs -r -o ufstype=ufs2  /dev/...   /mnt/`
How can I get out of this mess?

winkoe


----------



## shkhln (Dec 7, 2021)

Why would you mount anything from Linux? A FreeBSD installation image is all you need.


----------



## SirDice (Dec 8, 2021)

shkhln said:


> I don't think it even works with Nvidia on FreeBSD (all driver versions).


It does work on my system (GTX1080 using the x11/nvidia-driver). But I do CSM boot the machine, UEFI boot has problems with the efifb, no image but does boot. With a CSM boot I get a good boot and I can switch back and forth between Xorg and TTYs without problems. On an older system, using the 390 driver, I get the same colored blocks as the OP.


----------



## Andriy (Dec 8, 2021)

SirDice said:


> No need for text mode or setting `kern.vty` (setting it to something it's already on by default is pretty useless too) on the latest NVidia drivers. It's the old drivers that aren't KMS aware.


vt was there just for the documentation purposes, to explicitly show both alternatives.
I have those settings for many years and wasn't aware that the newer driver does not need them.
Will re-test. Thank you!


----------



## T-Daemon (Dec 8, 2021)

shkhln said:


> I don't think it even works with Nvidia on FreeBSD (all driver versions).





SirDice said:


> It does work on my system (GTX1080 using the x11/nvidia-driver). But I do CSM boot the machine, UEFI boot has problems with the efifb, no image but does boot. With a CSM boot I get a good boot and I can switch back and forth between Xorg and TTYs without problems. On an older system, using the 390 driver, I get the same colored blocks as the OP.


I can confirm.

On my BIOS system

- 13.0-RELEASE
- nVIDIA GT 630 Rev. 2
- (un-patched) * x11/nvidia-driver v470.86
- switched to VBE (VESA BIOS extension) frame buffer mode (loader.conf - `vbe_max_resolution="1080p"`)

I can switch to virtual terminals from a running Xorg session normally, no colored blocks, as it is without VBE enabled, or under 12.2-RELEASE (no VBE support here).

* I haven't checked if a patch has been merged into the nvidia source code.


----------



## winkoe (Dec 9, 2021)

Ok. Still working on it. Thank you so far.

winkoe


----------



## Andriy (Dec 13, 2021)

SirDice said:


> No need for text mode


Cannot confirm in my environment.
stable/13, nvidia-driver-470.86, BIOS boot (no UEFI support).
If I don't set hw.vga.textmode=1 then I get the colored boxes when switching from X to  a console.


----------



## T-Daemon (Dec 14, 2021)

Andriy said:


> If I don't set hw.vga.textmode=1 then I get the colored boxes when switching from X to a console.


Have you tried switching to VBE (post #14). For my system only the maximum resolution value of 1080p (1920x1080) has an effect.


----------



## Andriy (Dec 21, 2021)

T-Daemon said:


> Have you tried switching to VBE (post #14). For my system only the maximum resolution value of 1080p (1920x1080) has an effect.


I just did and it works very well. Much better than my old trick. Thank you!
Just in case, this is what I have in my loader.conf now:

```
# For nvidia it's best to use this:
vbe_max_resolution="1080p"
# and this should work just the same as above:
#screen.textmode="0"
# A worse alternative (smaller console screen size):
#-#hw.vga.textmode=1
# Another alternative is to use sc instead of vt
#-#kern.vty="sc"
```


----------

