# Automating Headless Firefox with XVFB in Jails without login



## DiscmanDaemon (Dec 5, 2017)

Hello all, 
I am trying to make use of the jails to run instances of a selenium/firefox app. To make Firefox run "headlessly", I am using XVFB (yes I do know that PhantomJS exists. This is testing a Firefox extension, so it really needs to be firefox) Currently, it works fine if I manually log in to the jail and start the app, with XVFB starting in the .cshrc. 

However, I am trying to automate this system in such a way that the app runs as soon as the jail finishes its init processes on starting, so I do not have to script anything from the host. I have tried starting XVFB from rc.local, but this doesn't seem to work (the app still complains firefox can't start because theres no window). I have also tried utilizing the @reboot on cron, but this was not successful either. 

Any suggestions would be most appreciated,

Thanks!


----------



## oops (Dec 6, 2017)

Have you tried headless mode supported by Firefox since 55.0? It doesn't require Xvfb.


----------



## DiscmanDaemon (Dec 6, 2017)

This solution is MUCH cleaner than Xvfb. I didn't realize Firefox had added headless mode. Thanks!


----------

