Getting X to work through tunneled VNC over SSH connection
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Getting X to work through tunneled VNC over SSH connection
Hello,
I finally got my old laptop running as a server after much soldering (the power cord snapped during install) and time messing with grub to boot kubuntu.
I'm trying to create a connection through VNC running over SSH, however, I want to be able to create a connection that uses X on the local computer that I will be sshing (verb???) from.
When I sign in through shh, I see this:
/usr/bin/X11/xauth: /home/merlin/.Xauthority not writeable, changes will be
ignored
However, I keep getting this error when I try the command startx:
xauth: creating new authority file /home/merlin/.serverauth.6299
xauth: error in locking authority file /home/merlin/.Xauthority
xauth: error in locking authority file /home/merlin/.Xauthority
xauth: error in locking authority file /home/merlin/.Xauthority
xauth: error in locking authority file /home/merlin/.Xauthority
X: user not authorized to run the X server, aborting.
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
giving up.
xinit: unable to connect to X server
xinit: No such process (errno 3): unexpected signal 2.
xauth: error in lcoking authority file /home/merlin/.Xauthority
Couldnt get a file descriptor referring to the console
I tried 'sudo xauth -b quit' because I found on one link from google that this may remove the Xauthority locks, however, I don't believe it does.
When I try 'startx' after that command I get:
xauth: creating new authority file /home/merlin/.serverauth.6404
xauth: error in locking authority file /home/merlin/.Xauthority
xauth: error in locking authority file /home/merlin/.Xauthority
xauth: error in locking authority file /home/merlin/.Xauthority
xauth: error in locking authority file /home/merlin/.Xauthority
X: user not authorized to run the X server, aborting.
xinit: Server Error
xauth: error in locking authority file /home/merlin/.Xauthority
Couldnt get a file descriptor referring to the console
Any help on the subject would be greatly appreciated!
Oh, right, one more thing, I'm starting the connection from a windows computer (school, home, etc) on putty, X11 forwarding is enabled.
Oh, right, one more thing, I'm starting the connection from a windows computer (school, home, etc) on putty, X11 forwarding is enabled.
Do you have an X environment installed on the Windows computer? You need something like Cygwin for X forwarding to a Windows computer to work. Windows itself simply doesn't understand X. If you use VNC instead, you'll need just a VNC client on the Windows machine.
As for the Xauthority file, who owns it and what are the permissions?
I actually changed the ownership of Xauthority. I don't know if I should have... I followed a link from a google search; with chown, I changed the ownership from root, to user. Still didn't seem to fix anything.
I've tried xhost +
Here's the error I received from it:
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
xhost: unable to open display "localhost:10.0"
Actually my error messages have been varying since I've started using different commands to hopefully get it to work, sometimes the "wrong authentication protocol attempted" doesn't appear. Sometimes when I use MIT-Magic-Cookie-1 the error does not appear, however, it always seems to appear when I use XDM-Authorization-1.
I'll try using an x-environment on windows, I actually never thought about an error in windows trying to receive X.
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
xhost: unable to open display "localhost:10.0"
In X, the "server" is the computer actually responsible for performing the display functions. When you're forwarding X, that means that the local machine (in your case the Windows box) is the X server. And since Windows doesn't understand X, until you get an X environment installed, you are going to continue to get these errors.
Now VNC works differently. In essence, it is sending a snapshot of the remote X desktop to a local VNC client. As long as the local end has a VNC client, it doesn't need X installed. And on the remote end, the VNC server has its own X server it uses to create a desktop (at least I think it does).
So keep in mind that X forwarding and VNC are two very, very different beasties with different requirements on the local end. About the only thing they have in common is that you can run both through an SSH tunnel.
In X, the "server" is the computer actually responsible for performing the display functions. When you're forwarding X, that means that the local machine (in your case the Windows box) is the X server. And since Windows doesn't understand X, until you get an X environment installed, you are going to continue to get these errors.
Now VNC works differently. In essence, it is sending a snapshot of the remote X desktop to a local VNC client. As long as the local end has a VNC client, it doesn't need X installed. And on the remote end, the VNC server has its own X server it uses to create a desktop (at least I think it does).
So keep in mind that X forwarding and VNC are two very, very different beasties with different requirements on the local end. About the only thing they have in common is that you can run both through an SSH tunnel.
As Hangdog42 mentioned, if you want to view linux screen from Windows, the easier way is use vnc.
Simple way is install vncserver in Linux computer, start it, then run following command:- vncserver :1 (it probably ask you to input password)
Install any vncsoftware at windows PC (example tightvnc), then open a session to linux-ip-address:1
It should ask you to input password.
To further secure the traffic, the better way is do a ssh tunneling.
If you insist want to use X environment in Windows, you need to purchase it (If I'm not mistaken it is commercial).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.