Developing software using OpenGL on an OS in a VM?

Started by
14 comments, last by Sik_the_hedgehog 11 years, 2 months ago

Hi, I'm trying to learn OpenGL 3 and 4, and I ran into a problem, I can't use the latest GLSL and OpenGL. Reason for this is because I don't have my graphics drivers installed on my system, which is Arch Linux. However, it's because running in a VM (VirtualBox, in my case), you can't install graphics drivers. The host OS is Windows 7 and the Guest OS is Arch Linux. So what I've done is install the latest Mesa 3D, which is Mesa 9.0.2.

I've made a thread about a problem not being able to draw a simple triangle in Linux. http://www.gamedev.net/topic/638573-opengl-cant-draw-a-triangle-no-error-either/ Although fixed now, the solution wasn't really what I wanted, I want to use the recent and better version of GLSL and OpenGL, instead of the old 1.20 GLSL. The vertex shader and fragment shader files had to be changed and for some odd reason I couldn't use the code "glEnableVertexAttribArray" and "glVertexAttribPointer". I had to use "glEnableClientState" and "glVertexPointer", which are for fixed function pipeline, which I didn't want to learn. I want to learn the programmable function pipeline.

So basically, what I'm asking is, is it possible to continue developing opengl applications in a VM? If so, how? (Since Mesa only supports the OpenGL 3.1 specification, as shown here http://mesa3d.org/faq.html) Or would I really have to install Arch Linux onto my hard drive with dual boot and install my graphic drivers?

Thanks.

Advertisement
Personally I would just install your dev environment on the bare metal and call it a day.

I use virtualbox daily but it does lag behind Parallels and maybe even VMware in its hardware graphics support.

Yeah, I was afraid of that, oh well, virtualbox was sort of slow too :P When I tested out my pong clone, it ran a bit slow/sluggish, whereas if I compiled and ran it on windows, it would run smoothly. (Even though both of it was capped at 60 fps)

Anyways, thanks for the input, I guess I'll just install Arch Linux on my hard drive and do the dual boot.

Did you have installed virtualbox guest additions in VM? Guest additions improve performance of VM significantly. Also it provides proper 3D acceleration to guest OS: http://www.virtualbox.org/manual/ch04.html#guestadd-3d

Yeah, I had guest additions installed. Unfortunately, that's all I can do though, I can't really install any graphics drivers. My rig isn't even horrible either, CPU is i7-2700k @ 3.50GHz (4 cores 8 threads), 16 GB of RAM, and NVIDIA GeForce GTX 680. Gave the guest 4 GB and 2 cores.

It's fine though, I'll just do the dual boot. Unless someone knows a way to somehow develop opengl applications in a VM.

I'd try with VMWare Player.

As far as I know, they have better support for graphics than VirtualBox and VMWare collaborates with Mesa developers themselves. You won't get more than OpenGL 3 out of mesa (software emulation), and I think VMWare video driver supports (accelerated) OpenGL 2.1 only.

Though it may be better just to install Arch and be done with it.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

Hilariously enough, the VMs that accelerate 3D usually accelerate D3D but not OGL for Windows. Why are you running the virtualized setup in the first place?

SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

Hilariously enough, the VMs that accelerate 3D usually accelerate D3D but not OGL for Windows. Why are you running the virtualized setup in the first place?

For the ease of use, so that I can run Windows and Linux at the same time, and that I don't have to restart my computer. I can just turn on the VM instantly AND I can chat to some friends since I play games on Windows on Steam. Going to OGL, I'm forced to develop on Windows (which I loathe doing) or I do the dual boot, have to restart my computer and lose the ability to talk to friends on Steam at the same time. (I usually leave the VM in the background too so I can quickly do programming or play games) Or I could buy and build my own computer again (or just one from a shop) and install it on there, but again, not willing to dish out some cash just for this.

However, once Steam on Linux comes out I'd be happy to switch completely from Windows to Linux. But in the mean time, I have to stay with Windows.

That is one thing that I look forward in future computers. To make switching OSes less annoying, ie, make getting into the boot menu faster and simpler.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

Switch to VMWare/VMPlayer if you want accelerated graphics in a VM.

You can download a trial for free, setup your VM, then switch to the player after 30 days and keep using it.

- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

This topic is closed to new replies.

Advertisement