5
\$\begingroup\$

When I was doing web development, I would develop websites inside my virtual machines, which had all tools and packages downloaded on them and ready to go. I quite liked this approach to development since I didnt have to clutter up my Host OS with a bunch of different packages and other other software only needed for development.

So for game development, given its focus on speed and much higher demand for system resources, is developing in VMs viable? Or are there any gotcha's or other difficulties when using VMs that could deter someone from developing and testing a game within a VM vs directly on the physical computer hardware? Mainly wondering about speed and if the extra abstraction layer of a VM would cause any significant slow down of game testing (having slower or wonky FPS or things of that nature)?

EDIT: Also, for more info, I'm currently developing on my windows 10 PC with a core i7 processor. I can switch to the built in hypervisor (hyper-v) at any time.

\$\endgroup\$
  • \$\begingroup\$ You know, that those programs don't come thin air, do you? They're on the same hard drive, and you could technically reach them. The only thing you do with this can be done by deleting the program icons. \$\endgroup\$ – Bálint May 4 '17 at 22:00
  • \$\begingroup\$ I got to admit that I didn't work with VMs much lately, but last time I checked support for 3d hardware acceleration was spotty at best, making it unusable for the development of any games which use 3d engines. \$\endgroup\$ – Philipp May 4 '17 at 22:08
  • \$\begingroup\$ @Philipp Ya thats what I was worried about. Not sure if there would be better speed/reliability with a type-1 hypervisor such as hyper-v or not so just seeing if anyone had any experience with this. \$\endgroup\$ – Jason May 5 '17 at 1:29
  • \$\begingroup\$ I've done some limited work using the free VMWare player; my experience is that it's most useful for cross-checking in performance-constrained environments, and perf-wise it's roughly equivalent to an Intel integrated from maybe 5 to 10 years ago. True hardware virtualization may, of course, be better. \$\endgroup\$ – Maximus Minimus May 5 '17 at 11:46
4
\$\begingroup\$

If your goal is to use a separate environment for isolation of libraries, dependencies, etc. then yes, you can use either VMs or containers for this purpose. However, they're not without their caveats.

Virtual Machines add the overhead of an entire additional operating system, but it much closer mimics what a user would see on their own environment. So, you would need a powerful enough computer to run two operating systems: one for your development, and one for executing your game.

Containers are much lighter weight (and you can run containers on Windows, now, too!) but with the caveat is that they're not exactly a full replica of the target environment.

With either of these solutions, keep in mind that it's a bit of a project to get high-performance video as well as audio (with specific hardware acceleration that you might want), as they typically abstract specific hardware and treat it as more generic hardware.

It is likely possible to address these issues (YMMV, depends on specific manufacturers of your audio/video hardware, drivers and compatibility, etc.), but some folks have issues running games in VMs and containers for exactly this reason.

For example, speaking of Hyper-V since you brought it up, see this post:

I setup Win 7 in a windows 2008 r2 x64 with hyper-v but I can't add any sound device in win7 VM, Would somebody help me?

Hyper-V doesn't provide a virtual audio device. If you want audio, you need to use RDP to get the virtual audio support working.

However, VMConnect (likely much more recent than the earlier post) appears to allow you to use local devices in Hyper-V, such as USB drivers and audio hardware.

You will likely need to spend some time investigating whether it's possible to support the specific hardware devices that you have in either VMs or containers, so while that would be valuable (I agree with you on the benefits), this is definitely an issue to be aware of, and budget time for, if you're interested in going down this route.

If you do manage to make this work, please write up a blog post and/or share your source code in a GitHub repo so that others can find it and benefit from this work in the future.

\$\endgroup\$

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.