Sunday, July 6, 2014

Hosting a VM, OpenGL and SSH

Last few weeks, on and off I've been having a play with window creation and (hopefully) context creation for OpenGL in D. Now this isn't the first time that I've done this. I've had a go at porting GLFW to D, I also ported OOGL to D and later on create DOOGLE based off of it.

See heres the thing with my current setup. I have one computer that I can really do dev work on. An HP E-190a, absolutely great machine even after 3 years its going strong. But its graphics card can really only handle OpenGL 3.x which is the first problem. Second, I don't want to dual boot it (partitions not setup for dual). So running Linux is the next issue, Windows is only one of 3 major platforms. And for Mac OSX I can't do anything for (don't own a Mac that can run 10.6+). But I do want to support Linux at the very least. Worst case scenario Mac OSX can just use an X11 server.

OpenGL

Now I've used VirtualGL in the past to hook into my server (basically an i5 8gb ram computer nothing fancy) but it does have a pretty new graphics card, supports Opengl 4.x. From past experience VirutalGL can be a little painful for on Windows. But maybe not on Linux? Thats the thing, I only really need it on a VM.

With VM's no current provider (VirtualBox and VMWare) do not support Opengl 3.0+. 2.1 yes, Opengl 3.3 shaders yes. Just not the Opengl 3.x+ API. So this is pretty easy to do, use VirtualGL to run programs compiled in the VM. It'll use the X11 server on the VM and with seamless mode with VirtualBox it would be easy to interact with. All calls to OpenGL would be forwarded to the server's graphics card.

SSH

OpenGL is only half of the issue to getting the VM going for OpenGL development. The other half is, I don't trust only keeping data within the VM. I'd feel much more comfortable if I had access to it within the host.
There is many different ways to get access to data between host and client.
  • Shared folders. Do I really need to say how unpredictable and horrible SAMBA is?
  • Mapping hard drive to VM drive. Tried this. Host's virtual drive service didn't like the idea of shrinking down one of my harddrives so I could allocate part of it to the VM.
  • Seperate Hard drive for VM (file) and mounting it. Ehh I can see locking and concurrent read/write issues.
  • SSH. Using server to store the data and mounting it within VM.
Now I went with SSH, however not quite how I had described it. There was one thing I had forgotten in the past completely. I have Cygwin installed. I use it every day on my host machine. I even use it for assignment marking. Its amazing. One of its packages it provides just so happens to be an SSH server. With a little of setting up, it'll run perfectly.

So a bit of AutoFS and SSHFS usage within the VM and now I have access to all my drives within the host machine and even my projects folder for convenience. Authentication is done via keys so its a non issue of passwords. Thomas Jansson helped with this considerably via his tutorial on SSH and auto mounting.

Summary

Personally I'm very excited at the prospect of being able to use a VM to do this development work. And having it so easy for me is just rediculas. Of course its not the only project I'm working on. I'm also working on Dakka, my actor framework alongside it.

No comments:

Post a Comment