Using bitcoin on a virtual machine is not a problem, it just adds one more layer of things that can break, like the day you can't mount your virtual hard drive.
The data directory is %APPDATA%\bitcoin, typically C:\Users\username
\AppData\Roaming\Bitcoin. If you don't know where this is, you probably haven't backed up your wallet, which should be the first order of business - copy the wallet.dat file there to a USB stick and store it away, or 7-zip it with a strong password and email it to yourself, etc.
If the rescan option didn't work, then we next must suspect a corrupted blockchain database in the local client. Before starting copy the entire
data directory to a new location, name the folder bitcoin-backup20110804 or such, so you can always put things back as they were if you screw it up.
You can then remove all the files in the data directory and the 'database' subdirectory except the wallet.dat
. If you were to re-launch bitcoin now it will have to download the entire blockchain off the p2p network again, which can take many hours. To give it a head start, you can unzip the files from the bitcoin_blockchain_120000.zip file at http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/
into the bitcoin data directory. This download includes the blockchain up to April 2011, but still will require a normal p2p download and rescan of blocks 120000-139580, which is probably where your missing transactions are.
If after removing all old blockchain and database files the bitcoin client and letting the bitcoin client bootstrap from the network again, you are still getting an error about missing transactions and versions (and you've re-installed the client), then the wallet.dat is the only thing left that could be giving you problems. Were you ever running a different or forked version of bitcoin? Perhaps running that old client software will make it work correctly and you can get the bitcoins out. If you do not have a wallet.dat backup, then the only way to proceed after that is to look at corrupted wallet repairs.