1. A method for antivirus protection of virtual machines, the method comprising: collecting, by a hardware processor executing a antivirus agent in a virtual machine, information about available security virtual machines that provide at least one or more resource-intensive methods of antivirus checking of programs running on the virtual machine; analyzing the collected information to determine a location of the virtual machine relative to the security virtual machines and determine priorities for each of the security virtual machines based at least in part on the location of the virtual machine; forming a list of the available security virtual machines according to the priorities of the security virtual machines to identify a primary security virtual machine having the highest priority on the list, wherein a plurality of non-primary security virtual machines in the list form a block, and wherein each security virtual machine within the block is assigned a numeric weight for selecting according to the assigned weight a security virtual machine within the block as a temporary security virtual machine; connecting the virtual machine to the primary security virtual machine; and requesting the primary security virtual machine to perform at least antivirus checking of one or more programs running on the virtual machine; wherein the virtual machine deployed on a physical machine is capable of connecting to a temporary security virtual machine deployed on another physical machine for antivirus checking.