Detect if transaction request for a certain database Query has come from a Virtual Machine?
There is no specific, built-in, method for determining if a client connection is coming from a virtual machine.  You'll need to identify the client connections via some other method, such as the name of the client machine.  

For instance, if the VMs are named like "VM01", "VM02", etc, you could use a server-level logon trigger to deny connections from machines not named like "VM%".   Be aware, if the logon trigger doesn't work correctly you run the risk of preventing all client connections.  If the trigger doesn't accept connections from the server machine, SQL Server Agent won't be able to connect.  In short, there are a lot of "gotchas" using a logon trigger.