Linux – Setting up cross platform VNC system

linux-mintvncwindows

Here's my intention: I have a main system running Windows 10. I have two GUI systems running Mint 18.2 that I wish to connect to and control from the Windows system. All three systems are connected to the same router via ethernet. No router configurations have been made, so everything should be on default.

I currently use TeamViewer to connect, but this is done via an internet connection, not a LAN connection. I was never able to get LAN to work with TeamViewer. Regardless, I want to move away from TeamViewer and use an alternative.

This is what I'm currently attempting: I have TightVNC installed on the Windows computer, and tightvncserver installed on the Mint systems. When I open up TightVNCViewer on Windows, I am asked for the remote host information, which in the case of the Mint systems are 192.168.1.25 and 192.168.1.2. Connecting with this results in the following error:

Error in TightVNC Viewer: No connection could be made because the target machine actively refused it.

If I changed the addresses to 192.168.1.25:1 and 192.168.1.2:1 respectively (since the Mint systems say New 'X' desktop is machinename:1), I am asked for the password I set. I enter this, and I simply see a grey screen with a X cursor. It doesn't seem like I can interact with the systems thus far. The cursor does not move in Mint along with mine in the Windows VNC window, nor are there any responses to ctrl+alt+F7 or any of the variants of those controls. The :1 seemed like an odd addition, as I had assumed it was meant to be the port number.

From what I can see, if it accepted a password, then it must mean that I have been able to reach the Mint systems from Windows in some capacity. This seems to suggest that I need to do some more work on something on the Mint systems' ends before things function as intended.

That said, someone mentioned that tightvnc is not the solution I'm supposed to be looking for. If it isn't, what is?

Also, I don't know if it makes a difference, but the Mint systems don't run with monitors attached. If a monitor is connected after booting, I don't see the desktop, even though things are still running (assuming full load heat output is anything to go by), so I need to restart with a monitor already connected. Heard this has something to do with X and nvidia drivers or something, but I'd imagine it might affect vnc usage if im trying to connect when no monitor is present.

Best Answer

Headless RDP (remote desktop protocol) server on Ubuntu 16+ based system.

Software:

Install Mint 18 and update it.

Install the ssh server to make life much easier: apt-get install openssh-server

Custom compile xrdp and xorgxrdp because the Mint repositories do not include or have the configuration we need.

Setup Mint to compile by installing build environment.

sudo apt-get install build-essential

sudo apt-get install git autoconf libtool pkg-config gcc g++ make  libssl-dev libpam0g-dev libjpeg-dev libx11-dev libxfixes-dev libxrandr-dev  flex bison libxml2-dev intltool xsltproc xutils-dev python-libxml2 g++ xutils libfuse-dev libmp3lame-dev nasm libpixman-1-dev xserver-xorg-dev

note: I think there was 1 more dependency require for Ubuntu 16+. I dont see it in my notes, but you will know real quick when you 'make'.

found it:

sudo apt-get install libxfont1-dev

note: xorgxrdp requires a header file from xrdp. So it's preferred that xrdp is compiled and installed first.

get and extract xrdp and xorgxrdp to someplace like /opt. Might need to adjust permissions here. Bad form but works: sudo -R chmod 777 /opt

Run the following cli commands:

xrdp

cd /opt/xrdp-0.9.1

./bootstrap

./configure --enable-fuse --enable-mp3lame --enable-painter

note:

  • --enable-painter for Win10 rdp client connect.
  • --enable-fuse for drive redirection and clipboard
  • --enable-mp3lame Build lame mp3(audio codec)

make

sudo make install

sudo ln -s /usr/local/sbin/xrdp{,-sesman} /usr/sbin

xorgxrdp

cd /opt/xorgxrdp-devel

./bootstrap

./configure

make

sudo make install

Make xrdp and xorgxrdp a 'service' so it starts on bootup.

version < Ubuntu 14

/etc/init.d/xrdp (from install. enable it to start on bootup)

sudo update-rc.d xrdp defaults -- creates the links in the rc.x directories

sudo update-rc.d xrdp enable -- make it start now.

version > Ubuntu 14 (Mint 18)

sudo systemctl enable xrdp

sudo service xrdp start

sudo systemctl status xrdp

sudo systemctl start xrdp

Configuration files (some)

/etc/xrdp/sesman.ini

/etc/xrdp/xrdp.ini

/etc/xrdp/startwm.sh

This is the setting in /etc/xrdp/xrdp.ini that we will use:

[Xorg]
name=Xorg
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=-1
code=20

Remember to use other or multiple desktops, adjustments may be required in these files along with others. See here for a little help in this. Using Cinnamon desktop no changes were required.

To make your Mint 18.x box boot to command line, it is a headless system after all.

Boot to command line

sudo nano /etc/default/grub

comment out GRUB_CMDLINE_LINUX_DEFAULT= and add "text" to GRUB_CMDLINE_LINUX as below:

#GRUB_CMDLINE_LINUX_DEFAULT=""

GRUB_CMDLINE_LINUX="text"

sudo update-grub

sudo systemctl set-default multi-user.target

To start gui from command line:

startx

To undo change:

sudo systemctl set-default graphical.target

Related Question