0

I heard of this technology called Xvfb, which is used to create virtual X sessions. The command to do this is Xvfb :1, or replace :1 with any display you like. My question is: how can I do this within a C program? I am aware of the system() function, but this is usually bad practice, and only works if a client has Xvfb installed. Is there another way to do this?

Ank i zle
  • 2,089
  • 3
  • 14
  • 36
  • Does this answer your question? [How do I execute an external program within C code in Linux with arguments?](https://stackoverflow.com/questions/5237482/how-do-i-execute-an-external-program-within-c-code-in-linux-with-arguments) – Robert Harvey Mar 19 '22 at 14:56
  • `...and only works if a client has Xvfb installed.` -- **And running.** I don't see how that happens without running the Xvfb executable. The Internet says that `system()` is a bad practice because it is insecure, but it also says "favor an API if you have one." Which you don't have, if Xvfb isn't running. – Robert Harvey Mar 19 '22 at 15:03

0 Answers0