I have a something like:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
class Gecko {
...
FirefoxBinary ffB = new FirefoxBinary();
ffB.setEnvironmentProperty("DISPLAY", ":10");
...
options.setBinary(ffB);
WebDriver driver = new FirefoxDriver(options);
Then I start a virtual frame buffer with:
Xvfb :10 -screen 0 1024x768x24 &
But when I run with Selenium:
java -cp .:selenium-server-standalone-3.5.0.jar Gecko
the following problem shows:
1508364524466 geckodriver::marionette INFO Starting browser /usr/bin/firefox with args ["-marionette"]
Error: GDK_BACKEND does not match available displays
Exception in thread "main" org.openqa.selenium.WebDriverException: connection refused
Which could be a possible cause? User permission? Firewall? The current box doesn't have any desktop environment installed.