I was doing something similar but end it up ditching the whole thing since I'm running CS6 on Wine without any problems (except a buggy lasso tool):
https://gist.github.com/4610671
It checks for the VM state and waits the system to be ready, so you can turn off the vm if you want. Feel free to adapt to your needs.
When you're installing it will say it's not working...but check the HDD light because it's actually installing files so when it stops blinking your installation is ready.
It checks for the VM state and waits the system to be ready, so you can turn off the vm if you want. Feel free to adapt to your needs.