From b83523c7d26a4cb7733f6e93dfa4faaceea75356 Mon Sep 17 00:00:00 2001 From: voney Date: Wed, 8 Jul 2020 19:38:55 +1000 Subject: [PATCH] Create install.sh --- linuxmint/20/cinnamon/install.sh | 108 +++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 linuxmint/20/cinnamon/install.sh diff --git a/linuxmint/20/cinnamon/install.sh b/linuxmint/20/cinnamon/install.sh new file mode 100644 index 0000000..9125802 --- /dev/null +++ b/linuxmint/20/cinnamon/install.sh @@ -0,0 +1,108 @@ +#!/bin/bash + +# +# This script is for Linux Mint 20 Ulyana Cinnamon Edition to install and +# configure xrdp to be used with Hyper-V's Enhanced Mode. +# +# + +############################################################################### +# Use HWE kernel packages +# +HWE="" + +############################################################################### +# Update our machine to the latest code if we need to. +# + +if [ "$(id -u)" -ne 0 ]; then + echo 'This script must be run with root privileges' >&2 + exit 1 +fi + +apt update && apt upgrade -y + +if [ -f /var/run/reboot-required ]; then + echo "A reboot is required in order to proceed with the install." >&2 + echo "Please reboot and re-run this script to finish the install." >&2 + exit 1 +fi + +############################################################################### +# XRDP +# + +# Install hv_kvp utils +apt install -y linux-tools-virtual${HWE} +apt install -y linux-cloud-tools-virtual${HWE} + +# Install the xrdp service so we have the auto start behavior +apt install -y xrdp + +systemctl stop xrdp +systemctl stop xrdp-sesman + +# Configure the installed XRDP ini files. +# use vsock transport. +sed -i_orig -e 's/port=3389/port=vsock://-1:3389/g' /etc/xrdp/xrdp.ini +# use rdp security. +sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini +# remove encryption validation. +sed -i_orig -e 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini +# disable bitmap compression since its local its much faster +sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini + +# Add script to setup the ubuntu session properly +if [ ! -e /etc/xrdp/startcinnamon.sh ]; then + cat >>/etc/xrdp/startcinnamon.sh <>/etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf </etc/modules-load.d/hv_sock.conf +fi + +# Configure the policy xrdp session +cat >/etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla <