10

On Windows computers, there is a simple "hide the modes this screen does not support" button.

How can I get the available video modes supported (accepted) by my actually connected screen via Linux command line?
I.e: I would like to answer to this question: "Would my 1280x1024 video mode be supported by this screen"

I have read about the hwinfo program, but it seems not to be included on Ubuntu anymore.

The other method I tested uses vbetool, but I think it is not the appropriate way:

luis@Terminus:~$ sudo vbetool vbemode get
16673

And I have read too about a method implying the commands execution on GRUB menu (like vbeinfo), but I would like to find some inside-Linux way.

Answers generic for any Linux distro are preferred.
If not possible, Ubuntu or Kali are accepted.

16

Have you tried "xrandr" ?

When run without any option, xrandr shows the names of different outputs available on the system (LVDS, VGA-0, etc.) and resolutions available on each

Demo output :*

$ xrandr -d :0  
Screen 0: minimum 64 x 64, current 1920 x 975, maximum 16384 x 16384  
VGA-0 connected primary 1920x975+0+0 0mm x 0mm  
   1920x975       60.0*+  
   1600x1200      60.0  
   1440x1050      60.0  
   1280x960       60.0  
   1024x768       60.0  
   800x600        60.0  
   640x480        60.0

*Note that you can specify which X display to print info about (-d, --display), as I've done here because I ran the command over SSH (without any X-forwarding).
There does need to be at least one X display for xrandr to be of any use.

For more info, check out "man xrandr".

6
  • 1
    Upvoted. But please don't post screenshots of textual output, paste the actual text...
    – jasonwryan
    Aug 23 '15 at 22:56
  • Well, I like it, but it requires X-Windows. Or so I think when yielding Can't open display. Upvoted anyway, as long as it solves the problem, and works even with multiscreen (two screens in my case). Aug 23 '15 at 23:19
  • 2
    @jasonwryan Sorry, I was running it in a VM so it was easier to take a snapshot than to SSH in, (where the command needs additional options). Updated now !
    – robut
    Aug 23 '15 at 23:43
  • 2
    Mmm... but I think you still need some X display running. If I log out from Xfce and run (via TTY or remote SSH) xrandr -d :0, I get Invalid MIT-MAGIC-COOKIE-1 keyCan't open display :0. It seems some user must be logged to the X Windows system for xrandr to work. Aug 24 '15 at 0:12
  • How do I interpret from that output what the name of the mode actually is (for use with --mode)? When I try to use any of the resolutions as mode names I get a “cannot find mode AxB” error, where AxB is the listed resolution.
    – Kvass
    Aug 25 '19 at 13:35
1

You can try hwinfo

sudo hwinfo --framebuffer

It will list all supported video modes for your terminal.

2
  • When I run that command I get no output. (No errors either, exit status 0)
    – Hubro
    Feb 2 '20 at 15:01
  • Using hwinfo v21.70 it seems you need to provide the option --log. For example: hwinfo --log framebuffer.log --framebuffer. Then you'll be able to view the output in the file "framebuffer.log". Nov 17 '20 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.