Is Bitcoin database cross platform compatible? I want to use my Windows 7 Bitcoin database (the block chain I downloaded + my wallets) on Linux (Debian). I run Debian as VirtualBox guest on Windows 7 host and share the Bitcoin data folder (C:/Users/Username/AppData/Roaming/Bitcoin/) as a folder to Debian.

However bitcoind on Debian with proper -datadir parameter says "Error opening block database. Do you want to rebuild the block database now?" message. This brings me to the question whether the databases are compatible between Windows and Linux at all.

Edit 1:
I am using one Bitcoin instance at a time. I realized I get the same error even when using en empty data directory that is mounted via VirtualBox on the host.

Here is the debug.log (same for empty or full data directory):

2013-12-22 20:49:07 Bitcoin version v0.8.6-dirty-beta (2013-12-05 13:11:26 +0100)
2013-12-22 20:49:07 Using OpenSSL version OpenSSL 1.0.1e 11 Feb 2013
2013-12-22 20:49:07 Default data directory /home/kozuch/.bitcoin
2013-12-22 20:49:07 Using data directory /home/kozuch/vboxshare2
2013-12-22 20:49:07 Using at most 125 connections (1024 file descriptors available)
2013-12-22 20:49:07 init message: Verifying wallet...
2013-12-22 20:49:07 dbenv.open LogDir=/home/kozuch/vboxshare2/database ErrorFile=/home/kozuch/vboxshare2/db.log
2013-12-22 20:49:07 Bound to [::]:8333
2013-12-22 20:49:07 Bound to 0.0.0.0:8333
2013-12-22 20:49:07 init message: Loading block index...
2013-12-22 20:49:07 Opening LevelDB in /home/kozuch/vboxshare2/blocks/index
2013-12-22 20:49:07 : Error opening block database.
Do you want to rebuild the block database now?
2013-12-22 20:49:07 Shutdown : In progress...
2013-12-22 20:49:07 Flush(false)
2013-12-22 20:49:07 DBFlush(false) ended               0ms
2013-12-22 20:49:07 StopNode()
2013-12-22 20:49:07 Flushed 0 addresses to peers.dat  4ms
2013-12-22 20:49:07 Flush(true)
2013-12-22 20:49:07 DBFlush(true) ended               1ms
2013-12-22 20:49:07 Shutdown : done


Seems like the problem might be with following:

ErrorFile=/home/kozuch/vboxshare2/db.log


Edit 2:
There also is a .lock file with 0 size in the datadir after I get the error.

Edit 3:
So "ErrorFile=/home/kozuch/vboxshare2/db.log" was not a problem. I get this error for a working instance locally (without shared data folder).
It should be compatible if your running one instance at a time, BUT I think that the datadir is being locked. 
Try to find more details in the logs, it should tell you the reason of the error which could be anything.
if you are running any bitcoin software on windows stop it and try to restart bitcoind from your linux box. 

EDIT: Did you install bitcoind and run it as root? if not, can you try to chown -R  ~/.bitcoin as root, not the db folder itself, it still can be a permission issue,