1
0
forked from mir/linux-vm-tools

Compare commits

...

83 Commits

Author SHA1 Message Date
94a8fcd02c Make Debian installer differentiate KDE / GNOME. 2024-11-02 07:02:10 +01:00
b68432dbd7 Add install.sh for Debian 12 2024-11-02 06:11:07 +01:00
Craig Wilhite
cd10c5b403
Update README.md 2021-01-28 13:43:56 -05:00
Craig Wilhite
c1fb14604a
Update Readme to Reflect Archival 2021-01-28 13:27:23 -05:00
Craig Wilhite
317a90f06f
Update link to blogpost in readme
Resolves: #96
2020-01-07 11:16:13 -08:00
Craig Wilhite
4cde61ece2
Merge pull request #99 from multipitch/master
Fix vsock configuration.
2020-01-07 11:12:42 -08:00
Sean Tully
f53f7cc5d6 Fix vsock configuration. 2020-01-07 09:24:50 +00:00
Justin
4dcc278f84
Merge pull request #81 from H3Gouchan/master
Add parameter for HWE kernel.
2019-03-11 13:59:53 -07:00
H3Gouchan
aefd66cad4 Add parameter for HWE kernel. 2019-03-07 12:41:56 +09:00
Craig Wilhite
f189c2751e
Merge pull request #72 from hlhr/deadlink-onboarding
Fix onboarding dead link
2018-10-29 08:02:03 -07:00
Henning L
968bfe08d1
Fix onboarding deadlink 2018-10-27 23:22:52 +02:00
Justin
d30ea7e6e9
Merge pull request #64 from samueloph/samueloph_shellcheck
fix shellcheck reported problems
2018-10-22 10:04:18 -07:00
Samuel Henrique
1a5b61853f Fix shellcheck reported problems 2018-10-20 15:17:02 -03:00
Justin
4748bda5fb
Merge pull request #63 from WhisperingChaos/master
Addresses Issues #61 & #62
2018-10-17 15:06:59 -07:00
Rich Moyse
5303c94ebf fixes #6 polkit rule language version support.
eliminate install prompt.
eliminate bash subshell to install polkit policy.
2018-10-17 16:42:26 -04:00
Justin
0b13ac2924
Merge pull request #66 from luizbills/patch-1
Fix bash code style
2018-10-17 09:43:23 -07:00
Luiz Paulo "Bills
a4e9315d1a
fix code style 2018-10-03 20:21:52 -03:00
Luiz Paulo "Bills
12fb39679f
fix code style 2018-10-03 20:15:39 -03:00
Luiz Paulo "Bills
a747f48d3f
fix code style 2018-10-03 20:15:16 -03:00
Luiz Paulo "Bills
92e8ab88d4
fix code style 2018-10-03 20:14:44 -03:00
Luiz Paulo "Bills
021eb9122c
fix code style 2018-10-03 20:13:38 -03:00
Luiz Paulo "Bills
0054c5730a
fix code style 2018-10-03 20:12:15 -03:00
Luiz Paulo "Bills
4ed42fda4d
fix code style 2018-10-03 20:11:31 -03:00
Luiz Paulo "Bills
b2b4d37b61
fix code style 2018-10-03 20:09:52 -03:00
Justin
aee9e17adc
Merge pull request #65 from ilmanzo/patch-1
Update makepkg.sh
2018-10-03 11:31:55 -07:00
Andrea Manzini
0728c2cc8c
Update makepkg.sh
use mktemp to get a random build directory for safety and  avoid name conflicts
2018-10-03 11:40:47 +02:00
Craig Wilhite
29cbeba837
Add files via upload 2018-09-18 08:40:20 -07:00
Craig Wilhite
d1954f5fc1
Add files via upload 2018-09-18 08:35:24 -07:00
Craig Wilhite
30769e9dbf
Add files via upload 2018-09-18 08:27:16 -07:00
Craig Wilhite
f489906fb8
Add files via upload 2018-09-18 08:25:04 -07:00
Craig Wilhite
b8fd6ea26b
Add files via upload 2018-09-18 08:22:13 -07:00
Craig Wilhite
fbe36c3508
Merge pull request #45 from Microsoft/cwilhit-patch-1
Fix polkit typo
2018-06-08 09:14:44 -07:00
Craig Wilhite
e6030b7376
Fix polkit typo
Fixing error caught in #44
2018-06-08 09:14:10 -07:00
Craig Wilhite
8b41356c10
Merge pull request #40 from Microsoft/cwilhit-patch-1
Correct Polkit Policy
2018-05-22 15:55:36 -07:00
Craig Wilhite
04521fed99
Correct Polkit Policy
Whereas the polkit policy in the previous script eliminated auth popups upon a remote connection, there was a "Error detected" message box that would still periodically pop up. We must change polkit configuration to use .pkla file because this is required by Polkit ver 1.05 (which ships with Bionic Beaver). 

/etc/polkit-1/localauthority.conf.d/ should be the rightful place for this override config file to go, but it appears to not get picked up when housed there.

Brought to light with thanks to Griffon @ http://c-nergy.be/blog/?p=12043
2018-05-22 15:06:34 -07:00
Craig Wilhite
11be5b1225
Merge pull request #38 from Microsoft/crwilhit-docs
Add media for wiki onboarding page
2018-05-21 15:28:14 -07:00
Craig Wilhite
7b6e807eab Adding media for wiki pages 2018-05-21 15:27:23 -07:00
Craig Wilhite
044def1d64
Create tmp.png 2018-05-21 15:25:32 -07:00
Craig Wilhite
0512e124b6
Add media for wiki 2018-05-21 15:24:27 -07:00
Justin
b5fb1f4f47
Merge pull request #37 from Microsoft/cwilhit-patch-1
Add KVP utils
2018-05-21 14:13:09 -07:00
Craig Wilhite
40d32f2128
Add KVP utils
Pull in packages to allow for some Hyper-V integration components.
2018-05-21 10:52:26 -07:00
Craig Wilhite
8228d3bc40
Update README.md 2018-05-17 16:18:24 -07:00
Craig Wilhite
c14580af75
Update README.md 2018-05-17 16:17:44 -07:00
Craig Wilhite
83818ac15b
Merge pull request #36 from Microsoft/cwilhit-patch-1
Cwilhit patch
2018-05-17 16:13:16 -07:00
Craig Wilhite
ace11e1bb1
Update README.md 2018-05-17 16:07:26 -07:00
Craig Wilhite
a552524e87
Update README.md 2018-05-17 08:38:58 -07:00
Craig Wilhite
876f3d5f22
Update README.md 2018-05-17 08:32:55 -07:00
Craig Wilhite
73a25928a1
Create LICENSE 2018-05-17 08:30:25 -07:00
Craig Wilhite
40981a81a8
Create README.md 2018-05-17 08:28:48 -07:00
Justin
994991cf30
Merge pull request #33 from jterry75/18.04_release_fixes
Update the script for 18.04 release clean install
2018-05-10 15:03:52 -07:00
Justin Terry (VM)
1ea3f6624c Update the script for 18.04 release clean install
Fixes a bug in the 16.04 and 18.04 script that doesnt properly check for
root at run.
Removes some unnecessary rmmod/modprobe calls that were required in
early 18.04 betas that are no longer required.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-05-10 10:40:24 -07:00
Justin
e86510f7e7
Merge pull request #25 from cwilhit/patch-1
Fix typo
2018-04-23 10:33:20 -07:00
Craig Wilhite
d5aa950f77
Fix typo
Typo was blocking script from working correctly; vmw module would not get blacklisted, hv_sock connection would fail.
2018-04-23 10:30:29 -07:00
Justin
df505b729d
Merge pull request #21 from kenvandine/master
Use the Ubuntu session for 18.04
2018-04-02 08:56:27 -07:00
Ken VanDine
55dca27fa9 Fixed sed 2018-03-30 11:39:01 -04:00
Ken VanDine
6575b9ed27 Removed the commented out sed for lightdm 2018-03-30 10:20:26 -04:00
Ken VanDine
e552b35ff0 Properly setup the ubuntu desktop session and drop the installation of
gnome-tweak-tool as it's not needed anymore
2018-03-30 10:19:12 -04:00
Justin
167e51cf7b
Merge pull request #19 from boppbo/master
Add support for Arch Linux
2018-03-29 16:10:56 -07:00
Boris Bopp
87201fa488 Separate makepkg from configuration 2018-03-29 12:14:52 +02:00
Boris Bopp
ac50616e57 Add support for Arch Linux 2018-03-23 16:59:03 +01:00
Justin Terry (VM)
c06cd3a3eb Renames thinclient_drives to shared-drives
Updates the thinclient_drives FUSE mount to show up as shared-drives when
clients use drive redirection.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-03-19 14:11:33 -07:00
Justin
3261fefb8d
Merge pull request #17 from Thaodan/use_seperate_files
Use seperate files
2018-03-19 13:57:17 -07:00
Björn Bidar
efe1759a1d use seperate files rather than using the old global file(s)
..for handling modules
2018-03-19 21:34:10 +01:00
Björn Bidar
a04a8a9523 removed useless cat and cleaned if statemants up
Calling bash is no longer needed.
Also grep can search on files on its own.
The return status of grep is usable with if and avoids calling
test (or [ for that matter ).
2018-03-19 21:34:10 +01:00
Justin
5ba1db8391
Merge pull request #16 from Thaodan/grep_quiet
use --quiet rather than redirecting to /dev/null
2018-03-19 08:27:03 -07:00
Björn Bidar
ec119f904b use --quiet rather than redirecting to /dev/null 2018-03-19 12:00:15 +01:00
Justin
8eff6b70f0
Merge pull request #12 from cwilhit/patch-5
Add missing lib
2018-03-06 14:54:01 -08:00
Craig Wilhite
63cf0daaf0
Add missing lib
xrdp was not installing without libopus-dev. Fixes issue #10
2018-03-06 14:49:59 -08:00
Justin
0b596b93eb
Merge pull request #11 from cwilhit/patch-4
Update install.sh
2018-03-05 11:05:04 -08:00
Craig Wilhite
00fe6a84b3
Update install.sh
Change dist-upgrade to just upgrade
2018-03-05 11:02:40 -08:00
Craig Wilhite
661c4bdde9
Update install.sh
Remove pulling in bionic-proposed. 18.04 is now on to the 4.15 kernels, so there's no need anymore.
2018-03-05 10:51:08 -08:00
Justin Terry (VM)
19f8d740b4 Remove sudo and added root check for 16.04 config user 2018-03-02 09:56:26 -08:00
Justin Terry (VM)
4b0cee52ea Remove sudo and added root check for 16.04 2018-03-02 09:55:31 -08:00
Justin
0432e5888f
Merge pull request #8 from Thaodan/run_as_root
remove sudo and added root check
2018-03-02 09:19:01 -08:00
Justin
f0b779fee5
Merge pull request #7 from Thaodan/errors_std_err
rediret errors to stderr
2018-03-02 09:17:19 -08:00
Björn Bidar
ae012977ab remove sudo and added root check
Removed sudo because it made no sense running the script not as root
when nearly all of the commands where run as root.
2018-03-02 10:01:36 +01:00
Björn Bidar
80666ace16 rediret errors to stderr 2018-03-02 09:10:52 +01:00
Justin Terry (VM)
3f933eee18 Updating configure settings to match the Debian package build system settings
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-03-01 08:08:16 -08:00
Justin
c9552344b6
Merge pull request #5 from cwilhit/patch-3
Keep ubuntu-desktop running
2018-02-28 11:04:33 -08:00
Craig Wilhite
2046f6af53
Keep ubuntu-desktop running
Fix a bug where ubuntu-desktop stops running and "basic mode" is lost.
2018-02-28 11:03:26 -08:00
Justin Terry (VM)
5927c9de2e Adding checks before writiting multiple entries to files on rerun 2018-02-21 06:42:05 -08:00
Justin
28e6cc2079
Merge pull request #4 from cwilhit/patch-1
Remove Build XRDP
2018-02-21 06:37:50 -08:00
Craig Wilhite
5082f8ce12
Remove Build XRDP, use proposed changes
-XRDP now includes config changes.
-We don't need Billy's PPA, we can just use Ubuntu Proposed archive.
2018-02-20 12:32:36 -08:00
16 changed files with 382 additions and 123 deletions

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
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

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# 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).

88
arch/install-config.sh Executable file
View File

@ -0,0 +1,88 @@
#!/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."

41
arch/makepkg.sh Executable file
View File

@ -0,0 +1,41 @@
#!/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 Normal file
View File

@ -0,0 +1,111 @@
#!/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."

View File

@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash
#
# This script configures the logged in users xsession to properly
@ -7,7 +7,12 @@
# Major thanks to: http://c-nergy.be/blog/?p=10752 for the tips.
#
sudo bash -c "cat >~/.xsession <<EOF
if [ ! "$(id -u)" ]; then
echo 'This script must be run with root privileges' >&2
exit 1
fi
bash -c "cat > ~/.xsession <<EOF
/usr/lib/gnome-session/gnome-session-binary --session=ubuntu &
/usr/lib/x86_64-linux-gnu/unity/unity-panel-service &

View File

@ -11,22 +11,24 @@
# Update our machine to the latest code if we need to.
#
sudo apt update
sudo apt upgrade -y
if [ "$(id -u)" -ne 0 ]; then
echo 'This script must be run with root privileges' >&2
exit 1
fi
apt update
apt upgrade -y
# Get git if we dont have it.
sudo apt install -y git
apt install -y git
# Get the linux-azure kernel to add hyper-v sockets to the guest
sudo apt install -y linux-azure
apt install -y linux-azure
if [ -f /var/run/reboot-required ]; then
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
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
###############################################################################
@ -35,10 +37,10 @@ fi
export XRDP_PATH=~/git/src/github.com/neutrinolabs/xrdp
# Install the xrdp service so we have the auto start behavior
sudo apt install -y xrdp
apt install -y xrdp
# Get XRDP requirements
sudo apt install -y autoconf libtool libssl-dev libpam0g-dev libx11-dev libxfixes-dev libxrandr-dev libjpeg-dev libfuse-dev nasm
apt install -y autoconf libtool libssl-dev libpam0g-dev libx11-dev libxfixes-dev libxrandr-dev libjpeg-dev libfuse-dev nasm libopus-dev
# Get XRDP
if [ ! -d $XRDP_PATH ]; then
@ -46,53 +48,55 @@ if [ ! -d $XRDP_PATH ]; then
fi
# Configure XRDP
cd $XRDP_PATH
cd $XRDP_PATH || exit
./bootstrap
./configure --enable-vsock --enable-jpeg --enable-fuse
./configure --enable-ipv6 --enable-jpeg --enable-fuse --enable-rfxcodec --enable-opus --enable-painter --enable-vsock
# Build/Install XRDP
make
sudo make install
make install
# Configure the installed XRDP ini files.
# use vsock transport.
sudo sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini
sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini
# use rdp security.
sudo sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini
sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini
# remove encryption validation.
sudo sed -i_orig -e 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini
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
sudo sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini
sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini
#
# sudo sed -n -e 's/max_bpp=32/max_bpp=24/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
# sudo sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/g' /etc/xrdp/sesman.ini
# 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
# 16.04.3 changed the allowed_users
sudo sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
# reconfigure the service
sudo systemctl daemon-reload
sudo systemctl enable xrdp.service
sudo systemctl enable xrdp-sesman.service
systemctl daemon-reload
systemctl enable xrdp.service
systemctl enable xrdp-sesman.service
# Configure the policy xrdp session
sudo bash -c 'cat >/etc/polkit-1/localauthority.conf.d/02-allow-colord.conf <<EOF
# 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
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'
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
#
# End XRDP
@ -104,11 +108,11 @@ EOF'
export XORGXRDP_PATH=~/git/src/github.com/neutrinolabs/xorgxrdp
# Get XORGXRDP requirements
sudo apt install -y autoconf libtool xserver-xorg-core xserver-xorg-dev
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
sudo apt install -y libxfont1-dev
apt install -y libxfont1-dev
fi
# Get XORGXRDP
@ -117,13 +121,16 @@ if [ ! -d $XORGXRDP_PATH ]; then
fi
# Configure XORGXRDP
cd $XORGXRDP_PATH
cd $XORGXRDP_PATH || exit
./bootstrap
./configure
# Build/Install XORGXRDP
make
sudo make install
make install
#Installing xorgxrdp knocks out ubuntu-desktop from running. We need to reinstall it
apt-get install -y --reinstall ubuntu-desktop
#
# End XORGXRDP

View File

@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash
#
# This script is for Ubuntu 18.04 Bionic Beaver to download and install XRDP+XORGXRDP via
@ -7,118 +7,102 @@
# 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.
#
sudo apt update
sudo apt upgrade -y
if [ "$(id -u)" -ne 0 ]; then
echo 'This script must be run with root privileges' >&2
exit 1
fi
# Get git if we dont have it.
sudo apt install -y git
# TODO: Remove the custom kernel logic when 18.04 supports hv_sock by default.
sudo add-apt-repository ppa:billy-olsen/test-kernels-bionic
sudo apt-get update
sudo apt install linux-image-4.14.0-17-generic
apt update && apt upgrade -y
if [ -f /var/run/reboot-required ]; then
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
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
#
export XRDP_PATH=~/git/src/github.com/neutrinolabs/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
sudo apt install -y xrdp
apt install -y xrdp
# Get XRDP requirements
# ./bootstrap requirements 'autoconf libtool pkg-config'
# ./configure requirements 'libssl-dev libpam0g-dev libjpeg-dev libfuse-dev libx11-dev libxfixes-dev libxrandr-dev nasm'
sudo apt install -y autoconf libtool pkg-config libssl-dev libpam0g-dev libjpeg-dev libfuse-dev libx11-dev libxfixes-dev libxrandr-dev nasm
# Get XRDP
if [ ! -d $XRDP_PATH ]; then
git clone https://github.com/neutrinolabs/xrdp $XRDP_PATH
fi
# Configure XRDP
cd $XRDP_PATH
./bootstrap
./configure --enable-vsock --enable-jpeg --enable-fuse
sudo systemctl stop xrdp
sudo systemctl stop xrdp-sesman
# Build/Install XRDP
make
sudo make install
systemctl stop xrdp
systemctl stop xrdp-sesman
# Configure the installed XRDP ini files.
# use vsock transport.
sudo sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini
sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini
# use rdp security.
sudo sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini
sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini
# remove encryption validation.
sudo sed -i_orig -e 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini
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
sudo sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini
sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini
# use the default lightdm x display
# sudo sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/g' /etc/xrdp/sesman.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
# Changed the allowed_users
sudo sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
# Enable the hv_sock module
sudo rmmod vmw_vsock_vmci_transport
sudo rmmod vsock
sudo modprobe hv_sock
sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
# Blacklist the vmw module
sudo bash -c 'echo "blacklist vmw_vsock_vmci_transport" >> /etc/modprobe.d/blacklist.conf <<EOF
EOF'
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
sudo bash -c 'echo "hv_sock" >> /etc/modules <<EOF
EOF'
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
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'
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
sudo systemctl daemon-reload
sudo systemctl start xrdp
systemctl daemon-reload
systemctl start xrdp
#
# End XRDP
###############################################################################
# Install Gmone Tweak
sudo apt-get install gnome-tweak-tool -y
echo
echo "Install is complete."
echo "Reboot your machine to begin using XRDP."
echo

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
wiki/media/downloadvm.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
wiki/media/quickcreate.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

BIN
wiki/media/vmconnect.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 KiB

BIN
wiki/media/vmstart.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
wiki/media/xorglogin.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
wiki/media/xrdplogin.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB