-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-ubuntu-desktop.sh
75 lines (57 loc) · 2.8 KB
/
install-ubuntu-desktop.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# ===================================================================
# Purpose: To automate the install of xRDP and GNOM.
# Parameters: None
# Author: Jason Vriends
# Notes: Tested against Ubuntu 18.04-LTS on Microsoft Azure as a Linux Custom Script Extension.
# ===================================================================
# Update package list
apt-get update
# Install GNOME
apt-get install -y ubuntu-gnome-desktop
# Install XRDP
apt-get install -y xrdp
# Disable newcursors because black background around cursor is displayed if using Xorg as session type.
sed -e 's/^new_cursors=true/new_cursors=false/g' -i /etc/xrdp/xrdp.ini
systemctl restart xrdp
# Create ~/.xsessionrc Create ~/.xsessionrc which will export the environment variable for customized settings for Ubuntu.
D=/usr/share/ubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop
cat <<EOF > ~/.xsessionrc
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_DATA_DIRS=${D}
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
EOF
# Authentication Required Dialog If using Xorg as session type, Authentication Required dialog will be displayed after creating session.
cat <<EOF | tee /etc/polkit-1/localauthority/50-local.d/xrdp-color-manager.pkla
[Netowrkmanager]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device
ResultAny=no
ResultInactive=no
ResultActive=yes
EOF
sudo systemctl restart polkit
# Install GNOME Extensions
## Download Taskbar
wget -O /tmp/taskbar.zip "https://extensions.gnome.org/review/download/8043.shell-extension.zip"
## Extract TaskBar
sudo mkdir -p /usr/share/gnome-shell/extensions/TaskBar@zpydr/
sudo unzip /tmp/taskbar.zip -d /usr/share/gnome-shell/extensions/TaskBar@zpydr/
## Enable TaskBar
gsettings get org.gnome.shell enabled-extensions
gsettings set org.gnome.shell enabled-extensions "['[email protected]', '[email protected]', 'TaskBar@zpydr']"
cd /home/vmadmin/
# Download and set chmod 755 to Hyperledger composer prereqs script
curl -O https://hyperledger.github.io/composer/latest/prereqs-ubuntu.sh
chmod a+x prereqs-ubuntu.sh
## Download desktop setup scripts
wget https://raw.githubusercontent.com/nirubank/azure-virtualmachine-extensions/master/install-ubuntu-desktop.sh
chmod a+x install-ubuntu-desktop.sh
## Download and set chmod 755 to Hyperledger composer setup script
wget https://raw.githubusercontent.com/nirubank/azure-virtualmachine-extensions/master/setupComposer.sh
chmod a+x setupComposer.sh
## Download and set chmod 755 to Visual studio code setup script
wget https://raw.githubusercontent.com/nirubank/azure-virtualmachine-extensions/master/install-vscode.sh
chmod a+x install-vscode.sh
wget https://raw.githubusercontent.com/nirubank/dltWorkshop/master/BlockchainOnCloudLabGuide.docx