Skip to content

Commit 7307d7c

Browse files
author
Yutaro-B18016
authored
Merge pull request #5 from Yutaro-B18016:add-support-for-ubuntu-19.04-and-kali-linux
add support for ubuntu 19.04 and kali linux
2 parents 79486dd + 3adeb0e commit 7307d7c

3 files changed

Lines changed: 256 additions & 0 deletions

File tree

kali/2019.x/install.sh

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/bash
2+
# Original : https://raw.githubusercontent.com/Microsoft/linux-vm-tools/master/arch/install-config.sh
3+
4+
###############################################################################
5+
# Update our machine to the latest code if we need to.
6+
#
7+
8+
if [ "$(id -u)" -ne 0 ]; then
9+
echo 'This script must be run with root privileges' >&2
10+
exit 1
11+
fi
12+
13+
apt update && apt upgrade -y
14+
15+
if [ -f /var/run/reboot-required ]; then
16+
echo "A reboot is required in order to proceed with the install." >&2
17+
echo "Please reboot and re-run this script to finish the install." >&2
18+
exit 1
19+
fi
20+
21+
###############################################################################
22+
# Install XRDP
23+
#
24+
apt install -y xrdp
25+
26+
###############################################################################
27+
# Configure XRDP
28+
#
29+
systemctl enable xrdp
30+
systemctl enable xrdp-sesman
31+
32+
# Configure the installed XRDP ini files.
33+
# use vsock transport.
34+
sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini
35+
# use rdp security.
36+
sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini
37+
# remove encryption validation.
38+
sed -i_orig -e 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini
39+
# disable bitmap compression since its local its much faster
40+
sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini
41+
sed -n -e 's/max_bpp=32/max_bpp=24/g' /etc/xrdp/xrdp.ini
42+
sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/g' /etc/xrdp/sesman.ini
43+
# rename the redirected drives to 'shared-drives'
44+
sed -i_orig -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini
45+
46+
# Change the allowed_users
47+
echo "allowed_users=anybody" > /etc/X11/Xwrapper.config
48+
49+
50+
#Ensure hv_sock gets loaded
51+
if [ ! -e /etc/modules-load.d/hv_sock.conf ]; then
52+
echo "hv_sock" > /etc/modules-load.d/hv_sock.conf
53+
fi
54+
55+
# Configure the policy xrdp session
56+
cat > /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla <<EOF
57+
[Allow Colord all Users]
58+
Identity=unix-user:*
59+
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
60+
ResultAny=no
61+
ResultInactive=no
62+
ResultActive=yes
63+
EOF
64+
65+
###############################################################################
66+
# .xinitrc has to be modified manually.
67+
#
68+
#echo "exec gnome-session" > ~/.xinitrc
69+
echo "exec startxfce4" > ~/.xinitrc
70+
echo "You will have to configure .xinitrc to start your windows manager, see https://wiki.archlinux.org/index.php/Xinit"
71+
echo "Reboot your machine to begin using XRDP."

kali/2020.x/install.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
# Original : https://raw.githubusercontent.com/Microsoft/linux-vm-tools/master/arch/install-config.sh
3+
4+
###############################################################################
5+
# Update our machine to the latest code if we need to.
6+
#
7+
8+
if [ "$(id -u)" -ne 0 ]; then
9+
echo 'This script must be run with root privileges' >&2
10+
exit 1
11+
fi
12+
13+
apt update && apt upgrade -y
14+
15+
if [ -f /var/run/reboot-required ]; then
16+
echo "A reboot is required in order to proceed with the install." >&2
17+
echo "Please reboot and re-run this script to finish the install." >&2
18+
exit 1
19+
fi
20+
21+
###############################################################################
22+
# Install XRDP
23+
#
24+
apt install -y xrdp
25+
26+
###############################################################################
27+
# Configure XRDP
28+
#
29+
systemctl enable xrdp
30+
systemctl enable xrdp-sesman
31+
32+
# Configure the installed XRDP ini files.
33+
# use vsock transport.
34+
# sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini
35+
sed -i_orig -e 's/port=3389/port=vsock:\/\/-1:3389/g' /etc/xrdp/xrdp.ini
36+
# use rdp security.
37+
sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini
38+
# remove encryption validation.
39+
sed -i_orig -e 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini
40+
# disable bitmap compression since its local its much faster
41+
sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini
42+
sed -n -e 's/max_bpp=32/max_bpp=24/g' /etc/xrdp/xrdp.ini
43+
sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/g' /etc/xrdp/sesman.ini
44+
# rename the redirected drives to 'shared-drives'
45+
sed -i_orig -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini
46+
47+
# Change the allowed_users
48+
echo "allowed_users=anybody" > /etc/X11/Xwrapper.config
49+
50+
51+
#Ensure hv_sock gets loaded
52+
if [ ! -e /etc/modules-load.d/hv_sock.conf ]; then
53+
echo "hv_sock" > /etc/modules-load.d/hv_sock.conf
54+
fi
55+
56+
# Configure the policy xrdp session
57+
cat > /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla <<EOF
58+
[Allow Colord all Users]
59+
Identity=unix-user:*
60+
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
61+
ResultAny=no
62+
ResultInactive=no
63+
ResultActive=yes
64+
EOF
65+
66+
###############################################################################
67+
# .xinitrc has to be modified manually.
68+
#
69+
#echo "exec gnome-session" > ~/.xinitrc
70+
#echo "exec startxfce4" > ~/.xinitrc
71+
#echo "You will have to configure .xinitrc to start your windows manager, see https://wiki.archlinux.org/index.php/Xinit"
72+
echo "Reboot your machine to begin using XRDP."

ubuntu/19.04/install.sh

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
#!/bin/bash
2+
3+
#
4+
# This script is for Ubuntu 18.04 Bionic Beaver to download and install XRDP+XORGXRDP via
5+
# source.
6+
#
7+
# Major thanks to: http://c-nergy.be/blog/?p=11336 for the tips.
8+
#
9+
10+
###############################################################################
11+
# Update our machine to the latest code if we need to.
12+
#
13+
14+
if [ "$(id -u)" -ne 0 ]; then
15+
echo 'This script must be run with root privileges' >&2
16+
exit 1
17+
fi
18+
19+
apt update && apt upgrade -y
20+
21+
if [ -f /var/run/reboot-required ]; then
22+
echo "A reboot is required in order to proceed with the install." >&2
23+
echo "Please reboot and re-run this script to finish the install." >&2
24+
exit 1
25+
fi
26+
27+
###############################################################################
28+
# XRDP
29+
#
30+
31+
# Install hv_kvp utils
32+
apt install -y linux-tools-virtual
33+
apt install -y linux-cloud-tools-virtual
34+
35+
# Install the xrdp service so we have the auto start behavior
36+
apt install -y xrdp
37+
38+
systemctl stop xrdp
39+
systemctl stop xrdp-sesman
40+
41+
# Configure the installed XRDP ini files.
42+
# use vsock transport.
43+
sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini
44+
# use rdp security.
45+
sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini
46+
# remove encryption validation.
47+
sed -i_orig -e 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini
48+
# disable bitmap compression since its local its much faster
49+
sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini
50+
51+
# Add script to setup the ubuntu session properly
52+
if [ ! -e /etc/xrdp/startubuntu.sh ]; then
53+
cat >> /etc/xrdp/startubuntu.sh << EOF
54+
#!/bin/sh
55+
export GNOME_SHELL_SESSION_MODE=ubuntu
56+
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
57+
exec /etc/xrdp/startwm.sh
58+
EOF
59+
chmod a+x /etc/xrdp/startubuntu.sh
60+
fi
61+
62+
# use the script to setup the ubuntu session
63+
sed -i_orig -e 's/startwm/startubuntu/g' /etc/xrdp/sesman.ini
64+
65+
# rename the redirected drives to 'shared-drives'
66+
sed -i -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini
67+
68+
# Changed the allowed_users
69+
sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
70+
71+
# Blacklist the vmw module
72+
if [ ! -e /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf ]; then
73+
cat >> /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf <<EOF
74+
blacklist vmw_vsock_vmci_transport
75+
EOF
76+
fi
77+
78+
#Ensure hv_sock gets loaded
79+
if [ ! -e /etc/modules-load.d/hv_sock.conf ]; then
80+
echo "hv_sock" > /etc/modules-load.d/hv_sock.conf
81+
fi
82+
83+
# Configure the policy xrdp session
84+
cat > /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla <<EOF
85+
[Allow Colord all Users]
86+
Identity=unix-user:*
87+
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
88+
ResultAny=no
89+
ResultInactive=no
90+
ResultActive=yes
91+
EOF
92+
93+
# reconfigure the service
94+
systemctl daemon-reload
95+
systemctl start xrdp
96+
97+
#
98+
# End XRDP
99+
###############################################################################
100+
101+
###############################################################################
102+
# GDM (added code)
103+
#
104+
105+
# Stop to use wayland.
106+
sed -i_orig -e 's/#WaylandEnable=false/WaylandEnable=false/g' /etc/gdm3/custom.conf
107+
108+
#
109+
# End GDM
110+
###############################################################################
111+
112+
echo "Install is complete."
113+
echo "Reboot your machine to begin using XRDP."

0 commit comments

Comments
 (0)