I realize a few years have passed but wanted to answer since this post shows up pretty high when you google for "virtualbox 3d multiple GPU". In the time that has passed, things have gotten a lot simpler and better.
People that stumble upon this thread will likely land here because they have a laptop or PC that has two GPU's, which is quite common these days -- especially on gaming laptops. The onboard Intel GPU is used for rendering windows and general applications, but applications that make use of GPU 3D functionality should do that via the higher performing Nvidia GPU.
Today, I was building an Ubuntu VM on my laptop to do some cross-platform development, and everything was fine except the guest VM was extremely slow, and there was no explanation for it because CPU, memory, disk were all showing low utilization.
It didn't take long to figure out it was video performance that was causing the problem. Launching applications, maximizing/minimizing windows -- anything that we take for granted in 2019 but needs 3D acceleration to work at any reasonable speed -- was using GPU 0.
It was easy to determine this because Windows 10 now has the ability to see GPU utilization using "task manager", then the "performance" tab. And I could see as I moved windows, maximized, minimized, that was being done through GPU on the host. That GPU on the host is the integrated Intel HD GPU, and I wanted to use the NVidia GTX-1050ti, which was GPU1.
After searching around I didn't really find anywhere where you could specify which GPU to use. But this thread, and some others, reminded me that on these kind of setups you have to go into the NVidia control panel, then "manage 3d settings", then the "Program Settings" tab.
You won't likely find "Virtualbox" in the list. But you can press the "Add" button, and add virtualbox.exe. You may have to drill down the drive/path where your virtualbox installation is. Once you have added it, in the settings below make sure that item 2. "Select the preferred graphics processor for this program" is set to the GPU that you want it to use, which in my case was "HIgh-performance NVIDIA processor".
Don't set it to auto, and certainly don't set it to integrated. Of course, you need the VM settings set with the 3D acceleration box ticked, and you need the guest additions installed on the host. But once you have set the host video 3d settings as described above, shutdown the guest VM, exit virtual box, and then re-launch virtualbox and the VM.
If you use task manager|performacne and look at the "virtualbox manager" process and watch what GPU gets used when you navigate the guest VM's UI, you should see it using the better GPU now. See the image pasted below.
All that said, don't expect to be able to run games in a guest VM. 3D acceleration pass thru still is not quite that far along. But you can expect to have a modern OS and UI in your guest, and have an acceptable experience. One would be able to play older games in the guest VM, like anything based on directX9. Unfortunately, as the ability to virtualize GPU eveolves, the 3d gaming technology evolves quicker.

2
VMs don't get direct hardware access - they get a virtual GPU . . . related question: http://superuser.com/questions/395245/why-is-my-windows-8-virtual-machine-not-using-my-nvidia-card?rq=1
– ernie – 2014-07-09T21:03:02.3276
@ernie VirtualBox can give guests direct access to the OpenGL API of the host's GPU. As far as I can tell that works on my machine. Only VirtualBox is using the Intel GPU instead of the NVidia GPU. Quote from the VirtualBox manual: "With this feature, if an application inside your virtual machine uses 3D features through the OpenGL or Direct3D 8/9 programming interfaces, instead of emulating them in software (which would be slow), VirtualBox will attempt to use your host's 3D hardware."
– feklee – 2014-07-09T21:10:10.227@feklee The title of the question is misleading: You want to use the nVidia GPU for VBox. 'From' is also possible but means sth different: Hardware-Passthrough, ie. acess the host's GPU directly from within the VBox. – larkey – 2015-12-30T08:18:48.840
http://askubuntu.com/questions/139320/enable-graphics-card-in-virtualbox – Ciro Santilli 新疆改造中心法轮功六四事件 – 2017-03-02T15:14:40.890
Find about "virtualbox passthrough video". – e-info128 – 2019-04-24T03:16:54.810