0

I am running a groovy script for my job on Jenkins and the xvfb call is

$ Xvfb :0 -screen 0 1024x768x24

This however fails claiming that an X server is already running. However if I run the command Xvfb -screen 0 1024x768x24 :99 (I've declared 99 as DISPLAY on the machine) it's successful.

How can I get the pipeline to add this argument? I am currently using a wrap class like wrap([$class: 'Xvfb']) in groovy so I'm assuming I'd add some arguments here, I am just not sure which ones.

update: So I've tried wrap([$class: 'Xvfb', additionalOptions: ':99']) but on jenkins it still shows it running as Xvfb :0 -screen 0 1024x768x24. I would change the Xvfb settings on jenkins but this is a test job and not a build one so I need to change this from the script itself.

Witcher18
  • 59
  • 5
  • I bet you have to use `additionalOptions` parameter. https://www.jenkins.io/doc/pipeline/steps/xvfb/ – daggett Oct 27 '21 at 12:18
  • I tried doing this but, the command stayed the same as Xvfb -screen 0 1024x768x24. I'd assume that I could set the settings in Jenkins itself for xvfb but I can't even see the xvfb settings in global tool config or anywhere else. – Witcher18 Oct 27 '21 at 14:38
  • i suggest you to edit question, specify what exactly you have tried and what result do you see. – daggett Oct 27 '21 at 17:03
  • Updated the question – Witcher18 Oct 27 '21 at 18:11

0 Answers0