Skip to content

Instantly share code, notes, and snippets.

@alextercete
Last active April 2, 2020 15:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alextercete/d110d6ee3542ff9434a00100985898d0 to your computer and use it in GitHub Desktop.
Save alextercete/d110d6ee3542ff9434a00100985898d0 to your computer and use it in GitHub Desktop.

WSL 1, Docker and Vagrant+Virtualbox

Set up Windows

  1. Install docker-machine

  2. Create a Docker machine named default, sharing D:\ (only one drive can be specified):

    docker-machine.exe create default --virtualbox-share-folder "d:\\:/d"

    If the command above fails with "This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory", add the --virtualbox-no-vtx-check option and try again.

Set up WSL

  1. Create /etc/wsl.conf with:

    [automount]
    root = /
    options = "metadata"
    
  2. Add the following to your ~/.bashrc:

    if [ "$(docker-machine.exe status default)" = "Stopped" ]; then
        docker-machine.exe start default
    fi
    eval $(docker-machine.exe env default --shell bash)
    export DOCKER_CERT_PATH=$(wslpath $DOCKER_CERT_PATH)
    export COMPOSE_CONVERT_WINDOWS_PATHS=false

Known issues

  • Volumes only work if the host path is under D:\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment