mirror of
https://github.com/microsoft/linux-vm-tools
synced 2025-08-22 10:17:15 +00:00
Testing
This commit is contained in:
parent
6ca022d4f0
commit
3c52b74e64
24
ubuntu/16.04/config-user.sh
Normal file
24
ubuntu/16.04/config-user.sh
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
#
|
||||||
|
# This script configures the logged in users xsession to properly
|
||||||
|
# configure unity to launch
|
||||||
|
#
|
||||||
|
# Major thanks to: http://c-nergy.be/blog/?p=10752 for the tips.
|
||||||
|
#
|
||||||
|
|
||||||
|
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 &
|
||||||
|
/usr/lib/unity-settings-daemon/unity-settings-daemon &
|
||||||
|
|
||||||
|
for indicator in /usr/lib/x86_64-linux-gnu/indicator-*;
|
||||||
|
do
|
||||||
|
basename='basename \${indicator}'
|
||||||
|
dirname='dirname \${indicator}'
|
||||||
|
service=\${dirname}/\${basename}/\${basename}-service
|
||||||
|
\${service} &
|
||||||
|
done
|
||||||
|
unity
|
||||||
|
EOF"
|
@ -1,5 +1,12 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
|
#
|
||||||
|
# This script is for Ubuntu 16.04+ to download and install XRDP+XORGXRDP via
|
||||||
|
# source.
|
||||||
|
#
|
||||||
|
# Major thanks to: http://c-nergy.be/blog/?p=10752 for the tips.
|
||||||
|
#
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Update our machine to the latest code if we need to.
|
# Update our machine to the latest code if we need to.
|
||||||
#
|
#
|
||||||
@ -20,16 +27,21 @@ fi
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# XRDP
|
# XRDP
|
||||||
#
|
#
|
||||||
|
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
|
||||||
|
|
||||||
# Get XRDP requirements
|
# Get XRDP requirements
|
||||||
sudo apt install -y autoconf libtool libssl-dev libpam0g-dev libx11-dev libxfixes-dev libxrandr-dev libjpeg-dev libfuse-dev nasm
|
sudo apt install -y autoconf libtool libssl-dev libpam0g-dev libx11-dev libxfixes-dev libxrandr-dev libjpeg-dev libfuse-dev nasm
|
||||||
# sudo apt install -y xrdp
|
|
||||||
|
|
||||||
# Get XRDP
|
# Get XRDP
|
||||||
git clone https://github.com/neutrinolabs/xrdp ~/git/xrdp
|
if [ ! -f $XRDP_PATH ]; then
|
||||||
|
git clone https://github.com/neutrinolabs/xrdp $XRDP_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
# Configure XRDP
|
# Configure XRDP
|
||||||
cd ~/git/xrdp
|
cd $XRDP_PATH
|
||||||
./bootstrap
|
./bootstrap
|
||||||
./configure --enable-vsock --enable-jpeg --enable-fuse
|
./configure --enable-vsock --enable-jpeg --enable-fuse
|
||||||
|
|
||||||
@ -47,7 +59,32 @@ sudo sed -i_orig -e 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini
|
|||||||
# sudo 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
|
# use the default lightdm x display
|
||||||
sudo sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/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
|
||||||
|
sudo 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
|
||||||
|
|
||||||
|
# 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'
|
||||||
|
|
||||||
#
|
#
|
||||||
# End XRDP
|
# End XRDP
|
||||||
@ -56,16 +93,23 @@ sudo sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/g' /etc/xrdp/sesma
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# XORGXRDP
|
# XORGXRDP
|
||||||
#
|
#
|
||||||
|
export XORGXRDP_PATH=~/git/src/github.com/neutrinolabs/xorgxrdp
|
||||||
|
|
||||||
# Get XORGXRDP requirements
|
# Get XORGXRDP requirements
|
||||||
sudo apt install -y autoconf libtool xserver-xorg-dev libxfont1-dev
|
sudo apt install -y autoconf libtool xserver-xorg-core xserver-xorg-dev
|
||||||
# sudo apt install -y xorgxrdp
|
|
||||||
|
# 16.04.3 is missing fontutil.h
|
||||||
|
if [ ! -f /usr/include/X11/fonts/fontutil.h ]; then
|
||||||
|
sudo apt install -y libxfont1-dev
|
||||||
|
fi
|
||||||
|
|
||||||
# Get XORGXRDP
|
# Get XORGXRDP
|
||||||
git clone https://github.com/neutrinolabs/xorgxrdp ~/git/xorgxrdp
|
if [ ! -f $XORGXRDP_PATH ]; then
|
||||||
|
git clone https://github.com/neutrinolabs/xorgxrdp $XORGXRDP_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
# Configure XORGXRDP
|
# Configure XORGXRDP
|
||||||
cd ~/git/xorgxrdp
|
cd $XORGXRDP_PATH
|
||||||
./bootstrap
|
./bootstrap
|
||||||
./configure
|
./configure
|
||||||
|
|
||||||
@ -77,17 +121,7 @@ sudo make install
|
|||||||
# End XORGXRDP
|
# End XORGXRDP
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# configure lightdm to use xrdp's xorg.conf on startup.
|
|
||||||
|
|
||||||
if [ -f /etc/lightdm/lightdm.conf ]; then
|
|
||||||
sudo grep -f /etc/lightdm/lightdm.conf "xserver-config=/etc/X11/xrdp/xorg.conf"
|
|
||||||
if [ "$?" != "0" ]; then
|
|
||||||
echo "xserver-config=/etc/X11/xrdp/xorg.conf" | sudo tee --append /etc/lightdm/lightdm.conf > /dev/null
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# No lightdm config file.
|
|
||||||
echo "[Seat:*]" > sudo tee /etc/lightdm/lightdm.conf > /dev/null
|
|
||||||
echo "xserver-config=/etc/X11/xrdp/xorg.conf" | sudo tee --append /etc/lightdm/lightdm.conf > /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
#reboot
|
#reboot
|
||||||
|
echo
|
||||||
|
echo "Reboot your machine to begin using XRDP"
|
||||||
|
echo
|
Loading…
x
Reference in New Issue
Block a user