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?

  • refalo@programming.dev
    link
    fedilink
    arrow-up
    10
    ·
    edit-2
    5 months ago

    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
      link
      fedilink
      arrow-up
      5
      ·
      5 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.

  • pixelblut@feddit.de
    link
    fedilink
    arrow-up
    9
    ·
    5 months ago

    As others said virt-manager is probably the easiest. If you want to manage your server via web console akin to something like vcenter you can take a look at proxmox. Or try out cockpit with the libvirtd/qemu plugin on your Linux machine. Cockpit also has a spice/vnc display built in,

  • Voroxpete@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    5 months ago

    So, when you create a virtual machine in KVM, you have the ability to attach a Spice or VNC display to the VM.

    Unlike running VNC inside the virtual machine, what this does it is runs VNC on the host, at a port that you designate (or a randomly assigned port if you don’t designate) and then you can view that by connecting to the host through VNC. For Spice its exactly the same, except you use something like the Remote Viewer application to connect to it.

    As others have mentioned, the easiest way of handling all of this is with Virtual Machine Manager, which integrates its own Spice console and makes everything happen automagically. You can also install Cockpit with the Cockpit-Machines plugin on the host, which gives you a web interface for controlling virtual machines, just like vmware esxi. The display manager on cockpit is pretty rough at the moment though.

    KVM is a very “build it yourself” virtualization solution. I use it extensively, and I love it, but you’ll need to be prepared for a lot of “Oh, KVM doesn’t do that, that’s handled by this program/library/whatever”. It’s definitely not a user friendly toolkit. If you’re looking for a Workstation Player alternative, you may be better off with something like Virtbox (although do try out Virtual Machine Manager first, it’s really slick and for your use case probably solves all the problems I’ve mentioned). If you’re looking for an esxi alternative, maybe look into Proxmox.

  • Johannes Jacobs@lemmy.jhjacobs.nl
    link
    fedilink
    arrow-up
    3
    ·
    5 months ago

    I run KVM on Alpine Linux, then on my debian based workstation i have Virtmanager jnstalled. I can use it to connect to the Alpine KVM and easily add/edit/delete VM’s and manage them.

  • Voroxpete@sh.itjust.works
    link
    fedilink
    arrow-up
    3
    ·
    5 months ago

    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.

    Its honestly tragic that people feel the need to put these disclaimers. “Just google it” was always a shitty response to people asking legitimate questions (some people learn better from conversational interaction rather than just reading an essay), but with the slow death of search engines we’re now experiencing, at this point anyone who yells “Just google it” needs to be ejected into the fucking sun.

    • bus_factor@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      5 months ago

      “Just Google it” was always worthless advice, even when Google worked right. When you look up information on the Internet, you need prior knowledge in order to assess the information. Maybe this is great info? Maybe it’s dumb and whoever wrote it is a moron? Without prior knowledge you don’t know. With prior knowledge you can see what they say about the things you already know and decide from that.

      I once tried to configure a Cisco access point, with zero prior experience with Cisco IOS. Simple stuff, but I knew nothing and had to Google it. I found some blog explaining it, but it looked weird. But I also knew IOS is weird, so maybe it’s right? Hard to say! I reached out to an old friend who is Cisco certified to verify, he told me to ignore that thing and showed me what I should actually do. It really made me realize how useless googling something is if you don’t have the prior knowledge to assess it.

      • Voroxpete@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        5 months ago

        Absolutely. A lot of the time the biggest difficulty with researching something is not even knowing the right terms to search for. Asking a few questions can give you a starting point to know where and how to look.

        And the thing is, I personally hate asking questions on forums and the like. I can probably count on one hand the number of times I’ve done it. I’m very good at digging up answers by myself, and I generally do work better with essays than I do with conversations. But my experience should not be seen as the default, and people shouldn’t be shit on for trying to learn through community rather than through textbooks.

    • Onno (VK6FLAB)OP
      link
      fedilink
      arrow-up
      1
      ·
      5 months ago

      Whilst I agree with your opinion, it continues to astonish me that the majority of non-technical people using a search engine have absolutely no idea just how bad the search landscape has become.

      I suppose my question did probably exclude that part of the population, but old habits die hard.

      I still use + and - to exclude search terms until I remember that Google+ broke that and I forgot just how ad infested the internet is until I accidentally click on a piece of empty space in an article that would have an ad, were it not for the pihole in my network.

      So, yeah. Point taken.

  • mryessir@lemmy.sdf.org
    link
    fedilink
    arrow-up
    2
    ·
    5 months ago

    If you run qemu from CLI you get a window which grabs keyboard and mouse automatically. Ctrl+Alt+G (from the top of my head) releases the input devices so you can again navigate the host. The window is otherwise a default window for you display server.

    I find qemu from CLI way more transparent then these GUI-Applications since each vm is a readable, single script. So I recommend this.

    Regarding installation on iMac bare metal: If the kernel supporta virtualization you can expect to work flawlessly. If you have a dedicated graphics card you can only pass this (as well as dedicated devices like hdd’s) if you main board supports IOMMU.

    If it does all you need is the qemu man page to setup your vm.

    Why I prefer a qemu script to any GUI alternative:

    The entire script for passing RAM, GPU and a HDD is about 10 lines max. A default vm with tcg-emulation e.g. via libvirt etc. can pass 50 lines of xml easily.

    I recommend giving it a try. My workflow is: Place the install script in some directory. The default run script is placed in my ~/.bin/ You can combine these scripts but I find it way simpler to separate them (you would need more elaborate options mounting devices).