WRITELOOP

CHANGING SCREEN RESOLUTION MANUALLY THROUGH XRANDR AND ON KVM VIRT-MANAGER

2020 July 8

Sometimes your monitor does not detect correctly the available resolutions available. But you can manually set that following the steps below.

  1. Get your device alias: $ xrandr -q | grep ' connected' The alias will be the identifier on the first column.
  2. Inspect the mode configuration necessary to that:
$ cvt 1920 1080 60  # 1920x1080 at 60 hz
e.g. output:
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync

The last line (Modeline) contains the parameters you will use to set the resolution on the next step. 3) Set the resolution:

$ xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
$ xrandr --addmode Virtual-1 1920x1080_60.00
$ xrandr --output Virtual-1 --mode 1920x1080_60.00
  1. To make this resolution persistent:
$ vim /usr/share/X11/xorg.conf.d/10-resolution.conf
Section "Monitor"
Identifier "Virtual-1"
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
Option "PreferredMode" "1920x1080_60.00"
EndSection

IMPORTANT: If you are using kvm and virt-manager, make sure to go to “Show details of Virtual Machine”, there remove your current “Video” configuration, click “Add Hardware”, and then select “Video” and “Model: QXL”. That way you will be able to achieve higher resolutions on your VM, maybe even FullHD without needing to use the procedure described in this video.