I am trying to login to root as sudo user and launch the command “xclock” , I am getting the error message as “X11 Error while trying to launch the x-windows from your putty session.”
[a] You have done an su or a sudo to a switch user, without copying the correct MIT-MAGIC-COOKIE authentication.
[b] You should list these cookies by entering the following, under the account you used to login:
STEP  :
Login as the normal user to the below information:
Now, we need to add the MIT-MAGIC-COOKIE’s into the root account to enable the xclock. Therefore, as the user (in this case, root) trying to run the X11 application, add the cookies manually.
Now Login as sudo to root and then execute the command “xclock” and you should be able to launch the x windows successfully.
Make sure you have enabled the X11forwarding in /etc/ssh/sshd_config file
enable the X11 option in putty session.
Install and launch the Xming or VcXsrv tool if you are using the windows machine.