# Console resolution with vt



## Moo (Jan 30, 2019)

I am new to FreeBSD and setup a FreeBSD 12 on Virtual Box to see how it works. 
The problem is its resolution after boot is 640x480.

As some articles suggest, add following line in /boot/loader.conf

```
kern.vty=sc
```
then I can change to other modes after reboot with vidcontrol(8)

Is there a way to make this change happen without reboot? Or start another console with this setting?
I thought vt and sc are dirver? but `kldstat` does not show them. And they cannot be load/unload with `kldload/kldunload`

Another problem is how can I do similar things with vt.
Since vt replaces sc after 11.0, I think there should be some ways?
Currently following setting does not work.

```
hw.vga.textmode=0
hw.vga.acpi_ignore_no_vag=1
i915kms_load="YES"
kern.vty=vt
kern.vt.fb.default_mode="1024x768"
```


----------



## SirDice (Jan 30, 2019)

Moo said:


> Is there a way to make this change happen without reboot?


No.


> Or start another console with this setting?


No, only one console driver can be active.



Moo said:


> I thought vt and sc are dirver?


They are, see vt(4) and sc(4)


> but kldstat(8)does not show them.


By default that command only shows dynamically linked modules, i.e. the ones that are kldload(8)'ed. `kldstat -v` will show them.


> And They cannot be load/unload with kldload/kldunload


They are statically linked into the kernel through the GENERIC kernel configuration and therefor cannot be unloaded.


----------



## tommiie (Jan 30, 2019)

Note that I had to manually compile the _new_ i915kms driver. The default one did not support my "recent" computer. Check this thread for more information: Thread how-to-use-the-old-or-the-new-i915kms-driver-for-intel-integrated-graphics-with-xorg.66732


----------



## T-Daemon (Jan 30, 2019)

I’m running one of my FreeBSD 12 installations also in a Virtual Box image. To get a higher resolution in FreeBSD console with vt in VirtualBox:

Edit: I just realized the hard disk image with EFI enabled on the systems motherboard needs to be created before installing FreeBSD. Sorry about that. It’s been a while since I created my image.

If you want to go through the inconvenience, setting up a new virtual machine and installing the system once again, first create the hard disk, and when we are already at it, create a SSD disk image, before installing FreeBSD.

After the initial setup of the virtual machine

- open the virtual machines Settings in VirtualBox
- go to the section System Motherboard
- check under Extended Features “Enable EFI”
(if you have asynchrony time display in FreeBSD to the host system check “Hardware Clock in UTC Time” as well)
- go to the Storage section in the settings
- click on the Controller:IDE
go down at the Storage Devices window and click on the far left icon with a plus
- chose Add SATA Controller
- at Controller: SATA click the right icon to add a hard disk
- in the opening drop down window "Choose existing disk"
- choose the FreeBSD image
- click on the FreeBSD image under Controller: SATA
- on the right side under Attributes check “Solid-state Drive”
- delete the FreeBSD image under Controller: IDE
- exit settings

- install FreeBSD ( I think it should be possible to create the new image, and copy the system from the original image to the new one, but for the sake of simplicity I proposed a fresh install)
- edit /boot/loader.conf, set efi_max_resolution=“1024x768”
- reboot


----------



## bsd5543 (Jan 30, 2019)

I got questions touching a similar problem.

On my systems radeonkms.ko is loaded by /etc/rc.conf.

I'd like to change the resolution and if possible the color of the console.

How would I apply `kern.vt.fb.default_mode="800x600"` to my /etc/rc.conf.

And is there a setting for colors?


----------



## tommiie (Jan 30, 2019)

I don't know about the radeon driver but regarding color support, you can change the 16 default colors in /boot/loader.conf:


```
...
kern.vt.color.4.rgb="#458588" # Blue
kern.vt.color.5.rgb="#b16286" # Purple
kern.vt.color.6.rgb="#689d6a" # Aqua
...
```


----------



## aht0 (Jan 30, 2019)

I don't recomment trying to unload new i915kms.ko from graphics/drm-fbsd12.0-kmod either, once it is loaded up. Attempting it crashed my system (machine rebooted)


----------



## SirDice (Jan 30, 2019)

bsd5543 said:


> How would I apply `kern.vt.fb.default_mode="800x600"` to my /etc/rc.conf.




```
In loader.conf(5):
     hw.vga.textmode=1
     kern.vty=vt
     kern.vt.color.<colornum>.rgb="<colorspec>"
     kern.vt.fb.default_mode="<X>x<Y>"
     kern.vt.fb.modes.<connector>="<X>x<Y>"
```
vt(4), loader.conf(5).


bsd5543 said:


> And is there a setting for colors?




```
kern.vt.color.colornum.rgb
             Set this value to override default palette entry for color
             colornum which should be in a range from 0 to 15 inclusive.  The
             value should be either a comma-separated triplet of red, green,
             and blue values in a range from 0 to 255 or HTML-like hex
             triplet.  See EXAMPLES below.
```
vt(4) again.


----------



## bsd5543 (Jan 30, 2019)

Thx, that worked just fine.

So I have to apply the settings in /boot/loader.conf although radeonkms.ko is started later by /etc/rc.conf.


----------



## SirDice (Jan 30, 2019)

Speaking of colors, and specifically [COLOR] usage in forum posts, please stop using them.

Formatting: The Short Form
The value of format tags
Formatting Guidelines


----------



## Moo (Jan 31, 2019)

No luck after some tries in vt.

I can use *startx *to enter xfce GUI environment (forgot where I installed this) without i915kms.
So I think this driver is not necessary?

And according to vt(4),

```
kern.vt.fb.default_mode
         Set this value to a graphic mode to override the default mode
         picked by the vt backend.    The mode is applied to all output con-
         nectors.  This is currently only supported    by the vt_fb backend
         when it is    paired with a KMS video    driver.
```

So before finding a KMS driver for this, I guess the way to show more information on terminal is to change the font...


----------

