McAfee Webgateway on KVM

The McAfee Webgateway is officially supported on VMWare or on a McAfee Appliance.  In my test environment at home, i prefer to use libvirt running on a Debian system (qemu/kvm).
When I first tried to install the webgateway, I got the error that this was not an appliance and the installer refused to go further. I want to be able to use the media provided from McAfee, so in the future I’m able to use the virgin media from McAfee without having to remaster the ISO with some modified scripts inside.

The first step is to find the particular code which is preventing the installer to start.  The hint is the error message “No MWG Appliance detected.”

The ISO provided contains a large squashfs image.  Inside the SquashFS image, I found the script /install/startup.d/warning.  This code will check the output of dmidecode and if it’s a recognized manufacturer, product and bisovendor, the installation is allowed to continue:

check_system() {
  local manufacturer=$(dmidecode -s system-manufacturer | grep -v '^#' | sed -e 's/[ \t\n]*$//')
  local product=$(dmidecode -s system-product-name | grep -v '^#' | sed -e 's/[ \t\n]*$//')
  local biosvendor=$(dmidecode -s bios-vendor | grep -v '^#')

  [... code removed ...] 
  echo "Board: $manufacturer $product"
  echo " "
  case "$manufacturer" in
    CyberGuard|Secure\ Computing|McAfee,\ Inc.)
      warn_and_wait
      ;;
    VMware,\ Inc.)
      touch /tmp/magic
      warn_and_wait
      ;;
    HP|Hewlett-Packard)
  case "$product" in
    *ProLiant\ BL*)
      warn_and_wait
      ;;
    *)
      wait_for_user_input

Ok it seems we can just set the manufaturer to “CyberGuard”, “Secure Computing” or “McAfee, Inc.” and be done with it. KVM allows you to change the stuff passed to the guests when they run dmidecode, so I modify my xml file:

  <sysinfo type='smbios'>
    <bios>
      <entry name='vendor'>VendorName</entry>
      <entry name='version'>1.0</entry>
      <entry name='date'>Date</entry>
      <entry name='release'>Release</entry>
    </bios>
    <system>
      <entry name='manufacturer'>CyberGuard</entry>
      <entry name='product'>WebGateway</entry>
      <entry name='version'>1.0</entry>
      <entry name='serial'>XXXXX</entry>
      <entry name='uuid'>THIS MUST MATCH THE UUID OF THE DOMAIN</entry>
      <entry name='sku'>abc123</entry>
      <entry name='family'>Family</entry>
    </system>
  </sysinfo>
  <os>
    <type arch='x86_64' machine='pc-1.1'>hvm</type>
    <boot dev='cdrom'/>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
  </os>

With this, the installer passes the first hurdle and continues to creating the filesystems.

Update 2017: And in case anyone is using VirtualBox:

set vboxname MWG-Test
VBoxManage setextradata %vboxname% "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "CyberGuard"
VBoxManage setextradata %vboxname% "VBoxInternal/Devices/pcbios/0/Config/DmiSystemProduct" "WebGateway"