OpenBSD-current now runs as guest under Apple Hypervisor

(undeadly.org)

274 points | by gpi 8 hours ago

10 comments

  • Fiveplus 5 hours ago
    A good update. The VIRTIO_NET_F_MTU negotiation has been a roadblock for many guest OS implementations on apple's virtualization stack. The spec is vague enough that linux just does it while openbsd had to explicitly patch in support to handle the hypervisor's hardmtu limit.

    This is a big deal for local development imho. With the raw single-thread performance of the M4/M5 chips, an openbsd guest is arguably the best environment for testing pf configurations or running isolated mail servers (for example). Being able to rely on viogpu without the black-screen-of-death means we can slowly move away from serial console-only installs for quick VMs.

    Big kudos to Helg and Stefan!

  • patjensen 6 hours ago
    The bigger news is that this also fixes the QEMU compatibility bug that makes OpenBSD hang out of the box on arm64 when starting X.

    It started in 7.3 with the frame buffer changes and the only workaround was to disable the kernel driver.

    Maybe more people will get to try out OpenBSD successfully now.

    • danwills 1 hour ago
      I wouldn't normally say something not-about-the-content of your comment, however a question-mark at the end seems like it would increase the spirit of curiosity a bit?

      I did interpret it as a question anyway, and would like to know more about OpenBSD. I am using Gentoo, and it used to be possible to use an openBSD kernel apparently:

      https://wiki.gentoo.org/wiki/Gentoo_OpenBSD

      But not any more by the sounds of it. All good, just keen to learn more about the differences ;D

      • fleshmonad 35 minutes ago
        Maybe not posting such comments would increase the value of this site.
  • my123 7 hours ago
    Note that this is about Virtualization.framework (Apple's first party VMM). OpenBSD worked on Hypervisor.framework + qemu since a very long time.
    • tannhaeuser 2 hours ago
      Out of my depth here. Is that the one Tahoe was introducing? What did it solve that was impossible before?
      • m132 57 minutes ago
        Virtualization.framework was introduced in Big Sur. It builds on top of Hypervisor.framework and is essentially Apple's QEMU (in some ways quite literally, it implements QEMU's pvpanic protocol for example). Before QEMU and other VMMs gained ARM64 Hypervisor.framework support, it was the only way to run virtual machines on ARM Macs and still is the only official way to virtualize ARM macOS.

        The new Tahoe framework you're probably thinking of is Containerization, a wrapper around Virtualization.framework allowing for easy installation of Linux containers.

    • cpach 4 hours ago
      Good point. The naming of those frameworks is sooo confusing. IMHO, nearly impossible to not mix them up.
  • MillionOClock 4 hours ago
    Maybe I am missing something but the last few times I tested VMs it seemed to end up never shrinking in RAM size once it had grown, is this a real issue and if so is there any improvement coming on that front?
  • SomaticPirate 7 hours ago
    Is there a guide on how to do this? I haven’t ever used the raw hypervisor.
    • signa11 6 hours ago
      a quick kagi search revealed this: https://briancallahan.net/blog/20250222.html, perhaps it might work for you too ?
    • eschaton 7 hours ago
      It should just be a matter of producing a kernel and, if necessary, RAM disk that can be booted the same way as Linux.
      • jonhohle 4 hours ago
        “just” is doing a lot of work in that sentence.
        • eschaton 4 hours ago
          Yes and no; kernels aren’t magic, and “change how this kernel is loaded to match how Linux does it” is actually a reasonable first assignment for an Operating Systems class at a top-tier school. (You’re basically just creating an alternative `main()` if you don’t need a RAM disk image from which to load drivers.)
          • fooker 1 hour ago
            It's a first assignment if you are talking about a computer from 1990.
            • eschaton 1 hour ago
              What, pray tell, would you do for a first assignment in an Operating Systems class at a top-tier school that actually involves making changes to on realistic operating system code?
              • fooker 50 minutes ago
                I had to implement system calls in xv6.

                You can look up which top tier schools use it for OS classes.

                • glhaynes 17 minutes ago
                  At the risk of getting further off-topic: what sort of system calls did they have you implement? I’ve never done but a tiny bit of kernel hacking and that sounds like a good exercise, but I’m not sure what would be a good first syscall to add.
                • eschaton 32 minutes ago
                  Oh, is that what MIT’s using these days?
      • cpach 4 hours ago
        Then one needs to launch it. Not sure if there are any lancher UIs out there, or if one has to write custom code for that.
        • eschaton 4 hours ago
          My point is that as long as OpenBSD can boot like Linux, you just have to tell whatever VM front-end you’re using that you’re booting a Linux but give it an OpenBSD kernel and RAM disk.

          Traditionally BSD has booted very differently than Linux, because Linus adopted the same boot process as MINIX when he first developed it (since he was actually using the MINIX boot blocks at first).

          BSD has historically used a bootstrap that understands V7FS/FFS and can load a kernel from a path on it. MINIX takes the actual kernel and RAM disk images as parameters so it doesn’t need to know about filesystems, and that tradition continued with Linux bootstraps once it was standalone.

          • Rediscover 3 hours ago
            Who else was rdev'ing the Linux kernel to tell it where the root ext2(?) partition was long before they were using RAM disks? Like with SLS or MCC?
            • fragmede 2 hours ago
              Originally Linux had Minix FS, followed by ext. Ext2 wouldn't make an appearance until 1993 by Rémy Card, so it depends on when you were using it.
        • fragmede 3 hours ago
          Parallels will run a VM that can (manually) boot bsd.rd from the EFI shell if you stick BOOTAA64.EFI and bsd.rd on a FAT32 GUID formatted.dmg, connect it to the VM, then boot EFI shell. Type:

              connect -r
              map -r
              fs0:
              bootaa64.efi
              boot bin.rd
          
          Then you'll be in the OpenBSD installer, having booted an OpenBSD kernel.

          You can grab the files from: https://ftp.openbsd.org/pub/OpenBSD/snapshots/arm64/

          Actually installing the system is left as an exercise for the reader.

  • ggm 3 hours ago
    Well done! FreeBSD 15 is a complete no-go for X right now on utm, rdp/vnc is the only way. Hopefully somebody will work out how to get a frame buffer working there, from this.
  • singularity2001 2 hours ago
    so does redox at least this fork: https://github.com/pannous/redox completely Rust-based without any Makefiles.
  • infi_v12 2 hours ago
    [dead]
  • hindustanuday 5 hours ago
    [dead]
  • iberator 5 hours ago
    No X and networking. What's the point then? Useless imo