How do I get HDMI out working with Bumblebee?

I had (and solved) a similar problem.

I've just installed fresh Ubuntu 12.04 with bumblebee 3.0 and when i try to test it using for example "optirun firefox" i get a blank screen with only the mouse cursor.

When I switch to another console (Alt+Ctrl+F6 for example) and coming back to the regular console (Alt+Ctrl+F7) I see that the firefox window has been opened.

I did

sudo apt-get purge bumblebee
sudo apt-get purge nvidia-current

and then installed the bumblebee again

sudo apt-get install bumblebee

and it started working properly.