I like mperrin’s Vagrant-centric answer, but as you might see from the comments there, my personal opinion is to “keep it simple” and I would recommend a simple export of a VirtualBox OVA as you have configured and passing that along to your students.
That said, you ask this:
The question is, given people have different graphics hardware, how
does this work? Or does it work? And if it does, how do I distribute
it? Do they have to install VirtualBox, then load some file I give
them, or can I create a single installer easily?
Veering into DevOps
I’m not too sure what you are teaching or doing or what you expect your students to get out of this whole exercise, but a lot of the concerns you are airing veer into the realm of DevOps (development and operations) and you might want to consider mixing that concept into your teachings.
Now I don’t think the whole concept of DevOps needs to be conveyed, but in my mind your creation of a stable VirtualBox OVA that you then pass onto students and ask them to use on their home/school machines would definitely open a door to questions about how one should deal with different hardware/system setups and how one might adapt.
So my recommendation for you is to strongly recommend that students use the VirtualBox OVA you would setup, but also be open to allowing students to simply install tools on their own. My gut tells me 95%—or more—of the students would happily and easily use the VirtualBox OVA method, but you can’t expect it to be 100% perfect.
Perhaps in the end you should just have some baseline of requirements for course tool usage and be flexible in their implementation.
Be Flexible Regarding How Tools are Used
For example, I do lots of PHP development and do systems administration/DevOps related to PHP development. And since I am on a Mac I prefer to use MAMP for local development. But I work with developers who use Linux or Windows for their development. Heck, some like using Vagrant coupled with VirtualBox for their LAMP development needs. And my attitude is I don’t care what their base OS setup is. As long as their PHP version is inline with the versions my clients use, I’m fine with whatever.
Occasionally a developer will state a bug is caused because—for example—code I have tested on MAMP is “not the same” as what would be on a Linux LAMP setup. And I say with 100% confidence, that I have always proven the issue is not the base OS but rather the PHP coding itself.
So all this blather is to basically convey the following: Just be flexible in your explanation of the use of a VirtualBox setup to the students and don’t expect spoon-feeding an OS to simply end all problems. It might knock 95% of your issues out of the park, but that remaining 5% will always have to be addressed in some way. So look at a VirtualBox setup—and perhaps a Vagrant script—as a tool that can be used in an arsenal to make life easier for some, but not necessarily the end-all solution for all issues.