If you are accessing over VNC you need to run the command above in order to provide your remote access authority to view graphical items from the command line.
Using the command line listed above –
sudo cp ~pi/.Xauthority ~root/
ensures that using VNC when accessing the Raspberry Pi you can run graphical programs from the command line – this does not mean a separate SSH connection but from the command line accessed by double clicking on LX Terminal.