From 57f420e0e0bd53702535788c6f164d161f63d876 Mon Sep 17 00:00:00 2001 From: Arnie Date: Wed, 22 Aug 2018 08:50:21 +0200 Subject: [PATCH] Add automount path fix --- windows/install-docker-in-wsl.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/windows/install-docker-in-wsl.sh b/windows/install-docker-in-wsl.sh index 64c9092..fd18291 100755 --- a/windows/install-docker-in-wsl.sh +++ b/windows/install-docker-in-wsl.sh @@ -221,6 +221,24 @@ installDockerCompose() { return 0 } +mapAutomountPaths() { + local continue + + echo "Are you running windows version 18.03 or later? y/[n]" + read continue + + [[ "${continue}" != "" ]] && [[ "${continue}" != "y" ]] && [[ "${continue}" != "Y" ]] && return 0 + + cat << EOF | sudo tee /etc/wsl.conf > /dev/null +[automount] +root = / +options = "metadata" +EOF + + echo "Please restart your computer, after the restart the volumes will be mounted in /c/, /d/, etc. instead of /mnt/c/, /mnt/d/..." + +} + initialize() { installDocker [[ $? -ne 0 ]] && echo "Could not install Docker" && return 137 @@ -237,6 +255,9 @@ initialize() { installDockerCompose [[ $? -ne 0 ]] && echo "Could not install docker compose" && return 137 + mapAutomountPaths + [[ $? -ne 0 ]] && echo "Could not map the volume paths properly" && return 137 + return 0 }