1. 9
  1. 3

    The libvirt, QEMU, Virtualization.framework stack is getting close on macOS. I just wish it didn’t involve non-upstreamed formulae.

    QEMU recently merged support for Apple Silicon and the Virtualization.framework, so hopefully once that’s released the Homebrew formula will be updated to that version and then you won’t have to build QEMU from scratch.

    I haven’t looked into why libvirt needs patching.

    A working virt-install homebrew package would be the cherry on top for this workflow on macOS. It would completely remove the hand-crafted XML step. I highly recommend incorporating a cloud-init ISO to this workflow, as it will remove the manual setup over VNC. Although, I might be biased as I tend to only use headless VMs.

    1. 1

      I agree re: the cherry on top. Do you know of any good references for cloud-init similar to this usecase. Would great for a situation I’m working with.

      1. 2

        I’m not an expert, but this is almost entirely how I use cloud-init for my VMs at home:

        The meta-data file:

        $ cat > meta-data <<EOF
        instance-id: <the_hostname_you_want>
        local-hostname: <the_hostname_you_want>
        EOF
        

        The more useful user-data file:

        $ cat > user-data <<EOF
        #cloud-config
        
        users:
          - name: <your_username>
            sudo: ALL=(ALL) NOPASSWD:ALL
            ssh_authorized_keys:
              - <your_key>
              - <another_ssh_pub_key_if_you've_got_it>
        
        resize_rootfs: True
        packages: ['avahi-daemon']
        EOF
        

        Create an ISO:

        $ genisoimage -output seedci.iso -volid cidata -joliet -rock user-data meta-data
        

        Then you can download a cloud image and pass the seedci.iso file generated in that last step as a cdrom drive.

        Anything more complicated than this and I would need to go to the cloud-init documentation or look up tutorials.