[<< | Prev | Index | Next | >>]

Tuesday, August 23, 2011

Getting Google Talk (VOIP) to Work in Firefox on Ubuntu Lucid



Sorry, this is purely boring technical drivel which I am posting here simply so the search engines can find it and maybe help someone else with the same problem. (I've looked for a better place to post this in the forums but it's chaos out there I tell you...)

After months of not being able to run the Google Talk plugin in Firefox (but having it work fine in Chrome), I finally upgraded Firefox from 3.6 to 6 today. WOW, it's sooo much faster. But, alas, Google Talk still wasn't loading. From Gmail, I'd click on "Call Phone" and it would bring up the little box with "Please download the voice plugin ..." even though it was already installed (and working in chrome).

I decided there must be a way to get it working, so spent basically all day at it, and finally solved it, but not before encountering a dozen other causes of the same problem which weren't mine. So, this is just one of many things that can cause the problem, and may not fix it for you. But here goes:

The symptoms:

The google-talkplugin package is installed and works fine in chrome. In firefox (3.6 and 6 and probably anything inbetween), under Tools->Add Ons->Plugins, Google Talk simply isn't listed at all. What gives?

The search:

Oh, god, really you don't want to know. Suffice it to say it involved a lot of strace runs and sed scripts and diffs and I'm sure I re-earned a whole bevy of hacker badges today. And I tortured my friend Joe over skype with my head-scratching which is good because one of the key clues came from him when he mentioned something I'd never paid mind to before:

The problem:

Apparmor.

Ouch.

It's basically this bug here which claims to be fixed but isn't. It might be fixed in later releases, but isn't in my Lucid LTS release.

The solution:

Cribbing from the above link, I stuck:

  /opt/google/talkplugin/*.so mr,
  /opt/google/talkplugin/lib/*.so mr,
  /opt/google/talkplugin/GoogleTalkPlugin ixr,
  /usr/bin/lsb_release Ux,
  @{PROC}/[0-9]*/net/route r,
into /etc/apparmor.d/usr.bin.firefox and ran:
sudo apparmor_parser -r -T -W /etc/apparmor.d/usr.bin.firefox
to make it stick.

Then, crucially, you must remove ~/.mozilla/firefox/*/pluginreg.dat before restarting firefox, or firefox will just go on forever thinking the plugin is dead.

Hopefully I've got all the right keywords and phrases in this post so others with the same problem can find this post... Let me know if this proved helpful.


[Update 2011/8/24]

Here's a relatively quick test to see if this (or something similar, say due to SELinux) is your problem:

Quit firefox, remove the pluginreg.dat file, run (from a terminal window) "strace firefox >& strace.out", go to the tools->addons->plugins tab where you Should see google talk (which is necessary to make firefox try to load the plugin since it doesn't do it at launch), and then quit. Then grep (search) for libnpgoogletalk.so in strace.out and see what you get. This is what mine looks like when it fails:

> grep libnpgoogletalk.so strace.out
lstat64("/usr/lib/mozilla/plugins/libnpgoogletalk.so", {st_mode=S_IFLNK|0777, st_size=41, ...}) = 0
readlink("/usr/lib/mozilla/plugins/libnpgoogletalk.so", "/opt/google/talkplugin/libnpgoogletalk.so", 4095) = 41
lstat64("/opt/google/talkplugin/libnpgoogletalk.so", {st_mode=S_IFREG|0644, st_size=276364, ...}) = 0
stat64("/opt/google/talkplugin/libnpgoogletalk.so", {st_mode=S_IFREG|0644, st_size=276364, ...}) = 0
access("/opt/google/talkplugin/libnpgoogletalk.so", F_OK) = 0
open("/opt/google/talkplugin/libnpgoogletalk.so", O_RDONLY) = -1 EACCES (Permission denied) [Fail!]
open("/opt/google/talkplugin/libnpgoogletalk.so", O_RDONLY) = -1 EACCES (Permission denied)
write(2, "LoadPlugin: failed to initialize"..., 185LoadPlugin: failed to initialize shared library /opt/google/talkplugin/libnpgoogletalk.so [/opt/google/talkplugin/libnpgoogletalk.so: cannot open shared object file: Permission denied]

Which implies that firefox prints a nice error message explaining the problem! However, I never saw it, and I can't find that error in my /var/log/... files anywhere, so it's probably going to /dev/null for some reason. (If anybody knows how to run firefox w/stderr available, let me know.)

Anyway, after fixing the problem, the strace output looks like this:

> grep libnpgoogletalk.so strace.out
lstat64("/usr/lib/mozilla/plugins/libnpgoogletalk.so", {st_mode=S_IFLNK|0777, st_size=41, ...}) = 0
readlink("/usr/lib/mozilla/plugins/libnpgoogletalk.so", "/opt/google/talkplugin/libnpgoogletalk.so", 4095) = 41
lstat64("/opt/google/talkplugin/libnpgoogletalk.so", {st_mode=S_IFREG|0644, st_size=276364, ...}) = 0
stat64("/opt/google/talkplugin/libnpgoogletalk.so", {st_mode=S_IFREG|0644, st_size=276364, ...}) = 0
access("/opt/google/talkplugin/libnpgoogletalk.so", F_OK) = 0
open("/opt/google/talkplugin/libnpgoogletalk.so", O_RDONLY) = 82 [Good!]
write(86, "libnpgoogletalk.so:$\n/opt/google"..., 68) = 68
stat64("/opt/google/talkplugin/libnpgoogletalk.so", {st_mode=S_IFREG|0644, st_size=276364, ...}) = 0
stat64("/opt/google/talkplugin/libnpgoogletalk.so", {st_mode=S_IFREG|0644, st_size=276364, ...}) = 0


[<< | Prev | Index | Next | >>]


Simon Funk / simonfunk@gmail.com