close
» » Remote desktop via VNC from Windows to Linux Mint

Remote desktop via VNC from Windows to Linux Mint

Tools
Remote desktop via VNC from Windows to Linux MintRemote desktop via VNC from Windows to Linux Mint
Almost all the articles that are in the Internet says about configuring VNC how about connecting to a new session. It does not suit me. I need to connect to my home PC that runs under Linux, and gives the torrents and all that. I don't need to create a new session, but need to get proper access to the current session.
First of all I will say is that this method allows to gain remote access not only from Windows but also from any Operating system, to work with your Linux Mint from everywhere.
At least kill me, but I never got to connect to my computer Linux Mint using a standard VNC server "Vino". Given access but to connect failed. In addition nowhere could I find information about this.
In this regard, i will describe installation of third-party x11vnc server.
More importantly, access can be obtained when only works GMD i.e. the user is not logged in. Once it becomes clear that vino (part of Gnome) not suitable for this. The aid comes x11vnc. It pulls vnc4server but it's logical.
So the task:
to provide access to the machine via VNC even if the user is not logged in. To use only one session.
Solution:

1. Remove vino (to avoid problems with the occupation of the port and the like)
sudo apt-get -y remove vino
2. Install x11vnc
sudo apt-get -y install x11vnc

3. Make the password to access VNC. Here we must be very careful here's why.

By default, VNC doesn't use shh tunnel therefore information

is not encrypted, because if the machine you are very important

and critical need of googling on the subject forward VNC and its ports through an SSH tunnel.

x11vnc -storepasswd
The password is stored in the /home/YOUR USER NAME/.vnc/passwd (where YOUR username is the user name under which you executed the command). It is important to execute this command is not under sudo otherwise there would be problems with access rights for login. 
4. The startup service x11vnc. It is very important (to me) that the service was already available at boot X i.e. the user is not logged into the system, but access to the machine already has. To do this, need to have access at the level of GDM.
In some systems use a different welcome screen, not gdm3 therefore this directory is not. For example: Linux Mint 17/16/15/14/13 (MATE) uses MDM. Edit the file /etc/mdm/Init/Default (don't forget to run it as root or sudo otherwise not save the changes):
for mate 
sudo pluma /etc/mdm/Init/Default
sudo gedit /etc/mdm/Init/Default
Add to the end of the file before exit 0 the following line:
/usr/bin/x11vnc -dontdisconnect -notruecolor -noxfixes -shared -forever -rfbport 5900 -bg -o /var/log/x11vnc.log -rfbauth /home/YOUR USER NAME/.vnc/passwd

Remote desktop via VNC from Windows to Linux MintRemote desktop via VNC from Windows to Linux Mint

From the key parameters should pay attention to the following:
-dontdisconnect - do not disconnect when idle time, which is important if turned sessions window
-forever is a very important parameter. Without it x11vnc after the session is closed off and more you will not go until ssh again not run it, that is not convenient.
-rfbport - specify on which port will work our VNC (I pointed 5900)
More detailed settings, you can look in the manual x11vnc:
man x11vnc
5. Additionally are dropping (disconnecting from vnc) when you login in to your account on the computer screen via VNC. I did that because on my home computer to multiple accounts. The solution suggested by our reader BENAHLQUIST. It works.
Open the config mdm
for mate 
sudo pluma /etc/mdm/mdm.conf
for cinnamon
sudo gedit /etc/mdm/mdm.conf
Under the [daemon] section, add this line:
KillInitClients=false

Remote desktop via VNC from Windows to Linux MintRemote desktop via VNC from Windows to Linux Mint

Next, save all files and restart the machine.
Then run any VNC client on a foreign computer, such as TightVNC or UltraVNC. Enter your computer's IP and port.

Remote desktop via VNC from Windows to Linux Mint

Remote desktop via VNC from Windows to Linux Mint

If your computer is behind a NAT forward ports in your router. Enjoy!

Remote desktop via VNC from Windows to Linux MintRemote desktop via VNC from Windows to Linux Mint

Good Luck!!!
 

Print version

Edited by: Shekin - 3-10-2016, 21:18
Reason: fixed some inaccuracies

This article helped you?
Yes - 3 (60%)
60%
No - 1 (20%)
20%
Not fully - 1 (20%)
20%
Total votes: 5

Add comments

  • Local comments
  • Facebook comments
merlinpatt
merlinpatt 21 April 2015 01:49
Thank you! This worked for me. If anyone's looking to do this not on their home network, be sure to forward the port on your router
  • +2
benahlquist
benahlquist 8 May 2015 19:11
Thanks for the super helpful tutorial!

I did have something you could add however; as your steps result in a problem with the VNC connection dropping when a user logs in.

For Cinnamon (I'm using this - confirmed working)

sudo gedit /etc/mdm/mdm.conf


(For GDM, I believe this would be /etc/gdm/gdm.conf)

Under the [daemon] section, add this line:

KillInitClients=false
  • +5
Alex
Alex 1 September 2015 17:58
Vino advertises security type 18 which apparently is TLS and according to a user on a mailing list this is widely unsupported by most Windows VNC viewers.

An easy way to solve this is by disabling the encryption alltogether by doing:

gsettings set org.gnome.Vino require-encryption false
  • +3
willichan
willichan 4 March 2016 19:03
Finally! After trying all the different solutions, including several that broke the desktop, this solution worked!

The only gotcha I encountered was with the login screen. With the password file stored under my profile, I had to be logged in as myself on the Mint station first before the password would be accepted on the remote station.

By logging in as root, and generating the password file in /root/.vnc/passwd (and, of course, updating that path in the /etc/mdm/Init/Default file) I can then access the login screen remotely when no user is logged into the Mint station.
  • +1
Tray
Tray 31 May 2016 04:04
Thank you! This worked for me. Your awesome. This of course was the last thing I tried to make it work and it finally worked as expected! The only thing I did notice is that after I was done I had to remove firefox and then reinstall using the Software Manager, otherwise firefox never launched when I clicked on it. Might be related to removing Vino, but firefox works fine after a reinstall.
  • +1
Ghozi Nashrullah Habibi
Ghozi Nashrullah Habibi 21 June 2016 09:17
Big thanks to you brooo!!
It's really worked for me!!
  • +1
Shekin 3 October 2016 20:23
thx.
--------------------
x64 Linux Mint 18.2 cinnamon
  • 0
Ken
Ken 10 February 2017 21:49
Worked on Mint 17.3 32bit
  • 0
arie
arie 16 February 2017 12:23
Just what I needed. Under Linux Mint 18.1 there is no gedit, so I had to use nano.
Works like a charm.
Thanks.
  • 0
John Fernandez 3 March 2017 00:10
I have a problem
When I enter this command "sudo gedit /etc/mdm/Init/Default"
This shows up "(gedit:1769): Gtk-WARNING **: cannot open display:"
Any help please
Linux Mint 18
  • 0
Shekin 3 March 2017 08:54
John Fernandez,
sudo xed /etc/mdm/Init/Default
--------------------
x64 Linux Mint 18.2 cinnamon
  • 0
ronald
ronald 25 May 2017 23:22
Hello configure in mint 18.1 KDE ??
  • 0
Shantanu
Shantanu 28 May 2017 07:56
Hi,
Thanks for the help. I a novice in Linux admin. I have mint18.1. I did what was you told me but after roboot, i cannot get the login screen. Its stuck on trying to get the login screen. What do i do. ANy help will be appreciated.

Resolved (a spelling mistake). Thanks a lot. Is there a way to run vnc over SSH
  • 0
  • bowtiesmilelaughingblushsmileyrelaxedsmirk
    heart_eyeskissing_heartkissing_closed_eyesflushedrelievedsatisfiedgrin
    winkstuck_out_tongue_winking_eyestuck_out_tongue_closed_eyesgrinningkissingstuck_out_tonguesleeping
    worriedfrowninganguishedopen_mouthgrimacingconfusedhushed
    expressionlessunamusedsweat_smilesweatdisappointed_relievedwearypensive
    disappointedconfoundedfearfulcold_sweatperseverecrysob
    joyastonishedscreamtired_faceangryragetriumph
    sleepyyummasksunglassesdizzy_faceimpsmiling_imp
    neutral_faceno_mouthinnocent
Your attitude to the website Other polls