On Friday, December 17th, 2021 at 12:18 AM, Dominik Vogt <dominik.v...@gmx.de> 
wrote:
> On Thu, Dec 16, 2021 at 07:18:23PM +0000, Hegel3DReloaded wrote:

>> xrandr --output Virtual-1 --mode 1400x1050 --primary --output Virtual-2 
>> --mode 1400x1050 --right-of Virtual-1

> And how do I get these virtual screens?

Ok, I will describe my virtual environment in which I work and test.

You need to have any Linux or *BSD system which supports
Libvirt/KVM/qemu virtualization.

I'm using Debian 11, and have whole virtual network of test virtual
machines with various BSD, Linux and Solaris systems to test on.

Additional virtual monitors are possible on virtual guests which have QXL
kernel+Xorg driver, and spice protocol included into virtual machine
definition. So nothing from BSD and OpenIndiana guests with multiple heads:
they can only use legacy vesa driver. FreeBSD may have working QXL driver
already, I don't know for sure. Your virtual guest needs to be recent Linux
distro. Hardware host can be any system which can run Libvirt KVM Qemu.

For a client, virt-manager's built in display is not capable of displaying
mutliple monitors. You will need "remote-viewer" or similar spice protocol
client. This is what I use.

In virt-manager GUI, this are items "Display Spice", "Channel Spice" and
"Video QXL" virtual hardware components. Configure "Display Spice" to have
listen type "address", and choose some TCP port, like 5123/tcp. This is the
point of remote-viewer connection (127.0.0.1:5123).

Before starting virtual machine and connecting to it, there is one crucial
thing virt-manager will NOT do for you: enable multiple monitor heads. You
can do this by editing XML of VM guest before starting it. Edit with virsh(1),
so you don't have to restart libvirtd(8).
You will get "crontab -e" $VISUAL / $EDITOR like interface:

virsh edit my-test-machine-1

Find <video> section near the end of file, and change "heads" parameter from
'1' to '4'. Increasing "vgamem" from 16386 to 32768 is also a good idea.

This is from my testbox10 XML (also Debian 11 inside):

<video>
  <model type='qxl' ram='65536' vram='65536' vgamem='32768' heads='4' 
primary='yes'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
</video>

virsh start my-test-machine-1

remote-viewer spice://localhost:5123

We are still not finished:

When logged in, make sure you have spice-vdagentd daemon installed, up and
running (spice-vdagent package), AND "spice-vdagent" client running as user
from the X session. This will also allow you to move mouse in and out of
guest window without Ctrl+Alt to release mouse.

Now, you can choose from remote-viewer menu View -> Displays and enable
display 2, display 3 ... Four is the maximum. Additional windows will appear
empty, and when you run xrandr from the primary monitor, secondary will become
alive. In that moment, you should make "Restart" of FVWM, because it still
does not refresh and redraw everything in place.

Your virtual RandR monitors will be called Virtual-0 and Virtual-1, or sometimes
Virtual-1 and Virtual-2 ... depending on the virtual bus, slot, domain, 
function,
kernel, moon at 7th house of Jupiter ...


--
Miroslav


Reply via email to