Linux – Bind Xvfb on localhost rather than *

linuxportx11

I am using Xvfb to run an a wine background application that needs a valid display.
It appears that it binds to *:x11.
For security reasons I would like to avoid opening any unnecessary ports.

Is there any way force Xvfb to bind to localhost rather than *?

Best Answer

Actually, if I understand your need correctly you can just skip TCP altogether.

Xvfb :0 -nolisten tcp

Afterwards this works:

DISPLAY=:0
xterm

And you can check yourself with netstat -ntlp | grep Xvfb that Xvfb has no ports open.