You need Xvfb
, it creates a pseudo X Windows device. To install it on Ubuntu do this:
sudo apt-get install xvfb
Then create a pseudo X display putting it in background
Xvfb :100 &
Set the display to the pseudo X display:
export DISPLAY=:100
And launch Arduino.