├── wiki └── media │ ├── vmconnect.PNG │ ├── vmstart.PNG │ ├── xorglogin.PNG │ ├── xrdplogin.PNG │ ├── downloadvm.PNG │ ├── quickcreate.PNG │ ├── connectPrompt.PNG │ └── galleryinmenu.png ├── README.md ├── ubuntu ├── 16.04 │ ├── config-user.sh │ └── install.sh └── 18.04 │ └── install.sh ├── LICENSE └── arch ├── makepkg.sh └── install-config.sh /wiki/media/vmconnect.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/linux-vm-tools/HEAD/wiki/media/vmconnect.PNG -------------------------------------------------------------------------------- /wiki/media/vmstart.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/linux-vm-tools/HEAD/wiki/media/vmstart.PNG -------------------------------------------------------------------------------- /wiki/media/xorglogin.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/linux-vm-tools/HEAD/wiki/media/xorglogin.PNG -------------------------------------------------------------------------------- /wiki/media/xrdplogin.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/linux-vm-tools/HEAD/wiki/media/xrdplogin.PNG -------------------------------------------------------------------------------- /wiki/media/downloadvm.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/linux-vm-tools/HEAD/wiki/media/downloadvm.PNG -------------------------------------------------------------------------------- /wiki/media/quickcreate.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/linux-vm-tools/HEAD/wiki/media/quickcreate.PNG -------------------------------------------------------------------------------- /wiki/media/connectPrompt.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/linux-vm-tools/HEAD/wiki/media/connectPrompt.PNG -------------------------------------------------------------------------------- /wiki/media/galleryinmenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/linux-vm-tools/HEAD/wiki/media/galleryinmenu.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This Repo Has Been Archived 2 | 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). 3 | -------------------------------------------------------------------------------- /ubuntu/16.04/config-user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # This script configures the logged in users xsession to properly 5 | # configure unity to launch 6 | # 7 | # Major thanks to: http://c-nergy.be/blog/?p=10752 for the tips. 8 | # 9 | 10 | if [ ! "$(id -u)" ]; then 11 | echo 'This script must be run with root privileges' >&2 12 | exit 1 13 | fi 14 | 15 | bash -c "cat > ~/.xsession <&2 9 | exit 1 10 | fi 11 | 12 | ############################################################################### 13 | # Prepare by installing build tools. 14 | # 15 | # Partial upgrades aren't supported in arch. 16 | sudo pacman -Syu --needed --noconfirm base base-devel git 17 | 18 | # Create a build directory in tmpfs 19 | TMPDIR=$(mktemp -d) 20 | pushd "$TMPDIR" || exit 21 | 22 | ############################################################################### 23 | # XRDP 24 | # 25 | ( 26 | git clone https://aur.archlinux.org/xrdp.git 27 | cd xrdp || exit 28 | makepkg -sri --noconfirm 29 | ) 30 | ############################################################################### 31 | # XORGXRDP 32 | # Devel version, because release version includes a bug crashing gnome-settings-daemon 33 | ( 34 | git clone https://aur.archlinux.org/xorgxrdp-devel-git.git 35 | cd xorgxrdp-devel-git || exit 36 | makepkg -sri --noconfirm 37 | ) 38 | ############################################################################### 39 | 40 | #remove build directory 41 | rm -rf $TMPDIR 42 | -------------------------------------------------------------------------------- /arch/install-config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # This script is for Arch Linux to configure XRDP for enhanced session mode 5 | # 6 | # The configuration is adapted from the Ubuntu 16.04 script. 7 | # 8 | 9 | if [ "$(id -u)" -ne 0 ]; then 10 | echo 'This script must be run with root privileges' >&2 11 | exit 1 12 | fi 13 | 14 | # Use Qi to check for exact package name 15 | if ! pacman -Qi xrdp > /dev/null ; then 16 | echo 'xrdp not installed. Run makepkg.sh first to install xrdp.' >&2 17 | exit 1 18 | fi 19 | 20 | # Use Qs to allow xorgxrdp-devel-git 21 | if ! pacman -Qs xorgxrdp > /dev/null ; then 22 | echo 'xorgxrdp not installed. Run makepkg.sh first to install xorgxrdp.' >&2 23 | exit 1 24 | fi 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/port=3389/port=vsock:\/\/-1:3389/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 | # 42 | # sed -n -e 's/max_bpp=32/max_bpp=24/g' /etc/xrdp/xrdp.ini 43 | 44 | # use the default lightdm x display 45 | # sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/g' /etc/xrdp/sesman.ini 46 | # rename the redirected drives to 'shared-drives' 47 | sed -i_orig -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini 48 | 49 | # Change the allowed_users 50 | echo "allowed_users=anybody" > /etc/X11/Xwrapper.config 51 | 52 | 53 | #Ensure hv_sock gets loaded 54 | if [ ! -e /etc/modules-load.d/hv_sock.conf ]; then 55 | echo "hv_sock" > /etc/modules-load.d/hv_sock.conf 56 | fi 57 | 58 | # Configure the policy xrdp session 59 | cat > /etc/polkit-1/rules.d/02-allow-colord.rules < /etc/pam.d/xrdp-sesman <&2 22 | exit 1 23 | fi 24 | 25 | apt update && apt upgrade -y 26 | 27 | if [ -f /var/run/reboot-required ]; then 28 | echo "A reboot is required in order to proceed with the install." >&2 29 | echo "Please reboot and re-run this script to finish the install." >&2 30 | exit 1 31 | fi 32 | 33 | ############################################################################### 34 | # XRDP 35 | # 36 | 37 | # Install hv_kvp utils 38 | apt install -y linux-tools-virtual${HWE} 39 | apt install -y linux-cloud-tools-virtual${HWE} 40 | 41 | # Install the xrdp service so we have the auto start behavior 42 | apt install -y xrdp 43 | 44 | systemctl stop xrdp 45 | systemctl stop xrdp-sesman 46 | 47 | # Configure the installed XRDP ini files. 48 | # use vsock transport. 49 | sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini 50 | # use rdp security. 51 | sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini 52 | # remove encryption validation. 53 | sed -i_orig -e 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini 54 | # disable bitmap compression since its local its much faster 55 | sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini 56 | 57 | # Add script to setup the ubuntu session properly 58 | if [ ! -e /etc/xrdp/startubuntu.sh ]; then 59 | cat >> /etc/xrdp/startubuntu.sh << EOF 60 | #!/bin/sh 61 | export GNOME_SHELL_SESSION_MODE=ubuntu 62 | export XDG_CURRENT_DESKTOP=ubuntu:GNOME 63 | exec /etc/xrdp/startwm.sh 64 | EOF 65 | chmod a+x /etc/xrdp/startubuntu.sh 66 | fi 67 | 68 | # use the script to setup the ubuntu session 69 | sed -i_orig -e 's/startwm/startubuntu/g' /etc/xrdp/sesman.ini 70 | 71 | # rename the redirected drives to 'shared-drives' 72 | sed -i -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini 73 | 74 | # Changed the allowed_users 75 | sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config 76 | 77 | # Blacklist the vmw module 78 | if [ ! -e /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf ]; then 79 | cat >> /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf < /etc/modules-load.d/hv_sock.conf 87 | fi 88 | 89 | # Configure the policy xrdp session 90 | cat > /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla <&2 16 | exit 1 17 | fi 18 | 19 | apt update 20 | apt upgrade -y 21 | 22 | # Get git if we dont have it. 23 | apt install -y git 24 | 25 | # Get the linux-azure kernel to add hyper-v sockets to the guest 26 | apt install -y linux-azure 27 | 28 | if [ -f /var/run/reboot-required ]; then 29 | echo "A reboot is required in order to proceed with the install." >&2 30 | echo "Please reboot and re-run this script to finish the install." >&2 31 | exit 1 32 | fi 33 | 34 | ############################################################################### 35 | # XRDP 36 | # 37 | export XRDP_PATH=~/git/src/github.com/neutrinolabs/xrdp 38 | 39 | # Install the xrdp service so we have the auto start behavior 40 | apt install -y xrdp 41 | 42 | # Get XRDP requirements 43 | apt install -y autoconf libtool libssl-dev libpam0g-dev libx11-dev libxfixes-dev libxrandr-dev libjpeg-dev libfuse-dev nasm libopus-dev 44 | 45 | # Get XRDP 46 | if [ ! -d $XRDP_PATH ]; then 47 | git clone https://github.com/neutrinolabs/xrdp $XRDP_PATH 48 | fi 49 | 50 | # Configure XRDP 51 | cd $XRDP_PATH || exit 52 | ./bootstrap 53 | ./configure --enable-ipv6 --enable-jpeg --enable-fuse --enable-rfxcodec --enable-opus --enable-painter --enable-vsock 54 | 55 | # Build/Install XRDP 56 | make 57 | make install 58 | 59 | # Configure the installed XRDP ini files. 60 | # use vsock transport. 61 | sed -i_orig -e 's/use_vsock=false/use_vsock=true/g' /etc/xrdp/xrdp.ini 62 | # use rdp security. 63 | sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini 64 | # remove encryption validation. 65 | sed -i_orig -e 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini 66 | # disable bitmap compression since its local its much faster 67 | sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini 68 | # 69 | # sed -n -e 's/max_bpp=32/max_bpp=24/g' /etc/xrdp/xrdp.ini 70 | 71 | # use the default lightdm x display 72 | # sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/g' /etc/xrdp/sesman.ini 73 | 74 | # rename the redirected drives to 'shared-drives' 75 | sed -i_orig -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini 76 | 77 | # 16.04.3 changed the allowed_users 78 | sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config 79 | 80 | # reconfigure the service 81 | systemctl daemon-reload 82 | systemctl enable xrdp.service 83 | systemctl enable xrdp-sesman.service 84 | 85 | # Configure the policy xrdp session 86 | # polkit policy definition language changes depending on its version. See issue #61 87 | if [[ "$(pkaction --version | sed -E 's/^[[:alnum:] ]*([[:digit:]]+.*)/\1/' - )" != '0.105' ]]; then 88 | echo "Error: Policy rule specification probably invalid. Expected version: 0.105 detected $(pkaction --version)." >&2 89 | exit 1 90 | fi 91 | 92 | cat > /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla <