LG for 2 VM at the same time

Hi
I need to have 2 VMs (Win 11 guest and Fedora 42 host). I’m working on it since weeks with no luck. I’m not a specialist in this matter or Linux generally speaking. My question is: if possibile, of course, 2 instances of kvmfr module (kvmfr0 and kvmfr1, i.e.) or 2 of LG? If necessary I can move LG withouth kvmfr.
Tnx in advance.

LG supports multiple guest VMs, but at this time we do not support a guest that runs Linux.

For multiple windows guests, the kvmfr static paramter accepts a comma seperated list of sizes, not just a single value, for example, 64M,64M will create /dev/kvmfr0 and /dev/kvmfr1, each 64MB in size.

However if you’re attempting to use VM → VM where the Linux VM is the LG client, and the other VM is the LG Host, you can do this. Simply add a IVSHMEM device to both VMs that use the same /dev/shm file, there is nothing you need to do on the host (do not load kvmfr on the host). In the Linux guest to be the LG client, just modprobe the kvmfrmodule, there is no need for a static device as it has a real IVSHMEM device provided by QEMU.

Tnx for helping.
I’m on Fedora 42 (host) and willing to manage 2 VMs with Win11 as client
I then set up 2 instances of kvmfr (1 module, then, with kvmfr0 and kvmfr11):

simon@Fedora-PC:~$ ls -l /dev/kvmfr*crw-rw----. 1 simon kvm 239, 0 5 dic 13.12 /dev/kvmfr0
crw-rw----. 1 simon kvm 239, 1 5 dic 13.12 /dev/kvmfr1

This is the QEMU code into the VM1:
<qemu:arg value=“-device”/>
<qemu:arg value=“{‘driver’:‘ivshmem-plain’,‘id’:‘shmem0’,‘memdev’:‘looking-glass’}”/>
<qemu:arg value=“-object”/>
<qemu:arg value=“{‘qom-type’:‘memory-backend-file’,‘id’:‘looking-glass’,‘mem-path’:‘/dev/kvmfr0’,‘size’:268435456 ,‘share’:true}”/>
</qemu:commandline>

And this is the QEMU code into the VM2:
<qemu:arg value=“-device”/>
<qemu:arg value=“{‘driver’:‘ivshmem-plain’,‘id’:‘shmem0’,‘memdev’:‘looking-glass’}”/>
<qemu:arg value=“-object”/>
<qemu:arg value=“{‘qom-type’:‘memory-backend-file’,‘id’:‘looking-glass’,‘mem-path’:‘/dev/kvmfr0’,‘size’:268435456 ,‘share’:true}”/>

Each VM works with kvmfr0 (regardless into the second kvmfr1 is set) but the second (or neither) work with kvmfr1. The errot (or issue) is: LG window with his logo and terminal message saying “The host application seems to not be running
| Waiting for the host application to start…”. But it works with kvmfr0.

Is the correct way to have 2 instances of kvmfr or is the right way to have 2 different modules? Or is it totally wrong?
Tnx

For VM to VM the host doesn’t use the KVMFR module, use standard shared memory:

<shmem name='looking-glass'>
  <model type='ivshmem-plain'/>
  <size unit='M'>256</size>
</shmem>

Note though that 256M seems wildly excessive. Adding more ram doesn’t improve performance, it just locks it away so nothing else can use it.

1 Like

Tnx, is not VM to VM, if I’m not misunderstanding.

It’s host to VM1 and host to VM2. 2 different VMs running at the same time into the ssme host.

Ah ok.

Did you tell the LG client to connect to /dev/kvmfr1 when you started it?

./looking-glass-client -f /dev/kvmfr1

Note too that this is set to /dev/kvmfr0 which VM1 is using. This should be /dev/kvmfr1

Yes, I have 2 different launchers: one with kvmfr0 and one with kvmfr1.

Is maybe there a setting to be placed in LG host in Windows?

No, the guest is completely unaware which VM it is. Nothing to change there.

If you post your logs both host and client, for both VMs, and full VM configurations (not snippets) I might be able to help