Illegal instruction happens when an executable (in this case the compiler) is using an instruction that your processor (or in this case most likely VirtualBox) does not know (such as e.g. certain vector extensions).
This might help you too: tensorflow - How to enable AVX / AVX2 in VirtualBox 6.1.16 with Ubuntu 20.04 64bit? - Stack Overflow
If you can’t get it working, it might also be worth trying the 32 bit compiler (zig-linux-x86-0.*) which has less hardware requirements, but I would only use that as a last resort, since that is slower.