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
Best Answer
VNC Server Installation
The VNC server is specifically designed for this purpose. The installation is pretty straight forward as mentioned in this link. However, there are chances you may encounter some issues while installing. So, I am describing the issues that I faced and how I resolved them.
We need to decide which user will be using the vnc-server.
Now, we need to set the password.
As a root user, perform the below operation.
Add the below 2 lines.
Type the below commands.
If the above commands are successful, we need to edit the
xstartup
file for whom we have configured thevncserver
. So, in our case, we have configured it for the uservncuser
. So,Uncomment the below 2 lines.
If the above step is also successful, we are finished with the configuration of the VNC server. However, we need to configure the firewall to permit the vnc communication. In the link, it is mentioned to directly edit the
/etc/sysconfig/iptables
file which is a very wrong approach. Instead do the below step.We have made the changes. But we need to change them.
Now, we can view this machine as
vncuser
from a network machine by typing the below commands.