Rat (Virus) on virtual machine

Hi Tom's Hardware community,
I have to test a program but I am afraid it may be a RAT. What would happen if i use it on a virtual mashine? Would it affect my "main" computer and follow every of my actions even when the virtual mashine is not on?

I think not but i am asking to be sure.