# Trouble with changing console resolution



## alwalo (Sep 15, 2016)

I have managed to install FreeBSD on Samsung R540 without problems. I am currently writing from firefox with openbox wm. I am trying to change video mode according to 3.2.3 point in handbook:

https://www.freebsd.org/doc/handbook/consoles.html

when i try to load vesa module i get this error:


```
kldload: an error occurred while loading the module. Please check dmesg(8) for more details.
```

i follow up with dmesg:


```
info: [drm]   - kern.vt.fb.default_mode
fbd0 on drmn0
VT: Replacing driver "vga" with new "fb".
info: [drm] Initialized i915 1.6.0 20080730 for drmn0 on minor 0
module_register_init: MOD_LOAD (vesa, 0xffffffff81af8000, 0) error 19
sysctl_unregister_oid: failed to unregister sysctl
module_register_init: MOD_LOAD (vesa, 0xffffffff81af8000, 0) error 19
sysctl_unregister_oid: failed to unregister sysctl
module_register_init: MOD_LOAD (vesa, 0xffffffff81af8000, 0) error 19
sysctl_unregister_oid: failed to unregister sysctl
```

I paste only last lines cause it is too long and I suspect it is problem with this error 19.


----------



## SirDice (Sep 16, 2016)

That part of the handbook is a bit old and needs an update. It assumes you're using sc(4), while recent FreeBSD releases have switched to vt(4). It works a little differently and not all functionality from sc(4) is available yet. That said, you should be able to change the console's resolution.

Also note that recent FreeBSD releases already have VESA included in the GENERIC kernel.

https://wiki.freebsd.org/Newcons


----------



## DiaoWang (Apr 15, 2017)

Hello!Do you solve the problem now?
I have the same problem and still can't solve it.
Can you help me?


----------



## Chris_H (Apr 18, 2017)

For anyone struggling with this, or similar issues. Please have a look at syscons(4), and vt(4), as well at the web page for the so-called newcons as SirDice also mentioned.
I would only add, that as I write this, the desktop I'm writing it from is running -CURRENT (12-CURRENT). I had some issues with the hardware I got (AMD APU with radeon on it). So ultimately I had to pick up an nVidia card, and load that for high resolution graphics. Point I'm trying to make; is that there are options available to you. You do not have to boot to (U)EFI if you choose not to. You are not required to use vt(4) if you don't want to. In fact, syscons(4) while not the default. _Has_ been the default for _many_ years, and has just got some recent updates to it. This is the direction I chose. You can do so by
1) choosing "legacy", or NON UEFI/EFI from your BIOS setup
2) adding the following to /boot/loader.conf(5):

```
kern.vty=sc
```
While this won't instantly _guess_ what resolution you want your console to boot at. It's a good place to start before hand. At which time you can give the syscons(4) man pages a read. Which will tell you how to determine what resolutions your graphics hardware supports, and pretty much how to set those resolutions. As well as some other interesting things. 

HTH

--Chris


----------



## DiaoWang (Apr 20, 2017)

Chris_H said:


> For anyone struggling with this, or similar issues. Please have a look at syscons(4), and vt(4), as well at the web page for the so-called newcons as SirDice also mentioned.
> I would only add, that as I write this, the desktop I'm writing it from is running -CURRENT (12-CURRENT). I had some issues with the hardware I got (AMD APU with radeon on it). So ultimately I had to pick up an nVidia card, and load that for high resolution graphics. Point I'm trying to make; is that there are options available to you. You do not have to boot to (U)EFI if you choose not to. You are not required to use vt(4) if you don't want to. In fact, syscons(4) while not the default. _Has_ been the default for _many_ years, and has just got some recent updates to it. This is the direction I chose. You can do so by
> 1) choosing "legacy", or NON UEFI/EFI from your BIOS setup
> 2) adding the following to /boot/loader.conf(5):
> ...



Thanks very much,but I'm a freshman for the FreeBSD,I just install it in VMware12,and I don't know what is syscons(4) or vt(4).I just read the handbook 3.2.3 in English and Chinese handbook 4.2.6(It's expired,options command has not been found) ,It's the next step after installing the system. Because Chinese handbook hax expired,I can only to read the English handbook,but the kldload error 19 always exist.

I don't know how to edit the rc.conf,the hand book just tell that I need kldload VESA ,and select a mode from the list of video modes.
On the other hand,my English can not fully understand your words.but I really want to study FreeBSD,please help me!!!!!Beg you!


----------



## Chris_H (Apr 20, 2017)

Hello, DiaoWang !
In an effort to *under*complicate this. I'm going to suggest the following, as a starting point. 
edit /boot/loader.conf *ensure* that the following line does NOT exist:
kern.vty=vt
If it does. Replace it with kern.vty=sc. If that line doesn't exist at all. Then add kern.vty=sc to it.
This will work best if you do NOT boot into UEFI, or EFI mode. You can ensure that you don't, by changing the boot settings within your BIOS. eg; boot order. It might have legacy, or something. But just ensure that the *first* choice is *not* UEFI, or EFI.
That should be enough to get you started. You can add the following to /etc/rc.conf. But I would wait for a successful boot to syscons(4), and then issue this, after you have logged in.
`vidcontrol VESA_800x600`
This should be a safe start. Please report back with your findings.

Good luck! 

--Chris


----------



## DiaoWang (Apr 20, 2017)

Chris_H said:


> Hello, DiaoWang !
> In an effort to *under*complicate this. I'm going to suggest the following, as a starting point.
> edit /boot/loader.conf *ensure* that the following line does NOT exist:
> kern.vty=vt
> ...


Wow! Thanks very much!!! I have succeeded! thanks!!


----------



## Chris_H (Apr 20, 2017)

Heh. You're very welcome, DiaoWang . 
If you're satisfied with the results. You can make that change permanent. By adding the following to /etc/rc.conf:

```
vidcontrol VESA_800x600
```
This will _only_ affect the first (p)tty -- the console you first log in on. If you want to change on ALL of the (p)tty's -- tty(1).
Simply replace that line I just gave you with:

```
allscreens_flags="VESA_800x600"
```
If you ever run into difficulties, and need to change/correct any of this. Simply boot into single-user mode:
`reboot -s`, or simply pick that entry from the initial FreeBSD boot menu. You can then mount(8) your slices / drives, and edit /etc/rc.conf. Removing, or changing that entry.

You can gain more insight into some of this by reading vidcontrol(1), syscons(4), and tty(1). 

Hope this helps!

--Chris


----------



## DiaoWang (Apr 21, 2017)

Thank you very much for these helps!!! I will always try to learn FreeBSD!!Thank you for making me feel friendly about the community!Thanks!!


----------



## Joze (May 1, 2017)

Hi. This is sort of related to my issue. I too referred to the handbook but faced problems so went to a thread in here that suggested i typed 'vesa_load="YES"' in /boot/loader.conf then restart. Since the restart, freebsd just keeps rebooting with:
module_register_init: MOD_LOAD (vesa, 0xc1295360, 0) error 19
panic: module_register_init: module named vesa not found

Is there a way I can fix this from the load screen because I cant enter any commands


----------



## Joze (May 1, 2017)

This is unrelated but will I get a notification for a response here or do I have to bookmark this thread for possible responses?


----------



## Deleted member 9563 (May 1, 2017)

Hi Joze You are automatically subscribed to any thread you start. Otherwise, you can check the subscribe option at the top of this thread. Welcome to the forum. 

Edit to add: You should start your own thread about your topic. Don't be shy.


----------



## meine (Nov 25, 2017)

Chris_H said:


> In an effort to *under*complicate this. I'm going to suggest the following, [...]



Hi,

I tried your solution on my Asus Eee PC netbook 1005 HA with FreeBSD 11.1 r321309, but with no result -- hope you or someone else has a solution for this:

* with added 'kern.vty=sc' in /boot/loader.conf,  `vidcontrol -i mode` only shows the headers of the table with mods but nothing to choose.

* with 'kern.vty=vt' it shows a lot of options, but not 1024x600 I want to use.

The latter is strange, because the screen is able to display at max 1024x600 resolution (used it before with Linux on this box)

Trying to force an other resolution proved useless: with 'allscreens_flags="VESA_1024x600" in /etc/rc.conf nothing changes. Forcing a computer without the proper software and settings is useless anyway, I know...

Is there a way to add the 1024x600 to the VESA modes so I can use it?

TIA

(changed the resolution)


----------



## poorandunlucky (Nov 26, 2017)

meine said:


> Hi,
> 
> I tried your solution on my Asus Eee PC netbook 1005 HA with FreeBSD 11.1 r321309, but with no result -- hope you or someone else has a solution for this:
> 
> ...



As far as I know, 1024 x 768 is very uncommon for a laptop...  Laptops usually have 16:10 screens, not 4:3, except some 15" Thinkpads...

Is your screen square exactly like an old TV screen, or is it a bit more rectangular like most modern devices?

1024 x 768 was the standard resolution for old 17" 4:3 CRT screens...


----------



## meine (Nov 26, 2017)

poorandunlucky said:


> As far as I know, 1024 x 768 is very uncommon for a laptop...



Excuse, my mistake. The Asus 1005HA has a 10.1" 1024x600 screen, but it isn't in the list neither


----------



## tobik@ (Nov 26, 2017)

poorandunlucky said:


> As far as I know, 1024 x 768 is very uncommon for a laptop...


It's very common on older notebooks...



meine said:


> Hi,
> 
> I tried your solution on my Asus Eee PC netbook 1005 HA with FreeBSD 11.1 r321309, but with no result -- hope you or someone else has a solution for this:
> 
> ...


I'm wondering if you've loaded the i915kms kernel module (only try this with kern.vty=vt)? It should automatically switch the console resolution to 1024x600 when it's loaded.

`kldload i915kms`


----------



## meine (Nov 26, 2017)

tobik@ said:


> loaded the i915kms kernel module (only try this with kern.vty=vt)



I tried it right away and it worked! TNX

Is there any need to make this `kldload i915kms` persistent? (and where?)


----------



## Phishfry (Nov 26, 2017)

Add to your /etc/rc.conf

```
kld_list="i915kms"
```


----------



## scottro (Nov 26, 2017)

http://lme.postach.io/post/changing-console-resolution-in-freebsd-10-with-vt-4  gives a method to change resolution if using i915kms.


----------



## meine (Nov 26, 2017)

is there any difference setting 'i915kms' in /etc/rc.conf or in /boot/loader.conf?

loader.conf somehow seems to be more at the base, but since I recently started with FreeBSD, I'm not sure...


----------



## tobik@ (Nov 26, 2017)

meine said:


> is there any difference setting 'i915kms' in /etc/rc.conf or in /boot/loader.conf?
> 
> loader.conf somehow seems to be more at the base, but since I recently started with FreeBSD, I'm not sure...


The only difference is the time it's loaded.  When it's in /boot/loader.conf it's loaded even before the kernel boots. If you put it in /etc/rc.conf it's loaded sometime after init(8) starts.

If you put it in /boot/loader.conf then you get a high res console much earlier.


----------



## Manoli (Nov 11, 2019)

Hello guys,

I would like to have high res console as you said early at the boot time.

Putting kld_list=“i915kms” in /etc/rc.conf works just fine, unfortunately I cannot make it work from /boot/loader.conf

Any advice please how to modify /boot/loader.conf properly?

Thanks.


----------



## meine (Nov 15, 2019)

Manoli said:


> Putting kld_list=“i915kms” in /etc/rc.conf works just fine, unfortunately I cannot make it work from /boot/loader.conf
> 
> Any advice please how to modify /boot/loader.conf properly?



With the release of FreeBSD 12.0 the way graphics drivers are handled changed, 
	
	



```
kld_list="/boot/modules/i915kms.ko"
```
 should be in your /etc/rc.conf.

See https://www.freebsd.org/releases/12.0R/relnotes.html, 7.2. Graphics Support

You could set a proper resolution with 
	
	



```
kern.vt.fb.default_mode="<resolution>"
```
 in your /boot/loader.conf, but I don't know the interference with the setting in /etc/rc.conf.


----------



## wally (Nov 9, 2020)

First of all, I should like to acknowledge that this is a very old thread, however the title has led me here as I am sure it will others.
I have recently taken up FreeBSD in favour of other O'S s that I have had experience with.
I have struggled with a variant of the same console issue that others posted here have (mainly) due to the confusion (on my part ) between the two 
1:  kern.vty=vt  and 2:  kern.vty=sc directives which work in entirely different ways.
I know that the first option 1 relates to what is the updated / new directive however I like the other contributors to this post at last find myself 
with a useable console resolution and reliable means with which to change it.
Thank you Chris for providing a small post which enable me to look back at information gleaned and find a way forward.
For anyone deciding to give FreeBSD the go I should like to point out a few pertinent details.

I used the :   kern.vty=sc  directive   (although it is the old deprecated yet well documented)

make sure the i915kms module is loaded, it may not stick I have found that kld_list=i915kms does not work for me, however I will try the
kld_list="/boot/modules/i915kms.ko" (just noticed it)

vidcontrol -i mode revealed a very large number of resolution options for me and the way to set these is to use   vidcontrol MODE_optionnumber 
where optionnumber is exactly that the number that appears under mode in the table of options that are the result of issuing 
vidcontrol -i mode.

I must point out that I tried a number of these options and some of them did not work. I am not sure why they may be due to my specific monitor having issues 
with interpreting them or the fact that I am using a old Maxtor Onboard Graphics card you may have the simlar or different issues. 
If your console disappears (and you get a message from the monitor saying Unsupported Option ) ctrl alt tty to a different console and kill the instance and try another.

As mentioned before I have spent a lot of time on something that I considered should not take too long so if I have missed something, I would not be surprised.
But thanks again for this thread.


----------

