How to setup a headless application in Linux?

I am a newbie to Linux environment and do not know every commands available inside the shell.

This entry will explain and demonstrate to all newbies out there and to those who have not know to setup a headless application in Linux and for those who want to setup headless application in Linux.

Install the following in your Linux distro if you have not install them yet.
1. Xvfb
2. startx
3. import from ImageMagick Tools

Let’s try to run Firefox without a visible display.
1. Start Xvfb.
startx -- `which Xvfb` :1 -screen 0 1024x768x24
2. start Xvfb running on :1 with a screen size of 1024×768 and 24bits/pixel color depth.
DISPLAY=:1 firefox
3. Take a screenshot.
DISPLAY=:1 import -window root firefox.png
Thank you to Jordan Sissel for his blog regarding this problem.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s