Once again I found myself trying to “fix” something that has been bothering me for some time – the Resolution in KVM guests is sometimes poor, as low as 800×600.
As it turns out, one can increase the resolution of the guests much higher by using a custom xorg.conf and the std vga driver.
Save the following in /etc/X11/xorg.conf in the Guest OS.
Direct download – bodhi.zazen’s kvm xorg.conf
As root run:
wget http://bodhizazen.net/tweaks/kvm.xorg.conf -O /etc/X11/xorg.conf
xorg.conf
Section "ServerLayout"
Identifier "BodhiZazen’s KVM xorg.conf"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Module"
Load "record"
Load "dri"
Load "extmod"
Load "glx"
Load "dbe"
Load "dri2"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "vmmouse"
Option "Protocol" "SysMouse"
Option "Device" "/dev/sysmouse"
Option "ZAxisMapping" "4 5 6 7"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
HorizSync 20.0 – 50.0
VertRefresh 40.0 – 80.0
Option "DPMS"
EndSection
Section "Device"
Identifier "Card0"
Driver "vesa"
VendorName "Cirrus Logic"
BoardName "GD 5446"
BusID "PCI:0:2:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Modes "1600×1200"
EndSubSection
EndSection
Note: The vmware mouse driver is installed on most distros by default. If you need to install it use:
# Fedora
yum install xorg-x11-drv-vmmouse
#Debian / Ubuntu
apt-get install xorg-input-vmmouse
If you need a higher/lower resolution, change “1600×1200″ to your desired resolution.
Finally, when we restart KVM use the “std” video driver. The default video driver is cirrus.
kvm -m 512 -vga std -disk file=/path/to/linux.qcow,cache=writeback,media=disk
You may specify vga from Virtmanager or in your guest xml file (if you are using libvirt).
<model type='vga' vram='9216' heads='1'/>
Pingback: Shadows of epiphany » Blog Archive » How to improve resolution in KVM | Linux Affinity
Excellent article, this was exactly my problem I googled a few days ago. Thanks!
The requested URL /adblock/kvm.xorg.conf was not found on this server.
@ Gary Friedman
I moved it here : http://bodhizazen.net/tweaks/kvm.xorg.conf
/me goes to update blog …
does this work with bodhi Linux too? I’m just a bit confused because you said it was for KVM.
Apologies if I come across as being a noob
@Halodude :
I am not sure where the confusion comes from so a little background so we are all on the same page.
KVM is a virtualization technology
http://www.linux-kvm.org/page/Main_Page
This how to is written for Linux Guests.
So yes this how-to would work if you are running bodhi linux as a guest using KVM (as opposed to vmware or virtualbox), but not if you are running bodhi linux outside of KVM.
Don’t you find the standard VGA driver to be incredibly slow? Or is it just newer Ubuntu/Debian where it’s excrutiatingly slow?
Yes it is slow and this is an old post.
The current solution is to use spice.
When I say slow, I mean so slow you see every new window you move/create actually being written line by line. It’s basically not usable. Spice… that’s Fedora right? My problem here is that I really want std VGA to work, because it seems to be the only thing to support the TeamViewer software. Surely other people have the same problem, where they for some reason want the std VGA driver to work fluently in 2D environments?
@Kattfisken – Yes, it can be very slow. Try spice, problem is last I looked spice was not fully imported to Debian / Ubuntu as of yet, but there is a ppa you can try. spice is very fast.
Good site, thanks for the help. The xorg config did not work, but the tutorials were of great use in getting xen/libvirt up and running,
I want to configure a 16:9 screen resolution. I execute:
$ gtf 1920 1080 60 -x
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
$ sudo xrandr --newmode "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
$ sudo xrandr --addmode default 1920x1080_60.00
$ xrandr
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 640 x 480, current 1680 x 1050, maximum 1920 x 1200
default connected 1680x1050+0+0 0mm x 0mm
1920x1200 0.0
1600x1200 0.0
1680x1050 0.0*
1400x1050 0.0
1280x1024 0.0
1440x900 0.0
1280x960 0.0
1280x800 0.0
1024x768 0.0
800x600 0.0
640x480 0.0
1920x1080_60.00 60.0
But i have this error.
Sorry… this error
well… I have a problem with links.
Error
@Fede Agostini I see the link, but what is the problem ? the gma500_gfx driver does not allow changing resolution. Or it your resolution off ?
Pingback: CentOS 6 使用紀錄 « 喝茶也喝咖啡