this post was submitted on 23 Jun 2024
31 points (94.3% liked)

Linux

5218 readers
10 users here now

A community for everything relating to the linux operating system

Also check out !linux_memes@programming.dev

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 1 year ago
MODERATORS
 

I've been using VMware for about two decades. I'm moving elsewhere. KVM appears to be the solution for me.

I cannot discover how a guest display is supposed to work.

On VMware workstation/Fusion the application provides the display interface and puts it into a window on the host. This can be resized to full screen. It's how I've been running my Debian desktop and probably hundreds of other virtual machines (mostly Linux) inside a guest on my MacOS iMac.

If I install Linux or BSD onto the bare metal iMac, how do KVM guests show their screen?

I really don't want to run VNC or RDP inside the guest.

I've been looking for documentation on this but Google search is now so bad that technical documents are completely hidden behind marketing blurbs or LLM generated rubbish.

Anyone?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] refalo@programming.dev 10 points 4 months ago* (last edited 4 months ago) (1 children)

Usually KVM is used alongside higher level programs like QEMU and/or libvirt/virt-manager, which handle the display side of things. It can be done in many different (configurable) ways, including built-in SPICE/VNC/RDP servers (guest support not needed), or it can just render directly into the application window itself (not as a background service) via SDL/OpenGL/etc., but that means closing the program destroys the VM.

I think the most popular/common option is qemu/kvm via libvirt, using virt-manager to manage the VMs and handle the display, which by default uses SPICE behind the scenes and runs the VM as a background service which virt-manager (or any SPICE client) can connect/disconnect from at will.

The libvirt method is more akin to VMware ESX server, where the VMs are always running in the background, and you attach to them to see the display whenever you want, whereas VMware Workstation/Player/etc. is more like running qemu directly with the SDL/GL display option which does all the emulation and display directly inside the running application window and the two are tightly coupled.

[โ€“] thingsiplay@beehaw.org 5 points 4 months ago

Right: https://virt-manager.org/

One can close the window that shows the virtual machine, and it would still run in the background. Qemu+Kvm is not the only way to use Virtual Machines with virt-manager, one can also use LXC or Xen as its Hypervisor. I'm relatively new to the concept of Kvm and it was a little bit confusing first.

First a connection to a Hypervisor needs to be established (here Qemu+Kvm). I think that means a server is running in the background, correct me if I'm wrong. Then one can install or run a virtual machine with the connection. Here is a screenshot on my current setup (I tried to create an AppImage, long story) and added a few useless red arrows. The QEMU/KVM connection is automatically connected at start (configurable). Once a virtual machine is running, you have to click "Open" to show the window of the VM.