# changing tty resolution



## gomster (Mar 26, 2021)

I have a fresh freebsd installation and the resolution is pretty low. How/could I change it to 1920x1080 from the loader onwards??


----------



## zirias@ (Mar 26, 2021)

Do you boot with UEFI or "legacy" (gptzfsboot)?

In any case, you have to edit /boot/loader.conf. See loader.conf(5):

```
efi_max_resolution

           vbe_max_resolution
                     Specify the maximum desired resolution for the EFI or VBE
                     framebuffer console.  The following values are accepted:

                     Value           Resolution
                     480p            640x480
                     720p            1280x720
                     1080p           1920x1080
                     2160p           3840x2160
                     4k              3840x2160
                     5k              5120x2880
                     WidthxHeight    WidthxHeight
```


----------



## SirDice (Mar 26, 2021)

Several ways, but it's going to depend on how your system boots (UEFI or BIOS) and your graphics driver (or else you might not be able to get anything higher than 1024x768).

Many options exist for loader.conf(5), there are also some options from vt(4) you can set.


----------



## gomster (Mar 26, 2021)

Zirias said:


> Do you boot with UEFI or "legacy" (gptzfsboot)?
> 
> In any case, you have to edit /boot/loader.conf. See loader.conf(5):
> 
> ...


I use uefi


----------



## gomster (Mar 26, 2021)

SirDice said:


> Several ways, but it's going to depend on how your system boots (UEFI or BIOS) and your graphics driver (or else you might not be able to get anything higher than 1024x768).
> 
> Many options exist for loader.conf(5), there are also some options from vt(4) you can set.


I use uefi and the latest nvidia driver. I followed this tutorial: 



_View: https://youtu.be/Q6KxMUY2aTU_


----------



## zirias@ (Mar 26, 2021)

Then try setting `efi_max_resolution` as documented.

The default behavior is to adapt the font size to the resolution to still reach (roughly) an 80x24 console, so if your goal is to fit more text on the screen, you should also set the font size, e.g. `screen.font="8x16"`


----------



## T-Daemon (Mar 26, 2021)

Zirias said:


> In any case, you have to edit /boot/loader.conf. See loader.conf(5):



We should ask OP which version is running. The linked loader.conf(5) manual is 12.2, what you are quoting is 13.0.



Zirias said:


> The default behavior is to adapt the font size to the resolution to still reach (roughly) an 80x24 console, so if your goal is to fit more text on the screen, you should also set the font size, e.g. `screen.font="8x16"`


`screen.font` is available on 13.0 and upwards, with a small set of fonts in /boot/fonts to choose from.


----------



## zirias@ (Mar 26, 2021)

T-Daemon said:


> We should ask OP which version is running. The linked loader.conf(5) manual is 12.2, what you are quoting is 13.0.


Indeed, but in case of `efi_max_resolution`, it doesn't really make a difference.


T-Daemon said:


> `screen.font` is available on 13.0 and upwards, with a small set of fonts in /boot/fonts to choose from.


Agreed. In the likely case this is not yet 13, the magic of choosing a larger font won't be there yet, so he can just ignore what I wrote


----------



## gomster (Mar 26, 2021)

Zirias said:


> Indeed, but in case of `efi_max_resolution`, it doesn't really make a difference.
> 
> Agreed. In the likely case this is not yet 13, the magic of choosing a larger font won't be there yet, so he can just ignore what I wrote


So if i wanted to set a resolution of 1920x1080 on version 12, I would type what exactly for it to work on 12?


----------



## gomster (Mar 26, 2021)

I h


Zirias said:


> Indeed, but in case of `efi_max_resolution`, it doesn't really make a difference.
> 
> Agreed. In the likely case this is not yet 13, the magic of choosing a larger font won't be there yet, so he can just ignore what I wrote


I have set efi_max_resolution=“1920x1080” but it doesnt make any difference so i guess it was the same b4 i actually set it. But the text is really large. But i cant change that on 12? Can i upgrade to 13?


----------



## SirDice (Mar 26, 2021)

If you want readable text with a good scroll performance you should just run Xorg. Then open a full screen terminal. It'll perform much better than the console at that resolution. Better font options too.


----------



## gomster (Mar 26, 2021)

SirDice said:


> If you want readable text with a good scroll performance you should just run Xorg. Then open a full screen terminal. It'll perform much better than the console at that resolution. Better font options too.


I will run an x server. This is more aesthetic.... could i decrease the tty text size?


----------



## eternal_noob (Mar 26, 2021)

SirDice said:


> there are also some options from vt(4) you can set.


gomster : Have you tried the suggestion SirDice gave you? I.e. did you try setting `kern.vt.fb.default_mode`?


----------



## gomster (Mar 26, 2021)

eternal_noob said:


> gomster : Have you tried the suggestion SirDice gave you? I.e. did you try setting `kern.vt.fb.default_mode`?


I tried setting the resolution. However the text is still very large and i dont know how to decrease its size


----------



## Snurg (Mar 26, 2021)

SirDice said:


> If you want readable text with a good scroll performance you should just run Xorg. Then open a full screen terminal. It'll perform much better than the console at that resolution. Better font options too.


Wouldn't the abysmal scroll speed be (quite) easy to fix by using the hardware scrolling of the CRTC?

I never understood why that feature wasn't being used more commonly.
I mean, why move 4 kilobytes of text, or many times more kilobytes in graphic data, if you just can tell the CRTC to display with another start line offset (14-bit value, should work even with the most modern displays) in the circular frame buffer?
Because of this, almost every terminal I have seen scrolled way faster than any 32-bit PC...  



gomster said:


> I will run an x server. This is more aesthetic.... could i decrease the tty text size?


vidcontrol() has some options afaik... didn't need yet to explore this, as I run still non-UEFI mode, and thus can use sc() in text mode.


----------



## T-Daemon (Mar 27, 2021)

gomster said:


> I have set efi_max_resolution=“1920x1080” but it doesnt make any difference so i guess it was the same b4 i actually set it. But the text is really large. But i cant change that on 12?


What does `dmesg | grep 'VT(efifb)'` return? Does the resolution show 1920x1080?

Alternatively, for 12.2 (and >13.0), you can set an other font (size) to the console. There are some fonts you can choose from in /usr/share/vt/fonts, you can try them with vidfont(1). If you don't like them follow the link to see how to create custom fonts:









						Increase terminal font with allscreens?
					

How do I increase the terminal font size by using the allscreens variable in rc.conf?  In my file, I have allscreens_flags="green" which sets the font to green. If this is put into /boot/loader.conf, will these settings occur sooner during boot up?




					forums.freebsd.org


----------



## mickey (Mar 27, 2021)

Zirias said:


> In any case, you have to edit /boot/loader.conf. See loader.conf(5):
> 
> ```
> vbe_max_resolution
> ...


Wait, what?! Does that mean that 13.0 brings VBE support to vt(4)? Maybe there's still hope for my server console.


----------



## gomster (Mar 27, 2021)

I’m new to freebse and b4 i had a virtual machine with it. The resolution was great and the text looked really sharp. Now i have installed it on hardware and have set resolution to 1920x1080. I have the nvidia drivers, but when the pc boots it says resolution 800x600. All the text fits into the screen, sometimes it makes another line... i apparently use vt and some people have told me to use sc. i am kind of confused as to what to do now... The tty text is quite large. How exaclty can i decrease its size/ how can i know what resolution i’m using on the tty?


----------



## eternal_noob (Mar 27, 2021)

Please don't open multiple threads on the same topic: https://forums.freebsd.org/threads/changing-tty-resolution.79529/


----------



## zirias@ (Mar 27, 2021)

mickey said:


> Wait, what?! Does that mean that 13.0 brings VBE support to vt(4)? Maybe there's still hope for my server console.


The mode is set by loader, but as a result, you have your console on some higher-resolution framebuffer even with legacy boot, yes. I tested it on my desktop and it was somewhat slow (EFI fb is faster here) and also broke compositing in X11 with radeonkms.ko, so I went back to classic VGA text console boot. And for my server, it's not interesting, this thing doesn't have any graphics


----------



## mickey (Mar 27, 2021)

Zirias said:


> The mode is set by loader, but as a result, you have your console on some higher-resolution framebuffer even with legacy boot, yes. I tested it on my desktop and it was somewhat slow (EFI fb is faster here) and also broke compositing in X11 with radeonkms.ko, so I went back to classic VGA text console boot. And for my server, it's not interesting, this thing doesn't have any graphics


I'm not looking to run X11 on my server console, but the ability to use anything that gives more space for text than the 640x480x16 that vt_vga currently gives surely would be nice. Unfortunately Gigabyte did not feel the necessity to include a graphics port on that mainboard, so I had to go with 'what was available' and does not consume much power:

```
vgapci0@pci0:3:5:0:     class=0x030000 card=0x0100102b chip=0x051a102b rev=0x02 hdr=0x00
    vendor     = 'Matrox Electronics Systems Ltd.'
    device     = 'MGA 1064SG [Mystique]'
    class      = display
    subclass   = VGA
```
I guess VBE is the only option to get higher resolutions, but I'd rather not go back to using sc(4).


----------



## Snurg (Mar 27, 2021)

mickey said:


> I guess VBE is the only option to get higher resolutions, but I'd rather not go back to using sc(4).


You also can try to use the graphical mode of sc().
I haven't tried that yet, as I hate slow scrolling.
But from what I read here, it might actually be better suited for you, as you can choose freely from the available vesa modes, as well choose freely the font to be used.

From what I understand from reading the sc() man page, the resulting console size reflects the ratio screen size/font size.
So it seems to depend on the font you use, and you aren't going to be incapacitated by vt() insisting you to have 80x24 and not larger.

And if you ever decide you want to run xorg, that Matrox card is supported by x11-drivers/xf86-video-mga.


----------



## mickey (Mar 27, 2021)

Snurg said:


> You also can try to use the graphical mode of sc().


Not sure whether you need a graphical mode, but sc(4) relies on vga(4) which seems to have optional support for VESA BIOS extensions (VBE) so you could probably go with any VESA text or graphics mode supported by the hardware. But going down that road would probably mean loosing unicode support and some other nice stuff that came with vt(4).


Snurg said:


> And if you ever decide you want to run xorg, that Matrox card is supported by x11-drivers/xf86-video-mga.


I have no plans on running Xorg on a server console that is solely used for maintenance, but it's good to know that it could work 
I had no plans on having sound on a server console either, but as I recently laid my hands on a nice used Eizo display with integrated speakers... you know...


----------

