XOrg configuration files for VIRGL

From LinuxReviews
Jump to navigationJump to search

If you are using QEMU with GNU/Linux virtual machines and you'd like X in the virtual machine(s) to start in a specific resolution you'll want to make a file named screen-resolution.conf or similar in /etc/X11/xorg.conf.d/ - and you'll have to make that folder if you are using Debian or Ubuntu since it does not exist in default installations on those distributions for some reason.

Put this in your /etc/X11/xorg.conf.d/screen-resolution.conf

Section "Device"
        Identifier "Configured Video Device"
EndSection

Section "Monitor"
        Identifier "Configured Monitor"
EndSection

Section "Screen"
        Identifier "Default Screen"
        Monitor "Configured Monitor"
        Device "Configured Video Device"
        DefaultDepth 24
        SubSection "Display"
                Depth 24
                # Choose the mode you like
                # Modes "1920x1080"
                Modes "2560x1600"
        EndSubSection
EndSection

Starting qemu-kvm with -vga virtio -display gtk,gl=on is of course a requirement to use VIRGL - but not a requirement to use the above configuration file. It can be used as a general-purpose configuration file to set X's resolution on any graphics driver since it isn't driver-specific.