Firstly I was getting the following error:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Fi
You can download the Jenkins xvnc plugin and make that plugin start(and export) a virtual display for selenium to use. The jenkins user may not have access to the :0 display.