Solution:
In terminal, run gedit ~/.local/share/applications/mimeapps.list
. In the text document that opens, add the line application/octet-stream=gvbam.desktop;
underneath "[Added Associates]", which should be at the top. This should force .gbc files, which Ubuntu recognizes as octet-streams, to open using VBA-M.
You will also have to tell VBA-M to load a rom upon launching by using the following steps:
- In terminal, run
gksudo gedit /usr/share/applications/gvbam.desktop
- In the file that opens, replace
Exec=gvbam
with Exec=gvbam %U
Following this, you will need to run sudo update-desktop-database
in terminal to "apply" the edits.
When you click "Open with other application..." in the right-click menu, and click "Show other applications", VBA-M should now be in the list, and the game should open correctly.
If file is not recognized as a GameBoy Color Rom or isn't opening, rename the extension. For example, if the extension is ".gbc" (i.e. GameBoy Color), renaming it to ".gb" (i.e. GameBoy) should make it recognized as a GameBoy Rom.
How I came to my conclusion
In terminal, run gksudo gedit /usr/share/applications/gvbam.desktop
. In the "Exec=gvbam" line, add %U
afterwards. So in the end, it should the whole line should be Exec=gvbam %U
.
While this did add VBA-M to the "Other Applications" list, (and thus allow me to set VBA-M as the default program for .gbc's) the game doesn't actually run; in fact, the VBA-M window completely fails to show up anywhere. I think that this is because of how VBA-M currently works; in a terminal, I ran gvbam "Pokemon Gold.gbc"
, and it threw the following error:
The program 'gvbam' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
(Details: serial 474 error_code 11 request_code 154 minor_code 3)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
To further test this, I downloaded another rom, and I chose The Legend of Zelda: A Link to the Past. Having already done the above instructions to add VBA-M to the application list, I chose it as default for the Zelda game, which was a .gba file; the game loaded fine. I noticed in the properties of the files, the .gbc's type was unknown (application/octet-stream)
, while the .gba's type was Game Boy Advance ROM (application/x-gba-rom)
; obviously, something else was missing in the association of GameBoy Color roms, which wasn't missing with GameBoy Advance roms.
I tried adding gbc
as an associated filetype with application/octet-stream
, and that seemed to fix the issue of the .gbc file not opening. However, I then removed it, and tried opening the .gbc again, and it still worked; I'm not sure what I did, but now it works.
Original Answer
This got an upvote, so since someone thought this was good, I'm leaving it here for anyone else who cares. That being said, the information above is probably more relevant to the question.
To start out, you must be sure that the MIME type for your file extension does not already exist. Open a terminal and enter:
grep 'gbc' /etc/mime.types
If there was no output, or the output given did not include your extension, you must add a MIME type.
In a terminal, open the mime.types file by running gksudo gedit /etc/mime.types
. In this file, add the following line to the "application" section:
application/gbc gbc
There should be additional spaces between the two gbc's - just make sure to line the second gbc up with the other extensions. I would show, but I'm not sure how to do this on askubuntu.
Sources:
/usr/bin/vbam
into it? If you check "Use as default for this kind of file", it should set it as default. – ananaso Jan 10 '13 at 04:48/usr/share/applications
, there should be a bunch of icons for applications, such as firefox, libreoffice, etc. Is there a "vbam" file? – ananaso Jan 11 '13 at 03:45gksu gedit /usr/share/applications/defaults.list
, and add the lineapplication/gbc=vba-m.desktop
. If that doesn't work, try adding variations of that line instead, likeapplication/gbc=vbam.desktop
,application/gbc=gvbam.desktop
,application/x-gbc=vba-m.desktop
, etc. – ananaso Jan 15 '13 at 02:49/usr/share/applications/defaults.list
,application/gbc=gvbam.desktop
already existed. – Josh Jan 17 '13 at 05:16gvbam
as default for .gba and .gb files using Ubuntu Tweak, but for some reason .gbc files were not on the list. Does this information help? Another small thing that I noticed was that the .gbc file in question has a little lock icon on it. As a temporary fix, I changed the extension from .gbc to .gb and it works. – Josh Jan 29 '13 at 02:10octet-stream
, which is what .gbc is identified as. After looking here and here, I changed something - the gvbam.desktop should beExec=gvbam %U
, notExec=gvbam %f
. Also, I updated the answer for a second attempt; try that. – ananaso Jan 31 '13 at 23:09