This is my first attempt to get multiple monitors to work with a vm. Haven't been successful as of yet.
I am working of a Linux Mint 20.2 host machine, which has Ubuntu 20.04 as the base. Kernel 5.4.0-100-generic.
I am using virt-manager (2.2.1) and have been able successfully create and run PopOS, Mint(20.3) and Arch Linux (2022.02.01) guest machines. I can get none of them to display multiple monitors.
A significant proportion of the issues around this end up pointing me at this youtube demonstration. The basic method described here does not work for me.
The XML of my Display Spice section reads:
<graphics type="spice" autoport="yes">
<listen type="address"/>
<image compression="off"/>
</graphics>
I have set the number of heads in the Video QXL section to 2, 3 or 4.
<video>
<model type="qxl" ram="65536" vram="65536" vgamem="16384" heads="2" primary="yes"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
</video>
Accessing the running machine using either virt-viewer or remote-viewer is successful, but only one display is available. For values of heads >=2, corresponding display entries in the menu are present, but greed out and inaccessible. Within the virtual machine (any flavor) xrandr gives me:
Screen0: minium 320x200, current 1024x768, maximum 8192x8192
Virtual-1 connected primary 1024x768+0+0 0mm x 0mm
1024x768 60.00*+
{...multiple lines}
Virtual-2 disconnected
Virtual-3 disconnected
As best I can tell, this is the recommended way to do it for linux guests, theoretically supporting up to 4 screens. For entertainment, I tried adding extra qxl devices as recommended for windows guests, which indeed opens up extra screens, none of which receive signal from the guest (perpetual "waiting for display 2")
I have upped the memory requirements as described in spice-space to be able to cope with four monitors, with no change in results.
<video>
<model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='2' primary='yes'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
Can't recall how I got there, but this page mentions mapping monitors in the virt-viewer config file. I can map monitors:
[a2459703-ffc5-45a1-849e-b21c67186aa6]
monitor-mapping=1:2;2:3
Then using
virt-viewer --full-screen vm1
it weirdly opens up a single window across my second and third monitors, rather than a display window for each monitor, which is what I expected. I may have missed something or completely misunderstood how that is meant to work.
I thought it may have been because of an old version of virt-manager/virt-viewer. I successfully managed to get virt-manager 3.2.0 running after downloading from the virt-manager repo, to no effect.
The latest available version of virt-viewer in the Mint repos appears to be 7.0,
sudo apt update
sudo apt install virt-manager
results in only version 7.0. Version 11 appears to be available in the virt-viewer repo, but I can't for the life of me figure out how to install that without any identifiable installation instructions - all instructions that I can find refer me to using apt to install it.
The nearest I can get to finding an error message is when running virt-viewer with the debug flag:
virt-viewer:23920): virt-viewer-DEBUG: 14:32:11.467: connecting ...
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:11.467: Opening connection to libvirt with URI <null>
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:11.469: initial connect
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:11.469: notebook show status 0x555ddc8a82b0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.326: virt_viewer_app_set_uuid_string: UUID changed to a2459703-ffc5-45a1-849e-b21c67186aa6
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.326: notebook show status 0x555ddc8a82b0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.327: Guest vm1 is running, determining display
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.328: Set connect info: (null),(null),-1,-1,(null),(null),(null),0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.330: Guest vm1 has a spice display
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.363: Guest graphics address is 127.0.0.1:5900
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.364: Set connect info: localhost,127.0.0.1,5900,-1,(null),(null),(null),-1
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.364: Error operation forbidden: read only access prevents virDomainOpenGraphicsFD
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.364: After open connection callback fd=-1
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.364: Opening direct TCP connection to display at 127.0.0.1:5900:-1
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.370: New spice channel 0x555ddc97a200 SpiceMainChannel 0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.370: notebook show status 0x555ddc8a82b0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.371: reconnect_poll: 0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.482: main channel: opened
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.482: notebook show status 0x555ddc8a82b0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.483: app is not in full screen
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.483: app is not in full screen
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.483: New spice channel 0x555ddc950890 SpiceUsbredirChannel 1
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.483: new usbredir channel
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.483: New spice channel 0x555ddc941090 SpiceUsbredirChannel 0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.483: new usbredir channel
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.483: New spice channel 0x555ddc95aa70 SpiceRecordChannel 0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.483: New spice channel 0x555ddc941b30 SpicePlaybackChannel 0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.483: new audio channel
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.509: New spice channel 0x555ddc933960 SpiceDisplayChannel 0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.509: New spice channel 0x555ddcc0d990 SpiceCursorChannel 0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.512: New spice channel 0x555ddcc0cdc0 SpiceInputsChannel 0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.512: new inputs channel
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.661: creating spice display (#:0)
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.661: Insert display 0 0x555ddc8c6f20
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.709: creating spice display (#:1)
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.709: Insert display 1 0x555ddc8c6d70
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.709: Found a window without a display, reusing for display #0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.710: notebook show display 0x555ddc8a82b0
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.713: Allocated 1024x768
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.713: Child allocate 1024x768
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.736: Allocated 1024x768
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:13.736: Child allocate 1024x768
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:24.945: Allocated 1024x768
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:24.946: Child allocate 1024x768
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:24.964: Allocated 1024x768
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:24.964: Child allocate 1024x768
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:25.055: Allocated 1024x768
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:25.056: Child allocate 1024x768
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:25.587: Allocated 1024x768
(virt-viewer:23920): virt-viewer-DEBUG: 14:32:25.587: Child allocate 1024x768
The "Error operation forbidden: read only access prevents virDomainOpenGraphicsFD" led me to discssuions around attempting to use virt-viewer as a different user with non-root permissions. Just to check, I've then run virt-manager and virt-viewer as the same user who is in the sudo group. Again, no change.
Any directions as to where I should look next or what might be helpful to debug this would be appreciated.