Hello again r9aze,
You have not said what version of Ubuntu you are running on the machine. Try executing lsb_release -a in a terminal. I suspect it is 14.something or 15.something. I have been looking into this and it is looking very familiar to me when I was trying to access a 14.04 machine - the problem and lack of solutions
Here is a possible plan B.
Install x11vnc
Code:
sudo apt-get update
sudo apt-get install x11vnc
There are a couple of fundamental differences between vncserver and x11vnc to my mind. With vncserver I can connect to a machine and run my graphical session independent of the session which is running on the physical console (monitor & keyboard attached to the machine). What I do does not show if someone is looking at the monitor. I think that is very cool - almost like a "real" computer (mainframe). vncserver CAN be configured to access the console session but I do not remember how and have not done so for many years due to some issues which I vaguely recall.
x11vnc will allow you to connect to the main console session when run as I will describe. It can also connect to a running vncserver session and many other things but that is beyond the scope of what you are trying to do I think.
In order to access the main console session with x11vnc on one of my machines I access the machine with ssh and in the terminal issue the command
Code:
sudo x11vnc -auth /var/run/lightdm/root/:0
It is necessary to run this with root (administrator) permissions because no one is logged into the main console to start with - or someone else may be logged in in which case a sightseer should not be able to access their session. Connect to the session as servername:0 with your viewing software.
A couple of notes/cautions:
Make sure you do not have a vncserver session running - x11vnc may try to access it - not what you want.
The ssh terminal is tied up for the entire time you are accessing the x11vnc session. This can be changed by altering the command used to start x11vnc but it has some risks. I think it is better to close x11vnc session when you are done.
Remember to logout from within the x11vnc session. If you are the only one accessing this system fine but if others could access it or there is a physical monitor/keyboard connected... it is just like walking away from your PC when logged in. You can of course lock the x11vnc screen. x11vnc is just like being there.
There is a LOT of information on the x11vnc site at
http://www.karlrunge.com/x11vnc/index.html
Have a try at x11vnc and let us know how it works for you. I am running Ubuntu-Mate on most of my machines now and it works with vncserver and x11vnc. If you are interested in Mate (looks like the older gnome2 desktop) let me know. I have xstartup files which do work.
Good luck,
Ken