Sign in to follow this  
Followers 0
Krankles

OpenGL
Developing software using OpenGL on an OS in a VM?

15 posts in this topic

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.

0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

Edited by TheChubu
0

Share this post


Link to post
Share on other sites

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?

Edited by Promit
0

Share this post


Link to post
Share on other sites

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.

Edited by Krankles
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

Edited by Shannon Barber
0

Share this post


Link to post
Share on other sites

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.

 

Will I be able to develop OpenGL applications? Will it support higher versions of GLSL instead of Mesa's 1.20 GLSL version? Because this is the only reason I'm sort of forced to stop using VM's, to stop using Mesa and having to install a real graphics card driver.

0

Share this post


Link to post
Share on other sites
The only VM I have found that does OpenGL well is the Android Emulator (based on QEMU).
But even this has issues.

Hopefully one day we will have decent 3D passthrough but at the moment it is all very experimental and/or slow and buggy.

So this is one area where duel booting is still the best way for Linux and Windows dev.
0

Share this post


Link to post
Share on other sites

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.

Steam for Linux is out (albeit in beta), the problem is that it needs more games =P (although seems to be getting games at a faster pace than its Mac counterpart)

 

As for the actual topic: yeah, you won't get what you want with a virtual machine, the most you can get is VMWare and OpenGL 2 if I recall correctly (short of using a software renderer, which is what Mesa would do). Either dual boot or get a second computer and install Linux on it (in the latter case you could try to connect the computers so that somehow they can share the files without much problem, which would be probably much faster for debugging than dual boot - no idea what options are out there though).

0

Share this post


Link to post
Share on other sites
It may be possible to set up dual boot and run your windows install as a guest while you are booted into Linux. This is fairly simple with Mac OS X and parallels. I wonder if anyone has accomplished it with virtualbox Linux and windows.
0

Share this post


Link to post
Share on other sites

Your options are pretty much to install linux directly on the metal, or suck it up and develop on Windows.

 

I honestly recommend the latter - graphics driver support in Linux, while worlds better than it was a few years back, is still a rather sore point...

 

I wonder if anyone has accomplished it with virtualbox Linux and windows.


It's a pretty normal thing to do. We used this to access various Windows-centric network services at my previous employer.
0

Share this post


Link to post
Share on other sites

I honestly recommend the latter - graphics driver support in Linux, while worlds better than it was a few years back, is still a rather sore point...

At least with Nvidia hardware it's way more than bearable (provided you accept using the proprietary drivers), Optimus shenanigans aside (shouldn't be an issue otherwise). If you have other hardware you're pretty much screwed though (your mileage may vary in that case).

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0