Put 2 screen in KVM virtual machine

Latest response


I RHEL6 with KVM. We have a virtual machine. Is it possible to put 2 screens for the virtual machine?
thank you very much


Hi Valentín,

Yes, it's possible, but the method depends on what guest system you want to be running with two displays. For Windows, there's a solution on the Customer Portal: How to set up a multihead Windows guest using virt-manager on RHEL 6.3.

For Linux, it's a little easier. Just make sure that your VM is configured to use Spice Display and the QXL driver. This can be done in the virt-manager GUI or manually (see the Spice User Manual: Multiple monitor support). Then you can add additional displays using the View -> Displays submenu in the remote-viewer window.

Hi Robert:
First of all I would like to thank you for your cooperation.
I tell you what are our needs. We have an application that requires two screens and it has to work in pseudocolor mode virtually.
I RH6 with KVM. I just install a machine RHE6 Monitor Spice and glx video.

Can not see the second monitor. What escapes me ?. Can work in pseudocolor?

Thank you very much

Hi Valentín,

About the second display: connect to the (running) virtual machine using the remote-viewer tool like this (assuming you're using the default port number for Spice):

remote-viewer spice://localhost:5900

Then go to the View -> Displays submenu and tick an additional display.

About pseudocolor: I have never used this, but theoretically, you should be able to instruct Xorg to run in pseudocolor mode by setting the default color depth to 8 bits. According to the Xorg man page, the pseudocolor mode is the default mode for that color depth, so it should render in that mode. The 'Screen' section of your xorg.conf file would then need to include this:

Section "Screen"
        DefaultDepth    8

However, as I said, I have not tested this, and I don't know whether QEMU is going to be happy about that.

This is typical not very helpful documentation. Too narrow a discussion. Does not give any info for view-viewer or context: presumes audience knows something about Spice, presumes audience knows something about virt-viewer, presumes audience knows something about how NOT to connect to guest if using virt-viewer. Even if you can't get this info into 1 page a refrence list to 1 page articles on each of the subjects is necessary. This started only making sense to me after I found this: https://www.youtube.com/watch?v=UySlAfz7e7Q and also the spice website. The help that this article did provide for me is: 1. knowledge that 2 monitors can be configured, 2. spice, not vnc is the right path. Otherwise, not much help. This article and 2 hours of research fixes the problem.

Hi Joseph,

This is a discussion in a user forum, and as such it tries to solve a specific problem. If some parts of the offered solution remain unclear to you, feel free to ask additional questions. If you faced a similar problem and was able to find a solution yourself, please, share it with the community.

Does this work when using virt-manager and not RHEL Virtualization? I can say, i've had no luck. Clicking the second display in remote-viewer opens a blank dialog.