to install any driver on a Virtual Machine. The drivers are usually included with the VM install package (e.g.: VM add-ons, VM-tools).
To restore your X try this:
Login as user >> type the command: sudo nano /etc/X11/xorg.conf
#could also be "ati" or "i810" or any other driver
- Change the value of the Driver to "vesa"
- Save the file by pressing CTRL o m x
- Now you can type startx
Uninstall the Graphics driver which messed up your system NOTE: It's not possible to try compiz on a Virtual Machine. [ AFAIK]