I know it's weird. XNA Version is 3.1 and VirtualBox version is 4.0.2.
问题:
回答1:
Install the software reference device that comes with DirectX SDK. For me, that enabled running XNA related unit tests on a Hyper-V virtual machine. It should do the trick for any virtual environment since it implements a full DirectX device in software and does not rely on available hardware or virtualized drivers. It will not be blazingly fast but it should work.
Installing the core parts of the DirectX SDK is enough, no further installation or configuration is required.
(Almost forgot) In the code that sets up the device you must specify the device type to use:
var deviceType = (hardwareDevice ? DeviceType.Hardware : DeviceType.Reference);
var graphicsDevice = new GraphicsDevice(GraphicsAdapter.DefaultAdapter,
deviceType,
...);
As a side note: in XNA 4.0, choosing reference or hardware device is moved to the GraphicsAdapter
using the UseReferenceDevice property.
回答2:
I've managed it in VMware Fusion, which supports DirectX 9c. However, you may have to use the Reach game profile rather than the full HiDef one. This can be done easily in the game project properties window in Visual Studio.
I hope this helps, but as dotalchemy says, you will want to make sure support is there!
回答3:
Enable 3D Acceleration according to DirectX in VirtualBox 3.0.0 - Pure joy is here and the XNA project would run just fine.