I've setup a machine with Ubuntu 22.04 that should run an old Windows XP (because we need that old and obsolete version of windows, so don't tell me that I have to upgrade to something new, it's not an option).
The Windows XP is setup in a qemu VM that runs automatically at system start and an autologin user is configured to automatically start a remote-viewer in kiosk mode using spice with two QXL video display (two of them, not dual head because it seems not to work with Windows).
In Windows XP the QXL driver is installed.
The problem is that each time I restart the remote-viewer, the two displays are identified in a different way. Sometimes Windows recognized two monitors 1 on the left and 2 on the right, and sometimes it recognizes the 1 on the right and the 2 on the left. Each time I reboot or I restart the remote-viewer the configuration of the screens swap spaces.
I've already added an xrandr in the startup script to fix the Linux display layout before starting the remote-viewer, so I'm sure that on the Linux side the displays are always at the same position (and it's the case if I open a Linux application).
In the configuration file of the remote-viewer I've put monitor-mapping=1:1;2:2 in the section corresponding to the VM but it changes nothing. I've also put the same line in the .config/virt-viewer/settings, but it doesn't solve neither.
The remote-viewer is not the only one that show that issue, if I start virt-viewer instead, I've exactly the same problem, the display layouts is sometimes 1+2 and sometimes 2+1
I've already used that same configuration on an Ubuntu 16.04 and I don't remember to never have had those problems, so it's something related with the 22.04 ?
There is a way to avoid that problem ? It's a kiosk mode system, so the user is not supposed to reconfigure the screens each time we reboot the machine.