I agree with what the staff members have said here, it is true that malware on a well secured host running a VM has virtually no options to escape the VM. However various VM software developers have issued statement about bugs and exploits within their software that could make it possible for malware to actually corrupt the VM.
Malware and targeted attacks can propagate from the VM to the host in several circumstances:
- If there's a bug in the VM software. That's not very common, but it's possible.
- If there's a bug in the host OS. A bug that specifically allows malware to break out of a VM is unlikely but again possible.
- If there's a bug in the processor. That's even more unlikely but still not mathematically impossible.
- If there's a way for the malware to exchange information with the host. This can be over the network; in this respect, there's no difference between using a VM and using a separate physical machine, so you need to firewall the VM appropriately (allow only the bare minimum, don't do anything that might allow the server to hijack the client such as SSH with X forwarding). Another vector is via the VM tools such as file and clipboard sharing: the software running in the VM might read and write shared files, access the host clipboard, etc. So when running malware in a VM you should disable all these convenience tools (disable them in the VM configuration, it's not enough to refrain from installing the guest software since the malware could come with its own).
All in all, most malware can be analyzed safely in a properly configured virtual machine. Disable all guest features and don't connect to the VM with any protocol that allows the server to influence the client. Firewall the VM as if it was hostile (it is); you should use a host-only network so that you can easily control what goes there.
There's another reason why you might prefer a physical machine to a virtual machine. There's quite a bit of malware that attempts to detect whether it's being analyzed, and doesn't behave maliciously when it is. Obvious, common things that malware tries to detect is signs that it's running under a debugger: check if it's being p-traced (or the Windows equivalent), check for sudden pauses in the execution, … And some malware looks for telltale signs of a VM, such as drivers for hardware that common VM software emulates, or CPU oddities that are inexistent or rare outside emulated CPUs. This isn't to say that you cannot analyze malware in a VM: sometimes you can, sometimes you can't, it depends on the malware. If you start in a VM and find nothing you need to be prepared to move to a physical machine.
That being said every day new malware is being generated and i personally have seen malware capable of evading and literally breaking specific VM software. It is a myth to say that the malware does not exist as it does and from what i have seen some of them are seriously nasty. But the odds that you are going to run into such malware just by harvesting the net are remote, because most of these very sophisticated pieces of code are made with a specific task and reason in mind, but during my work i have seen corporate networks being penetrated with malware that will jump out of a VM machine just like that. Again these are targeted attacks and are rare as not many malware writers do have the skill and resources to develop these tools. Does that mean that malware can evade a proper VM? No but they certainly can find holes in the security and exploit it such as bugs.
Another thing i would like to mention is that malware grows increasingly more powerful and in the near future i think that VM capable malware will become a common thing.
Note that there are risks with a physical machine too: malware could attempt to plant itself into one of the many pieces of firmware on the motherboard and peripherals. Toolkits for this are beginning to emerge, such as Rakshasa and Mebromi. So if you analyze some sophisticated malware on a physical machine, don't trust this physical machine any more, ever.
Just saying...