name: "Enable QEMU tools"
stages:
  boot:
    - name: "Enable QEMU"
      if: |
          grep -iE "qemu|kvm|Virtual Machine" /sys/class/dmi/id/product_name && [ -e /sbin/rc-service ]
      commands:
        - rc-service qemu-guest-agent start
    - name: "Enable QEMU"
      if: |
          grep -iE "qemu|kvm|Virtual Machine" /sys/class/dmi/id/product_name && \
          ( [ -e "/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] )
      commands:
        - systemctl start qemu-guest-agent
    - name: "Enable VBOX"
      if: |
          grep -iE "Virtualbox" /sys/class/dmi/id/product_name && [ -e /sbin/rc-service ]
      commands:
        - rc-service open-vm-tools start
    - name: "Enable V"
      if: |
          grep -iE "Virtualbox" /sys/class/dmi/id/product_name && \
          ( [ -e "/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] )
      commands:
        - systemctl start vmtoolsd
