Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d656bfb984 | ||
|
cea3730f87 |
21
LICENSE
@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
@ -1,2 +0,0 @@
|
||||
# This Repo Has Been Archived
|
||||
This repo has been archived. You can continue to use the optimized Ubuntu image that is available by default in the Hyper-V Quick Create Gallery. If you are looking for an integrated Linux developer experience on Windows, we encourage you to check out [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/). WSL 2 lets developers run a GNU/Linux environment -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup. The ability to run Linux GUI apps in WSL is also on the [roadmap](https://devblogs.microsoft.com/commandline/whats-new-in-the-windows-subsystem-for-linux-september-2020/#gui-apps).
|
@ -1,88 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# This script is for Arch Linux to configure XRDP for enhanced session mode
|
||||
#
|
||||
# The configuration is adapted from the Ubuntu 16.04 script.
|
||||
#
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo 'This script must be run with root privileges' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use Qi to check for exact package name
|
||||
if ! pacman -Qi xrdp > /dev/null ; then
|
||||
echo 'xrdp not installed. Run makepkg.sh first to install xrdp.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use Qs to allow xorgxrdp-devel-git
|
||||
if ! pacman -Qs xorgxrdp > /dev/null ; then
|
||||
echo 'xorgxrdp not installed. Run makepkg.sh first to install xorgxrdp.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
# Configure XRDP
|
||||
#
|
||||
systemctl enable xrdp
|
||||
systemctl enable 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
|
||||
#
|
||||
# sed -n -e 's/max_bpp=32/max_bpp=24/g' /etc/xrdp/xrdp.ini
|
||||
|
||||
# use the default lightdm x display
|
||||
# sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/g' /etc/xrdp/sesman.ini
|
||||
# rename the redirected drives to 'shared-drives'
|
||||
sed -i_orig -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini
|
||||
|
||||
# Change the allowed_users
|
||||
echo "allowed_users=anybody" > /etc/X11/Xwrapper.config
|
||||
|
||||
|
||||
#Ensure hv_sock gets loaded
|
||||
if [ ! -e /etc/modules-load.d/hv_sock.conf ]; then
|
||||
echo "hv_sock" > /etc/modules-load.d/hv_sock.conf
|
||||
fi
|
||||
|
||||
# Configure the policy xrdp session
|
||||
cat > /etc/polkit-1/rules.d/02-allow-colord.rules <<EOF
|
||||
polkit.addRule(function(action, subject) {
|
||||
if ((action.id == "org.freedesktop.color-manager.create-device" ||
|
||||
action.id == "org.freedesktop.color-manager.modify-profile" ||
|
||||
action.id == "org.freedesktop.color-manager.delete-device" ||
|
||||
action.id == "org.freedesktop.color-manager.create-profile" ||
|
||||
action.id == "org.freedesktop.color-manager.modify-profile" ||
|
||||
action.id == "org.freedesktop.color-manager.delete-profile") &&
|
||||
subject.isInGroup("users"))
|
||||
{
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
||||
EOF
|
||||
|
||||
# Adapt the xrdp pam config
|
||||
cat > /etc/pam.d/xrdp-sesman <<EOF
|
||||
#%PAM-1.0
|
||||
auth include system-remote-login
|
||||
account include system-remote-login
|
||||
password include system-remote-login
|
||||
session include system-remote-login
|
||||
EOF
|
||||
|
||||
|
||||
###############################################################################
|
||||
# .xinitrc has to be modified manually.
|
||||
#
|
||||
echo "You will have to configure .xinitrc to start your windows manager, see https://wiki.archlinux.org/index.php/Xinit"
|
||||
echo "Reboot your machine to begin using XRDP."
|
@ -1,41 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# This script is for Arch Linux to download and install XRDP+XORGXRDP
|
||||
#
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
echo 'This script must be run as a non-root user, as building packages as root is unsupported.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
# Prepare by installing build tools.
|
||||
#
|
||||
# Partial upgrades aren't supported in arch.
|
||||
sudo pacman -Syu --needed --noconfirm base base-devel git
|
||||
|
||||
# Create a build directory in tmpfs
|
||||
TMPDIR=$(mktemp -d)
|
||||
pushd "$TMPDIR" || exit
|
||||
|
||||
###############################################################################
|
||||
# XRDP
|
||||
#
|
||||
(
|
||||
git clone https://aur.archlinux.org/xrdp.git
|
||||
cd xrdp || exit
|
||||
makepkg -sri --noconfirm
|
||||
)
|
||||
###############################################################################
|
||||
# XORGXRDP
|
||||
# Devel version, because release version includes a bug crashing gnome-settings-daemon
|
||||
(
|
||||
git clone https://aur.archlinux.org/xorgxrdp-devel-git.git
|
||||
cd xorgxrdp-devel-git || exit
|
||||
makepkg -sri --noconfirm
|
||||
)
|
||||
###############################################################################
|
||||
|
||||
#remove build directory
|
||||
rm -rf $TMPDIR
|
111
debian/12/install.sh
vendored
@ -1,111 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# This script is for Debian 12 Bookworm to download and install XRDP.
|
||||
#
|
||||
# Major thanks to: http://c-nergy.be/blog/?p=11336 for the tips.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
# Use HWE kernel packages
|
||||
#
|
||||
HWE=""
|
||||
#HWE="-hwe-18.04"
|
||||
|
||||
###############################################################################
|
||||
# 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
|
||||
# Not available on Debian 12.
|
||||
#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/use_vsock=false/use_vsock=true/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 Debian session properly
|
||||
# Tested on Debian 12, should work for at least GNOME and KDE now (probably more).
|
||||
# See https://wiki.archlinux.org/title/Environment_variables#Examples
|
||||
source /etc/os-release
|
||||
if [ ! -e /etc/xrdp/startdebian.sh ]; then
|
||||
cat >> /etc/xrdp/startdebian.sh << EOF
|
||||
#!/bin/sh
|
||||
export GNOME_SHELL_SESSION_MODE=$ID
|
||||
export XDG_CURRENT_DESKTOP=$ID:$XDG_CURRENT_DESKTOP
|
||||
exec /etc/xrdp/startwm.sh
|
||||
EOF
|
||||
chmod a+x /etc/xrdp/startdebian.sh
|
||||
fi
|
||||
|
||||
# use the script to setup the Debian session
|
||||
sed -i_orig -e 's/startwm/startdebian/g' /etc/xrdp/sesman.ini
|
||||
|
||||
# rename the redirected drives to 'shared-drives'
|
||||
sed -i -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini
|
||||
|
||||
# Changed the allowed_users
|
||||
sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
|
||||
|
||||
# Blacklist the vmw module
|
||||
if [ ! -e /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf ]; then
|
||||
cat >> /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf <<EOF
|
||||
blacklist vmw_vsock_vmci_transport
|
||||
EOF
|
||||
fi
|
||||
|
||||
#Ensure hv_sock gets loaded
|
||||
if [ ! -e /etc/modules-load.d/hv_sock.conf ]; then
|
||||
echo "hv_sock" > /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 <<EOF
|
||||
[Allow Colord all Users]
|
||||
Identity=unix-user:*
|
||||
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
|
||||
ResultAny=no
|
||||
ResultInactive=no
|
||||
ResultActive=yes
|
||||
EOF
|
||||
|
||||
# reconfigure the service
|
||||
systemctl daemon-reload
|
||||
systemctl start xrdp
|
||||
|
||||
#
|
||||
# End XRDP
|
||||
###############################################################################
|
||||
|
||||
echo "Install is complete."
|
||||
echo "Reboot your machine to begin using XRDP."
|
@ -7,12 +7,7 @@
|
||||
# Major thanks to: http://c-nergy.be/blog/?p=10752 for the tips.
|
||||
#
|
||||
|
||||
if [ ! "$(id -u)" ]; then
|
||||
echo 'This script must be run with root privileges' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
bash -c "cat > ~/.xsession <<EOF
|
||||
sudo bash -c "cat >~/.xsession <<EOF
|
||||
|
||||
/usr/lib/gnome-session/gnome-session-binary --session=ubuntu &
|
||||
/usr/lib/x86_64-linux-gnu/unity/unity-panel-service &
|
||||
|
@ -11,24 +11,22 @@
|
||||
# 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
|
||||
sudo apt update
|
||||
sudo apt upgrade -y
|
||||
|
||||
# Get git if we dont have it.
|
||||
apt install -y git
|
||||
sudo apt install -y git
|
||||
|
||||
# Get the linux-azure kernel to add hyper-v sockets to the guest
|
||||
apt install -y linux-azure
|
||||
sudo apt install -y linux-azure
|
||||
|
||||
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
|
||||
echo
|
||||
echo "A reboot is required in order to proceed with the install."
|
||||
echo "Please reboot and re-run this script to finish the install."
|
||||
echo
|
||||
|
||||
exit
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
@ -37,10 +35,10 @@ fi
|
||||
export XRDP_PATH=~/git/src/github.com/neutrinolabs/xrdp
|
||||
|
||||
# Install the xrdp service so we have the auto start behavior
|
||||
apt install -y xrdp
|
||||
sudo apt install -y xrdp
|
||||
|
||||
# Get XRDP requirements
|
||||
apt install -y autoconf libtool libssl-dev libpam0g-dev libx11-dev libxfixes-dev libxrandr-dev libjpeg-dev libfuse-dev nasm libopus-dev
|
||||
sudo apt install -y autoconf libtool libssl-dev libpam0g-dev libx11-dev libxfixes-dev libxrandr-dev libjpeg-dev libfuse-dev nasm
|
||||
|
||||
# Get XRDP
|
||||
if [ ! -d $XRDP_PATH ]; then
|
||||
@ -48,55 +46,53 @@ if [ ! -d $XRDP_PATH ]; then
|
||||
fi
|
||||
|
||||
# Configure XRDP
|
||||
cd $XRDP_PATH || exit
|
||||
cd $XRDP_PATH
|
||||
./bootstrap
|
||||
./configure --enable-ipv6 --enable-jpeg --enable-fuse --enable-rfxcodec --enable-opus --enable-painter --enable-vsock
|
||||
./configure --enable-vsock --enable-jpeg --enable-fuse
|
||||
|
||||
# Build/Install XRDP
|
||||
make
|
||||
make install
|
||||
sudo make install
|
||||
|
||||
# Configure the installed XRDP ini files.
|
||||
# use vsock transport.
|
||||
sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini
|
||||
sudo sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini
|
||||
# use rdp security.
|
||||
sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini
|
||||
sudo 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
|
||||
sudo 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
|
||||
sudo sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini
|
||||
#
|
||||
# sed -n -e 's/max_bpp=32/max_bpp=24/g' /etc/xrdp/xrdp.ini
|
||||
# sudo sed -n -e 's/max_bpp=32/max_bpp=24/g' /etc/xrdp/xrdp.ini
|
||||
|
||||
# use the default lightdm x display
|
||||
# sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/g' /etc/xrdp/sesman.ini
|
||||
|
||||
# rename the redirected drives to 'shared-drives'
|
||||
sed -i_orig -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini
|
||||
# sudo sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/g' /etc/xrdp/sesman.ini
|
||||
|
||||
# 16.04.3 changed the allowed_users
|
||||
sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
|
||||
sudo sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
|
||||
|
||||
# reconfigure the service
|
||||
systemctl daemon-reload
|
||||
systemctl enable xrdp.service
|
||||
systemctl enable xrdp-sesman.service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable xrdp.service
|
||||
sudo systemctl enable xrdp-sesman.service
|
||||
|
||||
# Configure the policy xrdp session
|
||||
# polkit policy definition language changes depending on its version. See issue #61
|
||||
if [[ "$(pkaction --version | sed -E 's/^[[:alnum:] ]*([[:digit:]]+.*)/\1/' - )" != '0.105' ]]; then
|
||||
echo "Error: Policy rule specification probably invalid. Expected version: 0.105 detected $(pkaction --version)." >&2
|
||||
exit 1
|
||||
fi
|
||||
sudo bash -c 'cat >/etc/polkit-1/localauthority.conf.d/02-allow-colord.conf <<EOF
|
||||
|
||||
cat > /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla <<EOF
|
||||
[Allow Colord all Users]
|
||||
Identity=unix-user:*
|
||||
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
|
||||
ResultAny=no
|
||||
ResultInactive=no
|
||||
ResultActive=yes
|
||||
EOF
|
||||
polkit.addRule(function(action, subject) {
|
||||
if ((action.id == "org.freedesktop.color-manager.create-device" ||
|
||||
action.id == "org.freedesktop.color-manager.modify-profile" ||
|
||||
action.id == "org.freedesktop.color-manager.delete-device" ||
|
||||
action.id == "org.freedesktop.color-manager.create-profile" ||
|
||||
action.id == "org.freedesktop.color-manager.modify-profile" ||
|
||||
action.id == "org.freedesktop.color-manager.delete-profile") &&
|
||||
subject.isInGroup("{group}"))
|
||||
{
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
||||
EOF'
|
||||
|
||||
#
|
||||
# End XRDP
|
||||
@ -108,11 +104,11 @@ EOF
|
||||
export XORGXRDP_PATH=~/git/src/github.com/neutrinolabs/xorgxrdp
|
||||
|
||||
# Get XORGXRDP requirements
|
||||
apt install -y autoconf libtool xserver-xorg-core xserver-xorg-dev
|
||||
sudo apt install -y autoconf libtool xserver-xorg-core xserver-xorg-dev
|
||||
|
||||
# 16.04.3 is missing fontutil.h
|
||||
if [ ! -f /usr/include/X11/fonts/fontutil.h ]; then
|
||||
apt install -y libxfont1-dev
|
||||
sudo apt install -y libxfont1-dev
|
||||
fi
|
||||
|
||||
# Get XORGXRDP
|
||||
@ -121,16 +117,13 @@ if [ ! -d $XORGXRDP_PATH ]; then
|
||||
fi
|
||||
|
||||
# Configure XORGXRDP
|
||||
cd $XORGXRDP_PATH || exit
|
||||
cd $XORGXRDP_PATH
|
||||
./bootstrap
|
||||
./configure
|
||||
|
||||
# Build/Install XORGXRDP
|
||||
make
|
||||
make install
|
||||
|
||||
#Installing xorgxrdp knocks out ubuntu-desktop from running. We need to reinstall it
|
||||
apt-get install -y --reinstall ubuntu-desktop
|
||||
sudo make install
|
||||
|
||||
#
|
||||
# End XORGXRDP
|
||||
|
@ -7,102 +7,103 @@
|
||||
# Major thanks to: http://c-nergy.be/blog/?p=11336 for the tips.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
# Use HWE kernel packages
|
||||
#
|
||||
HWE=""
|
||||
#HWE="-hwe-18.04"
|
||||
|
||||
###############################################################################
|
||||
# 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
|
||||
# Check if we have the bionic-proposed sources list
|
||||
sudo cat /etc/apt/sources.list | grep bionic-proposed > /dev/null
|
||||
if [ "$?" == "1" ]; then
|
||||
sudo bash -c 'echo "deb http://archive.ubuntu.com/ubuntu/ bionic-proposed restricted main multiverse universe" >> /etc/apt/sources.list <<EOF
|
||||
EOF'
|
||||
fi
|
||||
|
||||
apt update && apt upgrade -y
|
||||
sudo apt update && sudo apt dist-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
|
||||
echo
|
||||
echo "A reboot is required in order to proceed with the install."
|
||||
echo "Please reboot and re-run this script to finish the install."
|
||||
echo
|
||||
|
||||
exit
|
||||
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
|
||||
sudo apt install -y xrdp
|
||||
|
||||
systemctl stop xrdp
|
||||
systemctl stop xrdp-sesman
|
||||
sudo systemctl stop xrdp
|
||||
sudo systemctl stop xrdp-sesman
|
||||
|
||||
# Configure the installed XRDP ini files.
|
||||
# use vsock transport.
|
||||
sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini
|
||||
sudo sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini
|
||||
# use rdp security.
|
||||
sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini
|
||||
sudo 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
|
||||
sudo 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
|
||||
sudo 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/startubuntu.sh ]; then
|
||||
cat >> /etc/xrdp/startubuntu.sh << EOF
|
||||
#!/bin/sh
|
||||
export GNOME_SHELL_SESSION_MODE=ubuntu
|
||||
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
|
||||
exec /etc/xrdp/startwm.sh
|
||||
EOF
|
||||
chmod a+x /etc/xrdp/startubuntu.sh
|
||||
fi
|
||||
|
||||
# use the script to setup the ubuntu session
|
||||
sed -i_orig -e 's/startwm/startubuntu/g' /etc/xrdp/sesman.ini
|
||||
|
||||
# rename the redirected drives to 'shared-drives'
|
||||
sed -i -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini
|
||||
# use the default lightdm x display
|
||||
# sudo sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/g' /etc/xrdp/sesman.ini
|
||||
|
||||
# Changed the allowed_users
|
||||
sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
|
||||
sudo sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
|
||||
sudo dpkg-reconfigure xserver-xorg-legacy
|
||||
|
||||
# Enable the hv_sock module
|
||||
# sudo rmmod vmw_vsock_vmci_transport
|
||||
# sudo rmmod vsock
|
||||
# sudo modprobe hv_sock
|
||||
|
||||
# Blacklist the vmw module
|
||||
if [ ! -e /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf ]; then
|
||||
cat >> /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf <<EOF
|
||||
blacklist vmw_vsock_vmci_transport
|
||||
EOF
|
||||
sudo cat /etc/modprobe.d/blacklist.conf | grep vmw_vsock_vmci_transport > /dev/null
|
||||
if [ "$?" == "1" ]; then
|
||||
sudo bash -c 'echo "blacklist vmw_vsock_vmci_transport" >> /etc/modprobe.d/blacklist.conf <<EOF
|
||||
EOF'
|
||||
fi
|
||||
|
||||
#Ensure hv_sock gets loaded
|
||||
if [ ! -e /etc/modules-load.d/hv_sock.conf ]; then
|
||||
echo "hv_sock" > /etc/modules-load.d/hv_sock.conf
|
||||
sudo cat /etc/modules | grep hv_sock > /dev/null
|
||||
if [ "$?" == "1" ]; then
|
||||
sudo bash -c 'echo "hv_sock" >> /etc/modules <<EOF
|
||||
EOF'
|
||||
fi
|
||||
|
||||
# Configure the policy xrdp session
|
||||
cat > /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla <<EOF
|
||||
[Allow Colord all Users]
|
||||
Identity=unix-user:*
|
||||
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
|
||||
ResultAny=no
|
||||
ResultInactive=no
|
||||
ResultActive=yes
|
||||
EOF
|
||||
sudo bash -c 'cat >/etc/polkit-1/localauthority.conf.d/02-allow-colord.conf <<EOF
|
||||
|
||||
polkit.addRule(function(action, subject) {
|
||||
if ((action.id == "org.freedesktop.color-manager.create-device" ||
|
||||
action.id == "org.freedesktop.color-manager.modify-profile" ||
|
||||
action.id == "org.freedesktop.color-manager.delete-device" ||
|
||||
action.id == "org.freedesktop.color-manager.create-profile" ||
|
||||
action.id == "org.freedesktop.color-manager.modify-profile" ||
|
||||
action.id == "org.freedesktop.color-manager.delete-profile") &&
|
||||
subject.isInGroup("{group}"))
|
||||
{
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
||||
EOF'
|
||||
|
||||
# reconfigure the service
|
||||
systemctl daemon-reload
|
||||
systemctl start xrdp
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl start xrdp
|
||||
|
||||
#
|
||||
# End XRDP
|
||||
###############################################################################
|
||||
|
||||
# Install Gnome Tweak
|
||||
sudo apt-get install gnome-tweak-tool -y
|
||||
|
||||
echo
|
||||
echo "Install is complete."
|
||||
echo "Reboot your machine to begin using XRDP."
|
||||
echo
|
||||
|
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 393 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 50 KiB |