This site is for Avast Business products only. For articles on AVG Business products, see AVG Business Help. If you are in the right place but cannot find what you are looking for, please contact Avast Business Support for further assistance.

Device Cloning

This Article Applies to:

  • Avast Business Hub

 

The Avast Business Management Consoles come equipped with the functionality of device cloning/device mirroring. When cloning a master hard drive image or VM image with Avast Business ready for a deployment to multiple machines around the network, you will need to carry out the following tasks on the master hard drive that you will be cloning.

In cases where the clones will have the same BIOS serial number, please use the steps in this article to ensure the devices are correctly identified.

On Master Hard Drive Image or VM Image

  1. Install the Essential/Premium/Ultimate Business Security agent on the master device/VM
  2. Turn off the device, snapshot it, then turn it back on
  3. Disconnect the device from your network
  4. Change the device’s name
  5. Open CMD as an administrator and enter the following command:
    • For 64 Bit OS: C:\Program Files (x86)\AVAST Software\Business Agent\setup.exe -c
    • For 32 Bit OS: C:\Program Files\AVAST Software\Business Agent\setup.exe -c
  6. Open RegEdit and check the CL value: HKEY_LOCAL_MACHINE\SOFTWARE\AVAST Software\Business Agent
    • CL value will be set to 1
  7. Turn off the device

Booting Clones

  1. Create a clone from the master device
  2. Regenerate a new MAC address for the clone
  3. Revert the master device and turn it on
  4. Connect the master device to your network
  5. Turn on the cloned device
  6. Connect the cloned device to your network

Two devices should appear in the console.

Repairing Clones Created Without Invoking 'setup.exe -c'

Open CMD as an administrator and enter the command: C:\Program Files (x86)\AVAST Software\Business Agent\setup.exe -b

  • 64 bit: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\AVAST Software\Business Agent
  • 32 bit: HKEY_LOCAL_MACHINE\SOFTWARE\AVAST Software\Business Agent

The CL registry key value dword will be =dword:00000002

Once this registry key value has been written, the code will post a re-authentication message to the AvastTrayApp.exe which will start a re-authentication of the client against the authentication server.

During this re-authentication, all the same steps that are performed in the first step above are performed. The main difference being that the local active NIC record is automatically deleted from the master device record in the back-end database as well as from the clone's local policy database. When the clone repair is complete, the CL key value will be changed to 0 from value of 2.

In order for the -b (bad clone repair) option to complete on the clone, it must finish going through a complete re-authentication, this could take up to several minutes. Also, the master hard drive image or master VM image will need to go through a re-authentication as well in order for it to update the computer name in its device record and retrieve the updated NICs table. The master re-authentication may be manually invoked by the user or else it will happen automatically during the next reboot.

Scripts

These scripts can be applied for all virtualization types, not just Hyper-V, and can repair existing clones.

Displaying BIOS UUID

$VMName = 'vmname'

(Get-CimInstance -Namespace Root\Virtualization\V2 -ClassName Msvm_VirtualSystemSettingData -Filter "ElementName = '$VMName'").BiosGUID

pause

Changing UUID After Reboot

$VMName = 'vmname'

$MSVM = gwmi -Namespace root\virtualization\v2 -Class msvm_computersystem -Filter "ElementName = '$VMName'"

# get current settings object

$MSVMSystemSettings = $null

foreach($SettingsObject in $MSVM.GetRelated('msvm_virtualsystemsettingdata'))

{

$MSVMSystemSettings = [System.Management.ManagementObject]$SettingsObject

}

# assign a new id

$MSVMSystemSettings['BIOSGUID'] = "{$(([System.Guid]::NewGuid()).Guid.ToUpper())}"

$VMMS = gwmi -Namespace root\virtualization\v2 -Class msvm_virtualsystemmanagementservice

# prepare and assign parameters

$ModifySystemSettingsParameters = $VMMS.GetMethodParameters('ModifySystemSettings')

$ModifySystemSettingsParameters['SystemSettings'] = $MSVMSystemSettings.GetText([System.Management.TextFormat]::CimDtd20)

# invoke modification

$VMMS.InvokeMethod('ModifySystemSettings', $ModifySystemSettingsParameters, $null)

pause