-
-
Save antop-dev/fc44e42aee7de1a917ff969412c0f6a4 to your computer and use it in GitHub Desktop.
Using Xvfb to create a headless display
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Demonstrates how to create a headless display using xvfb. | |
| # Create the display: | |
| Xvfb :100 -ac & | |
| PID1=$! | |
| export DISPLAY=:100.0 | |
| # Run the application that needs the display: | |
| xterm & | |
| PID2=$! | |
| # Kill the application: | |
| kill -9 $PID2 | |
| # Remove the display: | |
| kill -9 $PID1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment