LinuxCommandLibrary

fbset

Set framebuffer console resolution

TLDR

Show current framebuffer settings

$ sudo fbset [[-i|--info]]
copy

Set a framebuffer mode defined in /etc/fb.modes
$ sudo fbset "[800]x[600]-[60]"
copy

Set an arbitrary framebuffer mode
$ sudo fbset [[-g|--geometry]] [TTY_horizontal] [TTY_vertical] [monitor_horizontal] [monitor_vertical] [color_depth]
copy

SYNOPSIS

fbset [OPTIONS] [MODE_NAME | GEOMETRY_AND_TIMING_PARAMETERS]
Example: fbset -xres 1024 -yres 768 -depth 16

PARAMETERS

-s, --show
    Display the current video mode settings of the framebuffer device.

-i, --info
    Show information about supported video modes from the kernel's mode database or a specified mode file.

-a, --all
    Apply the specified settings to all detected framebuffer devices.

-xres <X>
    Set the horizontal resolution (width) in pixels.

-yres <Y>
    Set the vertical resolution (height) in pixels.

-depth <D>
    Set the color depth (bits per pixel), typically 8, 16, 24, or 32.

-pixclock <P>
    Set the pixel clock in picoseconds (ps). Defines how fast pixels are drawn.

-left <L>, -right <R>, -upper <U>, -lower <L>
    Define the horizontal and vertical blanking intervals for timings.

-hsync <P>
    Set horizontal sync polarity (+ or -).

-vsync <P>
    Set vertical sync polarity (+ or -).

-vmode <M>
    Set the video mode (e.g., interlace for interlaced scan, double for double scan).

-g <XRES> <YRES> <VXRES> <VYRES> <DEPTH>
    Shorthand to set resolution, virtual resolution, and color depth.

-t <PIXCLOCK> <LEFT> <RIGHT> <UPPER> <LOWER> <HSYNC> <VSYNC>
    Shorthand to set all timing parameters.

-f <file>, --file <file>
    Read mode settings from a specified file, typically /etc/fb.modes.

-fb <device>, --fb <device>
    Specify the framebuffer device to operate on, e.g., /dev/fb1. Defaults to /dev/fb0.

DESCRIPTION

fbset is a command-line utility used to query and modify the settings of the Linux framebuffer device. The framebuffer provides a standard interface to access the graphics hardware, allowing for console graphics without relying on a full X Window System. It enables users to change display parameters such as resolution (X and Y), color depth, pixel clock, sync polarities, and video modes (e.g., interlaced, double scan). This command is particularly useful in environments where a graphical desktop isn't running, such as server consoles, embedded systems, or during the early boot process. Incorrect settings can lead to display issues or a blank screen, so caution is advised. It typically requires root privileges to operate.

CAVEATS

Applying incorrect parameters with fbset can lead to an unreadable or blank screen, requiring a system reboot or specific knowledge to restore.
Changes made by fbset are typically not persistent across reboots unless integrated into system startup scripts or configuration files.
It requires root privileges to modify framebuffer settings.
For graphical environments like X11 or Wayland, xrandr or display server-specific tools are generally preferred and safer.

THE LINUX FRAMEBUFFER DEVICE

The Linux framebuffer (fbdev) is a graphics hardware-independent abstraction layer to show graphics on a computer monitor. It provides a direct memory region (the framebuffer) that holds the pixel data currently displayed on the screen. fbset interacts directly with this device to change its operational parameters.

USING FB.MODES

The /etc/fb.modes file contains predefined video mode descriptions that can be loaded by fbset using the -f option or by simply passing the mode name (e.g., fbset 1024x768-60). This file allows system administrators to easily configure standard display resolutions and timings without needing to specify all parameters individually on the command line.

HISTORY

fbset is part of the fbtools package, which emerged with the development of the Linux framebuffer device itself. The Linux framebuffer was introduced to provide a generic graphics output layer that was hardware-independent, allowing for console graphics and earlier boot graphics without relying on proprietary or complex graphics drivers. While its usage has diminished on modern desktops with the advent of advanced display servers, fbset remains a critical tool for embedded systems, servers without graphical interfaces, and low-level display configuration.

SEE ALSO

fb.modes(5), modprobe(8), xrandr(1), setfont(8)

Copied to clipboard