Xen and HVM: Resolution Limited to 800x600 on a Debian (Gnome) HVM Guest with X11

Practice



Requirements: a Debian virtual machine installed on a Xen hypervisor (or possibly any other Linux with Gnome) in HVM mode. The virtual machine runs with a GUI (X-Window) that starts up right away (the simplest analogy is an "out of the box" Ubuntu that brings up the graphical environment immediately on startup).

Problem: the screen resolution can't be set higher than 800x600 (or even 640x480).

To repeat - the machine is running as an HVM domainU, i.e. it is NOT paravirtualized. And no matter what you try, you can't get a higher resolution or color depth - only 800x600 or 640x480.

So, the conditions are:
  • Xen
  • HVM guest
  • Gnome (may also work for KDE)
  • Resolution can't be set higher than 800x600


Solution.

1) Check the configuration file for this virtual machine. Pay attention to the following options (add them if they're missing):

videoram = 16
stdvga = 0

The first option sets the video memory size to 16MB, and the second one enables emulation of a Cirrus Logic video adapter instead of the standard one.


2) Now start the virtual machine and you'll see an 800x600 desktop. Connect to the console (for example, via SSH or via Ctrl+Alt+F1) and stop the X server.

$ sudo /etc/init.d/gdm3 stop


3) Run the following command:

$ sudo X -configure

in response you'll be told that the file /root/xorg.conf.new has been created.


4) Open this file for editing (/root/xorg.conf.new).

4A) Find the "Monitor" section and bring it to roughly the following form:

Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
HorizSync 31.5 - 64.3
VertRefresh 40.0 - 150.0
EndSection

4B) Find the "Screen" section and bring it to the following form:

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection

As we can see, here we're setting the modes (resolutions and color depth) for the display. If needed, feel free to experiment with these values.


5) Save the file and copy it to /etc/X11 under the name xorg.conf:

$ sudo cp /root/xorg.conf.new /etc/X11/xorg.conf


6) Start the X server back up and enjoy being able to choose a different resolution:

$ sudo /etc/init.d/gdm3 start

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "LINUX operating system"

Terms: LINUX operating system