title: Selenium Firefox Python running in headless mode Timeout on initializing driver
body: <ul>
  <li>Firefox version: 60.9.0esr (32-bit)</li>
  <li>Selenium version: 3.141.0</li>
  <li>Geckodriver version: 0.24.0 (32-bit)</li>
  </ul>
  
  <p>So everything currently works in non-headless mode. But I need to run this python script in a GUI-less linux server (thus need headless mode). For some reason, all my attempts to run headlessly results in selenium web driver timing out on initialization. </p>
  
  <pre><code>        from selenium import webdriver
  
          geckoDriverFilepath = path + "geckodriver24_32.exe"
  
          opts = webdriver.FirefoxOptions()
          opts.add_argument("--headless")
          opts.add_argument("--width=2560")
          opts.add_argument("--height=1440")
  
          #initialize driver (breaks/timeouts here)
          driver = webdriver.Firefox(options=opts,executable_path=geckoDriverFilepath)
  </code></pre>
  
  <p>The following is the Traceback:</p>
  
  <blockquote>
    <p>File "c:\Users\xUser\Desktop\BOMWebService\Backend\code\FirefoxStarter.py", line 51, in StartFirefox
        driver = webdriver.Firefox(options=opts,executable_path=geckoDriverFilepath)</p>
    
    <p>File "C:\Users\xUser\Desktop\BOMWebService\Backend\virEnvBOMBackend\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 174, in <strong>init</strong>
        keep_alive=True)</p>
    
    <p>File "C:\Users\xUser\Desktop\BOMWebService\Backend\virEnvBOMBackend\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in <strong>init</strong>
        self.start_session(capabilities, browser_profile)</p>
    
    <p>File "C:\Users\xUser\Desktop\BOMWebService\Backend\virEnvBOMBackend\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
        response = self.execute(Command.NEW_SESSION, parameters)</p>
    
    <p>File "C:\Users\xUser\Desktop\BOMWebService\Backend\virEnvBOMBackend\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
        self.error_handler.check_response(response)</p>
    
    <p>File "C:\Users\xUser\Desktop\BOMWebService\Backend\virEnvBOMBackend\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
        raise exception_class(message, screen, stacktrace)</p>
    
    <p>selenium.common.exceptions.WebDriverException: Message: timed out</p>
  </blockquote>
  
  <p>Any pointers would be much appreciated. Thanks!</p>