I would like to know the difference between the following commands:
sudo x11vncsudo x11vnc -auth /var/lib/lightdm/.Xauthority -display :0
It is the same command so there is no difference.
If you meant: what do the options mean: the manual explains it like this:
Options
-display dispX11 server display to connect to, usually :0. The X server process must be running on same machine and support MIT-SHM. Equivalent to setting the DISPLAY environment variable to disp.
-auth fileSet the X authority file to be file, equivalent to setting the XAUTHORITY environment variable to file before startup. Same as
-xauth file. See xsecurity(7) , xauth(1) man pages for more info.
Related: