[Suggestion] Let VirtIO-GPU support max_outputs.

kikoko

New Member
Apr 2, 2025
22
2
1
Tldr need virtiogpu multi monitor support and a new option for displays called unset.


1) According to the qemu display driver source code, virtio gpu supports max_outputs as well as qxl.
Extends https://lists.proxmox.com/pipermail/pve-devel/2019-November/040462.html
1743816351479.png

This would've required simply adding extra options (or maybe a field, but seems like that goes against proxmox policy of simplifying things) such as VirtIO-GPU Dual monitor, 3 and 4 monitors. The source code of drivers (neither qxl nor virtio-gpu) does not really restrict us on the number of display we can attach.

1743816781921.png
1743816909734.png
1743816933348.png


2) Right now we've gotten an option vga: none, but what it does is setting nographic and some other properties, can we have one more, called unset? Which won't expose id=vga at all and no extra flags so we could've overrode it with default options such as:
1743817053278.png
Code:
-device 'virtio-vga,id=vga,max_hostmem=268435456,bus=pci.0,addr=0x2,max_outputs=4'
using the same id = vga, instead of going nuts and having to work with different ids such as:
Code:
-device 'virtio-vga,id=vga2,max_hostmem=268435456,bus=pci.0,addr=0x9,max_outputs=4'
?

P.s I tried doing the trick I've achieved with dummy driver on virtio-vga driver (modesetting) on xorg, but for some reason unlike xorg's dummy driver it didn't let me enabled/connect the second display even thought its recognized by xrandr.

Then I tried
```

-device 'virtio-vga,id=vga,max_hostmem=268435456,bus=pci.0,addr=0x2,max_outputs=4'
-device 'virtio-vga,id=vga2,max_hostmem=268435456,bus=pci.0,addr=0x9,max_outputs=4'
```
and X -configure to see what it generates, seems like it does recognize the second device, but it makes the list Such as Virtual-1,2,3,4,5,6,7,8 (everything besides 1 is disabled obviously lol).


Proxmox really needs a new access flag called edit configuration so we could've let the users edit the conf, files, so they could've run what they needed. We already have show configuration in backups, nothing stops from making a similar window for PVE admin/other new group's members.
1743818196486.png
 
Last edited:
  • Like
Reactions: rhv70
1743816781921.png

Also max outputs on 1692 most likely should be just qxlnum, it doesn't matter whether you pick dual monitor or 3, you always get 4 spawned on linux.
 
  • Like
Reactions: rhv70
Tldr need virtiogpu multi monitor support and a new option for displays called unset.


1) According to the qemu display driver source code, virtio gpu supports max_outputs as well as qxl.
Extends https://lists.proxmox.com/pipermail/pve-devel/2019-November/040462.html
View attachment 84515

This would've required simply adding extra options (or maybe a field, but seems like that goes against proxmox policy of simplifying things) such as VirtIO-GPU Dual monitor, 3 and 4 monitors. The source code of drivers (neither qxl nor virtio-gpu) does not really restrict us on the number of display we can attach.

View attachment 84516
View attachment 84517
View attachment 84518


2) Right now we've gotten an option vga: none, but what it does is setting nographic and some other properties, can we have one more, called unset? Which won't expose id=vga at all and no extra flags so we could've overrode it with default options such as:
View attachment 84519
Code:
-device 'virtio-vga,id=vga,max_hostmem=268435456,bus=pci.0,addr=0x2,max_outputs=4'
using the same id = vga, instead of going nuts and having to work with different ids such as:
Code:
-device 'virtio-vga,id=vga2,max_hostmem=268435456,bus=pci.0,addr=0x9,max_outputs=4'
?

P.s I tried doing the trick I've achieved with dummy driver on virtio-vga driver (modesetting) on xorg, but for some reason unlike xorg's dummy driver it didn't let me enabled/connect the second display even thought its recognized by xrandr.

Then I tried
```

-device 'virtio-vga,id=vga,max_hostmem=268435456,bus=pci.0,addr=0x2,max_outputs=4'
-device 'virtio-vga,id=vga2,max_hostmem=268435456,bus=pci.0,addr=0x9,max_outputs=4'
```
and X -configure to see what it generates, seems like it does recognize the second device, but it makes the list Such as Virtual-1,2,3,4,5,6,7,8 (everything besides 1 is disabled obviously lol).


Proxmox really needs a new access flag called edit configuration so we could've let the users edit the conf, files, so they could've run what they needed. We already have show configuration in backups, nothing stops from making a similar window for PVE admin/other new group's members.
View attachment 84521

I want this desperately.
 
Is my understanding correct here. The only way currently to get max_outputs for the virtio-gpu driver to be set is to modify that QemuServer.pm script? The output of that is the kvm command in its long form?
 
Is my understanding correct here. The only way currently to get max_outputs for the virtio-gpu driver to be set is to modify that QemuServer.pm script? The output of that is the kvm command in its long form?
So I modified the QemuServer.pm on my PVE and then restarted my Linux VM that uses the Virtio-gpu driver. I verified that the kvm command changed by looking at the output of

Code:
qm showcmd 200

and it added a max_output=4 parameter. I guess I expected to see the usual Virtual-1 monitor and 3 disconnected ones like I would with SPICE: i.e. Virtual-2, Virtual-3, and Virtual-4. But they weren't there.

EDIT: Got them to appear with commands like:

Code:
xrandr --setmonitor Virtual-2 auto none
xrandr --setmonitor Virtual-3 auto none
...

but I also figured out how to use setmonitor to extend the original single Virtual-1 monitor so that it appears like 2 monitors.
 
Last edited:
What’s the use case? Why do you need 4 framebuffers in VM? Make the 1 framebuffer render 4 desktops, or 32…

You’re also confusing a few things, you’re looking at code for QXL and changing options on Virtio-GPU and talking about SPICE. Different beasts, stop relying on LLM to get this, you’re the nth person this week with similar questions and reasoning, multi-monitor Remote Desktop is not a Proxmox issue. It’s hallucinating because you’re not asking the right questions.

Here’s a rule of thumb, LLM cannot answer a question you don’t already know the answer to. Understand how RDP or VNC works, then work from there as to the problem you are attempting to solve.
 
Last edited:
What’s the use case? Why do you need 4 framebuffers in VM? Make the 1 framebuffer render 4 desktops, or 32…

You’re also confusing a few things, you’re looking at code for QXL and changing options on Virtio-GPU and talking about SPICE. Different beasts, stop relying on LLM to get this, you’re the nth person this week with similar questions and reasoning, multi-monitor Remote Desktop is not a Proxmox issue. It’s hallucinating because you’re not asking the right questions.

Here’s a rule of thumb, LLM cannot answer a question you don’t already know the answer to. Understand how RDP or VNC works, then work from there as to the problem you are attempting to solve.

I think the original question is perfectly valid. I don't know why you went into a rant about LLMs here. This thread has been about source code in Proxmox and how to pass Virtio a similar parameter that is also passed to SPICE. You haven't made a case for why that would be a bad idea. If it's a bad idea for Virtio, why is it *not* a bad idea with SPICE?

For what it's worth, I've been through at least half a dozen videos and blogs dealing with xrandr and adding virtual monitors and literally all of them start with the assumption that there's at least one physical port (HDMI | DP | DVI). Those tutorials seem to fall short when there is only a virtual monitor. I was happy to see the question asked here as I've been struggling to do what you mentioned (extend a single framebuffer vs use multiple framebuffers).

Ultimately we're trying to get multiple remote displays. Whether the solution is multiple framebuffers or one is less important, though I'm sure one is more elegant than the other. And at least for me, Virtio-GPU seems to have much better performance than SPICE. SPICE setup with Proxmox is also problematic, but that's another topic.

EDIT: WhenI say multiple remote displays, I mean unique ones. I have 3 monitors on my main machine and I want to be able to use all of them when I connect to the Linux develoment VM, with each display "extending" the screen space, not mirroring. Since I first started replying I've already got 80% of a solution in place.
 
Last edited:
Again, you’re confusing the concepts. Virtio-GPU and SPICE are not even the same thing. One is a virtual hardware emulation the other a remote desktop protocol.

You do not need a physical output or virtual GPU for multiple desktops. You just need your remote desktop software to request n displays, there is not even any config necessary provided your protocol can do it. On Linux just install XRDP and click the setting on the client to use all your monitors. For VNC you have to understand there is no native multi monitor support so proprietary extensions request a 3-wide monitor and then split it in software or like RDP use X11 tricks to render n desktops and merge into the same RFB. QXL/SPICE presents up to 4 virtual monitors when your software requests it, any modern Linux environment will show it once it is presented.

For none of the above do you need more than 1 virtual GPU, if any.
 
Last edited:
  • Like
Reactions: rhv70
Again, you’re confusing the concepts. Virtio-GPU and SPICE are not even the same thing.
In defense of both of the askers in this thread, in the context of how Proxmox presents display choices, Virtio and SPICE are presented as parallel choices. If that's the starting point, it would be hard not to put them in the same bucket.

My preferred remote desktop method is Rustdesk, which I self-host. It feels super fast with Virtio-GPU, and it should work when I have to get through a corporate firewall. It's also far easier to set up than xrdp or vnc, even considering the work I put in to run the Rustdesk server in a docker container. I think this is especially true when I'm slightly off the beaten path by using LXQt. The downside is Rustdesk doesn't support multiple monitors as well as Anydesk, and I'm looking at a way to open a separate connection to get another monitor or two to display in distinct windows. This is mostly for fun and to learn.
 
Last edited: