Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I managed to get as far as optirun glxgear, which worked perfectly, but I am unable to define settings for a specific shell script.

In its wiki it says this:

optirun [options] <application> [application-parameters]

and I don't know what option has to be nor the application-parameter. (I'm really new) If my file is /home/hon/, how can I execute it via terminal?

If I just type optirun hon or optirun it shows this error:

/usr/bin/vglrun: 296: exec: hon: not found

there I try to find the file /usr/bin/vglrun. How can I run the shell scripts I need to run?

share|improve this question

Try with

optirun sh your_sh_file

Please note bumblebee uses nvdia card through virtualgl and the performance is very poor.

Possibly the command won't run your game in nvdia mode. Because the the sh file is calling someother application. I think it would be better if you take a backup of sh file, then edit it to include optirun inside the sh file

share|improve this answer
how could i do that? specifically? – Min Aug 21 '12 at 6:32
what site would be a good help (specific topic) or how would I do it directly? – Min Aug 21 '12 at 6:32
Open up the sh file in gedit. Identify where it is calling the application and put optirun over there. Or edit your question with content of the sh file – Web-E Aug 21 '12 at 6:55

On my system, xyz is program that doesn't exist.

$ optirun xyz
/usr/bin/vglrun: 296: exec: xyz: not found

So verify that the program exists where it's supposed to be

ls -l /home/hon/
optirun /home/hon/
share|improve this answer

This worked for me:

optirun sh ./PART TO .sh FILE/

Example to run Android-studio:

optirun sh /opt/android-studio/bin/
share|improve this answer

Is the sh file exectable? if not then make it

chmod u+x 

If that doesn't help:

optirun bash
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.