I find that I’m using Linux on the desktop more and more. It’s certainly good enough for techy users, and for some non-techy users too. But I still use Windows on a day to day basis, and I’m likely to for the foreseeable future. On the other hand I don’t trust Windows security: there have been too many unfixed problems.
What I really want is to be able to run Windows on top of Linux. That would isolate Windows to some extent. And if I use a virtualised solution, then I’d be able to run other operating systems alongside Windows whenever I want to test something out. Sounds like a good solution.
But I want it to run at a reasonable (near native) speed, and I want to make proper use of my graphics adapter even in guest operating systems. I should be able to play games in Windows Vista.
I had a look through most of the virtualisation solutions listed on Wikipedia. It turns out no solution can do exactly what I want.
Here’s the state of the art:
- Xen, which is what I use on servers, can’t do 3D graphics. There are suggestions in the mailing list about how 3D graphics might be achieved. More on this below. And there’s an interesting bit of work, called Blink. This lets you use Dom 0 graphics with panes controlled by other Doms. Neat! Unfortunately the source code for this is no longer available; it seems like the repository went away.
- X11-based guests can use VMGL for 3D graphics. Not for Windows. It works with Xen, but can also work with VMWare.
- VirtualBox has the beginnings of support for 3D graphics. At the moment it’s only
- OpenGL on Windows guests on Windows hosts. The most important bits of OpenGL reportedly work.
- VMWare, both Server and Workstation versions, has experimental 3D support. Interestingly, Jacob Gorm Hansen, who developed Blink now works for VMWare. I wonder whether this is also his work. It looks like Xen slipped up in not hiring him.
- KVM doesn’t yet have 3D support, outside of VMGL, but it’s growing so quickly that you can expect it will before long.
After looking at various mailing lists and the solutions above, several mechanisms for exporting
3D graphics to guest operating systems become clear:
- You might be able to export a whole graphics adapter to a guest OS. This requires a PCI pass-through mechanism. A sticking point here appears to be that the graphics drivers expect to be resident at particular absolute addresses. So, for this to work you’d need an address translation scheme. You’d also only be able to see one desktop/guest OS at a time: the OS would gain complete control over the graphics.
- Paravirtual drivers. Which is what VMGL looks like. It’s aware that it’s operating in a virtual environment, and passes data to a common underlying subsystem for rendering. This seems to me to be the best mechanism. But Windows is not all about OpenGL.
But, there’s a viable path for Windows. If you had a paravirtual windows driver, it could take Microsoft Direct3D calls, and translate then into OpenGL. This could then be passed through VMGL. Voila!
For other operating sytems, you’d have to do something similar, where they supported a 3D API.
In fact, this wrapper exists in part already. (As it’s under the MIT licence, and it’s for Direct3D 8, I wonder if this found its way into
VMWare, which supports Direct3D 8.1.)
What remains is the not inconsiderable task of writing a Windows driver, or two, which use the wrapper.
Then I’ll have the environment I want. Anyone interested in writing this for me?
-
I only just tried virtualisation for the first time this weekend and was thinking along the same lines. I have done a very small amount of OpenGL coding in the past (mostly just online tutorials, and going through the OpenGL Red and Blue books), and I don’t see why having a virtual graphics card that passes everything through to OpenGL on the host should be that difficult (and most OSes have an implementation of OpenGL). Of course I’ve never written any drivers so perhaps it’s more involved that I expect. My idea was along the lines of VMGL but with nothing necessary to be installed on the host – rather I think it would be better to write drivers for the native VirtualBox virtual graphics hardware that wrap all OpenGL calls (and DirectX calls in Windows’ case, as you point out) and have a mechanism in the VirtualBox code (as there’s an open source version) to run the same graphics calls on the OS. Basically what VMGL was doing, but I don’t see why it shouldn’t work for Windows as well, and I don’t see why anything extra should need to be installed on the host if it already has an OpenGL implementation..
It’s interesting that not much work seems to have been done on getting this to work for Windows at all. Seems like a project that I would actually be interested in for the first time in a long while – I may look into it a bit more when I go on holiday this week if the place we’re going to has a net connection
-
This is a nice summary on the current state of virtualized 3D. Exactly what I was looking for, thanks!
-
Hard to fine information you you. Thanks !
Virtualization, Xen, VMGL, etc are now old and actual things.
Why no more support today ???
Even about Xen I have difficults to foud good doc,
such as PCI passthrough.Is there some nvidia initiative about nvdia paravirtualized Linux&Window driver ?
I want same environment as you.
Yes, we probably have to do it ourselves.

3 comments
Comments feed for this article
Trackback link: http://www.tangledtime.com/wp-trackback.php?p=87