A virtual display for ubuntu server
<p>My question is: is there a way to set up a virtual display as default display on a linux server (so that all GUI application launched will be displayed on that display, if no counter indication is made)?</p>
<p>I tried using this: <code>xvfb-run java -jar autoclick.jar</code>, which produces the following output :</p>
<pre><code>searching graphic devices
is Headless:false
screen N°1 width:1600 height:900
just 1 robot click:
Magic button clicked !
</code></pre>
<p>and here's the autoclick code :</p>
<pre><code>System.out.println(&quot;searching graphic devices&quot;);
System.out.println(&quot;is Headless:&quot;+GraphicsEnvironment.isHeadless());
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();

int count = 1;
for(GraphicsDevice screen : ge.getScreenDevices())
{
    System.out.println(&quot;screen N°&quot;+count+&quot; width:&quot;+screen.getDisplayMode().getWidth()
                                              +&quot; height:&quot;+screen.getDisplayMode().getHeight());
}
{... create a JFrame and add a JButton that closes the application and prints a message to the console when clicked}
System.out.println(&quot;just 1 robot click:&quot;);
try
{
    robot = new Robot();
    justOneClick(frame.getX()+100, frame.getY()+100);
}
catch(AWTException e)
{
    e.printStackTrace();
}
</code></pre>
<p>To make it short, here are my 2 problems:</p>
<blockquote>
<p>I still have to call xvfb-run every time i want to launch an application on the virtual display. Which means that applications that are not launched by me are not launched on the virtual display.</p>
<p>I can't launch another application on the display created by xvfb-run.</p>
</blockquote>
<p>Sorry for my bad English syntax, and thank you for your time.</p>