I want to access an Ubuntu machine remotely via VNC. But I can access the Ubuntu machine only if the user is logged in. I want to access the ubuntu machine via VNC from the login screen itself. We can access all windows machines from the login screen. However we were not able to access the Ubuntu machine from the login screen. There is some way but I am not aware of the details. Can someone give a solution to this problem?
Your best bet is to install xrdp . After installation, you can use an RDP client to connect to the machine - you will then be prompted for your credentials as you would be on the login screen.
To enable GDM login over a VNC ssh remote connection try with X11vnc. See also this answer.
Overall, I'd recommend
Enter your password, it's saved by default in
Save my helper script locally:
From your VNC Client host:
Or, from your VNC Server host, run :
Now run your VNC Client of choice from your Client Host, point it at:
Use the X11 "Magic Cookie"
Most X display managers (like GDM, XDM, KDM) start an initial X11 server and authenticate to it with an MIT Magic Cookie. Depending on your display manager, the magic cookie will be found in one of various locations.
I've had good luck getting a VNC session open on the Ubuntu GDM login screen by finding the magic cookie with this script:
I can start this script (I called it
Here's how to do it with VNC, if you don't want to use RDP:
That's it! You should now be able to connect with any VNC client even before login.