Where does VirtualBox get it's video memory from?

This is for discussing general topics about how to use VirtualBox.
Post Reply
Pico
Posts: 1
Joined: 3. Jan 2022, 21:26

Where does VirtualBox get it's video memory from?

Post by Pico »

Initially, this may seem like a very dumb question, and it quite possible may be. I assumed it got it from the video card on the host computer. It wasn't until I installed VB on a headless computer that this struck me...

I read some (not all) of the threads on this subject, but I came out more confused then I went in.

VirtualBox passes hardware calls from the VM to the host hardware..

But what if their is no host hardware?

When I allocate 256MB of video memory and activate 3D acceleration for the VM hosted on a headless machine, what am I actually doing?

The threads I read were mostly geared around a (perceived) need for more then 256MB assigned to the VM. And all the answers where basically, "no you don't"

When I google search "where does virtualbox get it's video memory resources from" I am met with endless returns on "how to assign more video memory".

It doesn't tell me where the video memory is coming from. Swap file or system RAM? And the statement I read, "The virtual graphics card has nothing to do with the VRAM of a physical GPU" only confused me more.

I planned on buying a video card for the host machine. But if VB doesn't have access to the physical GPU...

So what then?
towo2099
Volunteer
Posts: 362
Joined: 18. Aug 2014, 21:53
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Android, Linux

Re: Where does VirtualBox get it's video memory from?

Post by towo2099 »

No, VBox ha no access to your physical GPU.
VRam is "stolen" from your normal Memory.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Where does VirtualBox get it's video memory from?

Post by mpack »

Pico wrote: VirtualBox passes hardware calls from the VM to the host hardware..
No, that's the wrong way to think about it. VirtualBox is not some kind of relay device.

VirtualBox is a PC simulator. All of the hardware seen by the guest OS is simulated, except the CPU alone.

The simulator is just an app running on your host PC, making normal app calls to the host OS. It knows the host OS. It has no special knowledge of host hardware, as that is the business of the host OS.

So how is guest "GPU memory" simulated? In the same way that everything else is simulated: by using host PC RAM and disk space and CPU time. You know you don't need an actual "PCnet-FAST III" network card to be present in order for VirtualBox to simulate one. And you don't need an actual graphics chipset to be present in order to simulate one of those either.

But, I believe you are right to assume that enabling 3D acceleration on a headless VM is pointless. When you enable 3D acceleration VirtualBox calls the host OpenGL API to implement certain functions. In a headless VM I'm pretty sure those functions aren't going to be hardware accelerated, but I'm not certain of that.
Post Reply