Failed to start/connect to 'Firefox Headless', is the browser available/supported?

58 views
Skip to first unread message

chris perst

unread,
Aug 11, 2025, 9:05:37 AMAug 11
to ZAP User Group
Hi,

I have Ubuntu 24.04. with firefox and ZAP.
If I run ZAP > Tools > AJAX Spider: and "Starting Scan" I got the error message above.

# snap list firefox
Name     Version  Revision  Tracking         Herausgeber  Hinweise
firefox  141.0-2  6610      latest/stable/…  mozilla✓     -


# flatpak list
Name                                        Anwendungskennung                        Version                       Zweig           Installation
...
ZAP  
 

which firefox
/usr/bin/firefox

There is a link to: https://www.zaproxy.org/faq/no-browser/ in the message, with another link to:
https://github.com/mozilla/geckodriver/releases/tag/v0.32.0
There it is sait that this works:

% mkdir $HOME/tmp
% geckodriver --profile-root=~/tmp

OR
% TMPDIR=$HOME/tmp geckodriver

So I tried following, neither worked:
  • Options > Selenium > WebDrivers > geckodriver
    TMPDIR=$HOME/tmp /home/chris/.ZAP/webdriver/linux/64/geckodriver
  • Options > Selenium > WebDrivers > geckodriver: '/home/chris/.ZAP/webdriver/linux/64/geckodriver --profile-root=/home/chris/tmp'
  • TMPDIR=$HOME/tmp
    start ZAP from console
  • Options > Selenium > Firefox > binary: /usr/bin/firefox
  • in bash: geckodriver --profile-root=/home/chris/tmp
    then run zap
Any info what the solutions might be?

chris perst

unread,
Aug 11, 2025, 9:31:45 AMAug 11
to ZAP User Group
Another trial, maybe it works if a package from flathub uses another package from flathub?
Installed firefox via flathub. 
Didn't work either. 

chris perst

unread,
Aug 12, 2025, 1:59:10 AMAug 12
to ZAP User Group
Something strange here. 

I installed firefox via buid files from
Firefox starts and is working as far as I can see. This version is not the system version (which is installed via snap).

Now I entered the path from the new installed ff in options:
Options > Selenium > Binaries > Firefox binary: /home/chris/local-sw/firefox/firefox

If I run Tools > AJAX-Spider, there is the Browser stated: Firefox (also tried Firefox Headless), I get
Failed to start/connect to 'Firefox Headless', is the browser available/supported?

I guess ZAP from flatpak should recognize and have access to a binaries not instalaled via flatpak or snap and which are in the local path, should't it? Why do I get the error again? What am I missing here?

chris perst

unread,
Aug 13, 2025, 3:25:35 AMAug 13
to ZAP User Group
After some time of troubleshooting I decided:
My solution: do not use Flatpak or Snap for installing ZAP. Use the ZAP installer from their website. Everything works well with the browsers.

For curiosity: if someone knows how Flatpak works with Firefox (Flatpak or nativ install) please drop a note.

Simon Bennetts

unread,
Aug 15, 2025, 5:00:15 AMAug 15
to ZAP User Group
This is a general problem with tools like Flatpak.
Its specifically designed to isolate applications!

We have an open issue for it: #5824

Cheers,

Simon

Ivan Tomilov

unread,
Aug 15, 2025, 5:55:08 AMAug 15
to ZAP User Group
Oh, I accidentally posted it privately :D

Many thanks, Simon, for letting me know that!

Hi, Chris!

I've solved that problem for my friends and yes, if you use environment that isolate applications like snap or flatpak -- you'll have that exact issue with Zaproxy failing on starting ajax spider, or anything else in other application. Think of it as there's two apartments and people from one never see people from second one, if it's helping with abstraction

The solution here is to use system packages, not the sandboxed ones. In Ubuntu by default you don't have this kind of packages so you'll have to install them manually from .deb, or add repositories (for example for firefox), that you will use instead of default Ubuntu repos
Another solution is to switch to distribution that ships system packages, not flatpak or snap.

Also if you want to get deep I'd recommend to read about flatpak portals. For me it feels like it's just a bunch of "docker containers", that start once you start your app. Portals allow these to communicate with system and maybe with each other

chris perst

unread,
Aug 18, 2025, 7:50:43 AMAug 18
to ZAP User Group
Hi Ivan,

thanks, I almost guessed that this is the problem.

Would it make sense to add a remark on the download page > Officially Supported Repos > Flathub and Snapcraft? Which could run like: If you use Flathub and Snapcraft there is currently no easy way to get the browser up and loading a definite website. These affect calling the browser and the ajax spider.

Cheers, Chris
Reply all
Reply to author
Forward
0 new messages