8

I'm trying to run a game inside a VBox guest and it requires 256MB of memory. However when assigning 256MB of memory in VBox windows is using 3MB which leaves only 253MB as reported by DXdiag in Windows 7 Is there a way to report 256MB of memory to make the game run? Is it possible to increase VirtualBox memory beyond 256MB or fool Windows7 to report more memory than is available?

7

I've seen the same memory reporting issue. With 256MB allocated, both Windows 8.1 and Windows 7 report ~255MB for me. Strangely, when set to 128MB, both report ~191MB. So it seems like there may be an issue with VirtualBox's 3D video driver, or it's counting some of the 3D accelerated memory incorrectly (more on this later). Windows XP Professional, which uses a different 3D driver, reports 128.0MB at 128MB allocated. Using VBoxManage to set the memory to 256MB in XP allows it to break the 128MB GUI settings barrier, and it reports 256.0MB in dxdiag.

Granted, there may be some inherent inefficiency in Windows 7 and 8.1, as I found a Dell Latitude laptop with Win7 to report its VRAM as ~4051MB (3.96GB), and I can't believe Intel would throw that strange number into the shared graphics memory.

To answer your question directly, I do not know about any way to force VBox (or its 3D driver) to report the correct amount of memory, and it's currently not possible to set the VRAM allocated for the VM higher than 256MB. Using the command VBoxManage modifyvm "Windows 7" --vram 1024 yields:

VBoxManage: error: Invalid VRAM size: 1024 MB (must be in range [1, 256] MB)
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "COMSETTER(VRAMSize)(ValueUnion.u32)" at line 570 of file VBoxManageModifyVM.cpp

and setting the VRAM manually in the *.vbox file causes the VM to crash on startup or not apply the new memory setting.

Based on the fact that you say that this is a game, I'm going to guess (correct me if I am wrong) that it is a 3D-heavy game (such as Portal, Borderlands, Half Life, Bioshock, Minecraft, etc.) that requires the extra VRAM. According to this ticket and the official manual, if 3D acceleration is enabled and your correct guest additions are installed, the guest OS's 3D commands are forwarded directly to the host's video card, instead of emulating the 3D hardware, which would be much slower. So, if the game needs the memory for 3D processing, it should work on the 256MB (or maybe even less) since your host computer is handling the 3D load directly, including the memory (using the host's VRAM). My old mid-2009 13" Macbook Pro had 256MB VRAM, so probably any modern computer would do just fine.

My question then is: have you actually tried to run the game? If you have not, give it a shot! It may surprise you. If you have run the game, and it did error, sometimes game crash errors are not the most descriptive. A lot of games assume that you have competent 3D hardware and say that the problem may be a memory issue. A friend of mine got a "probably ran out of memory" error from a game running on Virtualbox, and it turned out that they had not enabled hardware 3D acceleration in the VM settings, which caused the game to crash on launch. If 3D acceleration is enabled and a Direct3D driver is installed from the guest additions, try the other Direct3D driver (there are two for Windows 7). The experimental WDDM driver (which enables Aero support) does not require booting to safe mode to start, while the basic Direct3D driver does. In the guest additions installer, when you check the box for Direct3D, it will give you an option for to select one.

If you do have 3D acceleration enabled, and neither Direct3D driver works, your game may not support/need 3D in the way that VirtualBox can provide. You could try enabling 2D acceleration (this sometimes requires disabling 3D) to see if that's any change. If there is no change, I can't help you without knowing what the game is and what (if any) error messages are seen.

If the game still does not work, and it can't make use of the 2D or 3D acceleration, you may need to use a PCI passthrough graphics card (Linux hosts only) that has the resources the game needs. This is detailed in Chapter 9 of the Virtualbox manual. It's a somewhat involved process that requires specific hardware, so do research on your system to see if it will work. You need to check the Linux kernel, your motherboard, your CPU, and your graphics card that will be forwarded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.