I have tried using XVFB to run chrome headless on CentOs server, though I now have to update my code to do that, do we know if we can fire XVFB using Java code and make sure that the WebDriver is able to interact with it?
Edit: the example from the documentation
ChromeDriverService service = new ChromeDriverService.Builder()
.usingAnyFreePort()
.withEnvironment(ImmutableMap.of("DISPLAY", display))
.build();
return new ChromeDriver(service);