I'm doing some development in Linux running in VirtualBox. The computer is an Core i5 running Windows 7 (32 bit). According to the entry on Wikipedia, the CPU should support SSE4.2, but only SSE3 works in the VM. If I compile with the -msse4 flag in gcc, the resulting binary would crash with an illegal instruction error.
This is a known issue and already in their bugtracker:
[feature request] Enable the guest OS to make use of SSE4.1, 4.2 and POPCNT instruction sets https://www.virtualbox.org/ticket/8651
VirtualBox or KVM or any other such virtualisation technology exposes some features of the host CPU to the guest.
Why not exporting all features of the host CPU? Imagine you want to migrate your virtual machine from one host to the other, without interruption (or by saving the state). But the second host does not have SSE 4. If your VM would have exposed SSE 4 on host 1 and you would have successfully compiled and execute a program using this instruction set, when migrated to host 2 it will break.
That is why - IMHO - it is wise not to expose every supported instructions set of the host CPU by default and I am not surprised that this is the case with VirtualBox. It should however (and I hope that would be the implemented solution for the ticket) allow user to override the default choice of exposed features. And AFAIK this option does not exist yet. So you will have to be patient.
Note that KVM allows you to set the instructions sets you want to expose to the guest(s) per guest(s).