xrdp fails to start because xrdp-sesman fails to start at bootup. It appears to fail because it tries to start before the network is fully up. This may be related to disabling IPv6. If I add "ExecStartPre=/bin/sleep 20" to /lib/systemd/system/xrdp-sesman.service the service will then start successfully at bootup, so it appears this is simply a systemd timing issue. I tried charging network.target to network-online.target but that didn't resolve the problem.
This is the error message I get:
cat /var/log/xrdp-sesman.log
[20180424-13:20:06] [DEBUG] libscp initialized
[20180424-13:20:07] [INFO ] starting xrdp-sesman with pid 2149
[20180424-13:20:07] [INFO ] IPv6 not supported, falling back to IPv4
[20180424-13:20:07] [INFO ] IPv6 not supported, falling back to IPv4
[20180424-13:20:07] [DEBUG] Testing if xrdp-sesman can listen on 127.0.0.1 port 3350.
[20180424-13:20:07] [INFO ] listening to port 3350 on 127.0.0.1
[20180424-13:20:07] [ERROR] bind_loopback(5, 3350) failed; IPv6 ::1 (errno=97), IPv4 127.0.0.1 (errno=98) and IPv6 ::FFFF:127.0.0.1 (errno=97).
[20180424-13:20:07] [ERROR] Failed to start xrdp-sesman daemon, possibly address already in use.
[20180424-13:20:07] [INFO ] shutting down sesman 1
[20180424-13:20:07] [DEBUG] Closed socket 7 (AF_INET 127.0.0.1:3350)
Workaround:
Add "ExecStartPre=/bin/sleep 20" to the [Service] section of /lib/systemd/system/xrdp-sesman.service
The script below will setup my environment:
#!/bin/bash
### Netplan configuration ###
cat << 'EOF' > /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
xrdp fails to start because xrdp-sesman fails to start at bootup. It appears to fail because it tries to start before the network is fully up. This may be related to disabling IPv6. If I add "ExecStartPre= /bin/sleep 20" to /lib/systemd/ system/ xrdp-sesman. service the service will then start successfully at bootup, so it appears this is simply a systemd timing issue. I tried charging network.target to network- online. target but that didn't resolve the problem.
This is the error message I get:
cat /var/log/ xrdp-sesman. log
[20180424-13:20:06] [DEBUG] libscp initialized
[20180424-13:20:07] [INFO ] starting xrdp-sesman with pid 2149
[20180424-13:20:07] [INFO ] IPv6 not supported, falling back to IPv4
[20180424-13:20:07] [INFO ] IPv6 not supported, falling back to IPv4
[20180424-13:20:07] [DEBUG] Testing if xrdp-sesman can listen on 127.0.0.1 port 3350.
[20180424-13:20:07] [INFO ] listening to port 3350 on 127.0.0.1
[20180424-13:20:07] [ERROR] bind_loopback(5, 3350) failed; IPv6 ::1 (errno=97), IPv4 127.0.0.1 (errno=98) and IPv6 ::FFFF:127.0.0.1 (errno=97).
[20180424-13:20:07] [ERROR] Failed to start xrdp-sesman daemon, possibly address already in use.
[20180424-13:20:07] [INFO ] shutting down sesman 1
[20180424-13:20:07] [DEBUG] Closed socket 7 (AF_INET 127.0.0.1:3350)
Workaround: /bin/sleep 20" to the [Service] section of /lib/systemd/ system/ xrdp-sesman. service
Add "ExecStartPre=
The script below will setup my environment:
#!/bin/bash
### Install packages;
apt update;
apt upgrade -y;
apt install -y qemu-kvm libvirt-bin virtinst bridge-utils cpu-checker virt-manager xrdp xfce4 firefox xfce4-terminal nmap iotop;
### Disable IPv6 due to bugs... #### CMDLINE_ LINUX_DEFAULT= ""/GRUB_ CMDLINE_ LINUX_DEFAULT= "ipv6.disable= 1"/' /etc/default/grub;
sed -i 's/GRUB_
### Setup Network Dummy Interfaces ### \nName= dummy1\ nKind=dummy\ n" > /etc/systemd/ network/ dummy1. netdev; \nName= dummy2\ nKind=dummy\ n" > /etc/systemd/ network/ dummy2. netdev; networkd. service;
printf "[NetDev]
printf "[NetDev]
systemctl restart systemd-
### Netplan configuration ### 01-netcfg. yaml
cat << 'EOF' > /etc/netplan/
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eno3: {}
eno4: {}
dummy1: {}
dummy2: {}
vlans: vlan10: vlan20:
vbridge2-
id: 10
link: vbridge2
addresses: [10.11.1.2/24]
vbridge2-
id: 20
link: vbridge2
addresses: [10.11.2.2/24]
bonds:
bond1:
interfaces: [eno3, eno4]
bridges:
lab:
interfaces: [bond1]
addresses: [10.10.2.2/16]
gateway4: 10.10.0.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
vbridge1:
interfaces: [dummy1]
addresses: [10.11.0.2/24]
vbridge2:
interfaces: [dummy2]
EOF
netplan apply;
### Enable nested virtualization ### d/kvm.conf;
echo "options kvm-intel nested=y" >> /etc/modprobe.
### Enable XRDP server ### .xession; startwm. sh; /X11\/Xsession/ s/^/#/' /etc/xrdp/ startwm. sh;
ufw allow 3389/tcp;
echo "xfce4-session" > /root/.xession;
echo "xfce4-session" > /home/nbritton/
echo "xfce4-session" >> /etc/xrdp/
sed -i '/\/etc\
systemctl restart xrdp;
ProblemType: Bug system/ xrdp-sesman. service] ature: Ubuntu 4.15.0- 19.20-generic 4.15.17 256color .etc.xrdp. startwm. sh: 2018-04- 24T12:58: 12.608318
DistroRelease: Ubuntu 18.04
Package: xrdp 0.9.5-2 [modified: lib/systemd/
ProcVersionSign
Uname: Linux 4.15.0-19-generic x86_64
ApportVersion: 2.20.9-0ubuntu6
Architecture: amd64
Date: Tue Apr 24 13:56:50 2018
InstallationDate: Installed on 2018-04-24 (0 days ago)
InstallationMedia: Ubuntu-Server 18.04 LTS "Bionic Beaver" - Release amd64 (20180424.1)
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: xrdp
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile.