star3am / hashiqube

HashiQube - The Ultimate Hands on DevOps Lab running All the HashiCorp Products in a Github Codespace or a Docker Container using Vagrant or Docker Compose
https://hashiqube.com
Other
93 stars 41 forks source link

unable to setup with wsl2 #16

Closed hnmn closed 10 months ago

hnmn commented 11 months ago

hi, thanks for awesome project. i have docker install without docker desktop on wsl and vagrant with export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1" export VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH

but getting below

A Docker command executed by Vagrant didn't complete successfully!
The command run along with the output from the command is shown
below.

Command: ["docker", "run", "--name", "hashiqube_hashiqube0_1699528351", "-d", "-e", "PROVIDER=docker", "-e", "NAME=hashiqube", "-p", "2255:22", "-p", "3000:3000", "-p", "9090:9090", "-p", "9093:9093", "-p", "8200:8200", "-p", "8201:8201", "-p", "4646:4646", "-p", "4647:4647", "-p", "4648:4648", "-p", "8082:8082", "-p", "8081:8081", "-p", "19702:19702", "-p", "19701:19701", "-p", "9702:9702", "-p", "9701:9701", "-p", "19200:19200", "-p", "8500:8500", "-p", "8501:8501", "-p", "8502:8502", "-p", "8300:8300", "-p", "8301:8301", "-p", "8302:8302", "-p", "8600:8600/udp", "-p", "9200:9200", "-p", "5601:5601", "-p", "5602:5602", "-p", "8888:8888", "-p", "8889:8889", "-p", "5001:5001", "-p", "5002:5002", "-p", "33389:389", "-p", "4566:4566", "-p", "8088:8088", "-p", "9002:9002", "-p", "9001:9001", "-p", "9022:9022", "-p", "9011:9011", "-p", "3306:3306", "-p", "5432:5432", "-p", "1433:1433", "-p", "9998:9998", "-p", "9999:9999", "-p", "9333:9333", "-p", "10888:10888", "-p", "11888:11888", "-p", "18080:18080", "-p", "18181:18181", "-p", "31506:31506", "-p", "18888:18888", "-p", "18889:18889", "-p", "3333:3333", "-p", "8043:8043", "-p", "5580:5580", "-p", "8181:8181", "-p", "32022:32022", "-p", "7777:7777", "-p", "28080:28080", "-p", "8100:8100", "-p", "3001:3001", "-p", "6001:6001", "-v", "C:\\Users\\hnmn\\Desktop\\learn:/osdata", "-v", "C:\\Users\\hnmn\\Desktop\\learn\\learn-hashicorp\\hashiqube\\jenkins\\jenkins_home:/var/jenkins_home", "-v", "C:\\Users\\hnmn\\Desktop\\learn\\learn-hashicorp\\hashiqube:/vagrant", "--privileged", "-h", "hashiqube0", "-v", "/sys/fs/cgroup:/sys/fs/cgroup:rw", "--cgroupns=host", "--tmpfs=/tmp:exec,dev", "--tmpfs=/var/lib/docker:mode=0777,dev,size=15g,suid,exec", "--tmpfs=/run", "--tmpfs=/run/lock", "fa6d954ff46b1ee585d0e27b1af48b34a8a5fd058b65b24a9d8d7662ce681a03", {:notify=>[:stdout, :stderr]}]

Stderr: docker: Error response from daemon: invalid mode: /vagrant.
See 'docker run --help'.

Stdout:

i saw this line causing problem. also i cannot install docker desktop because of license on corp system.

 "C:\\Users\\hnmn\\Desktop\\learn:/osdata", "-v", "C:\\Users\\hnmn\\Desktop\\learn\\learn-hashicorp\\hashiqube\\jenkins\\jenkins_home:/var/jenkins_home", "-v", "C:\\Users\\hnmn\\Desktop\\learn\\learn-hashicorp\\hashiqube:/vagrant"

any insights?

star3am commented 10 months ago

Good morning @hnmn thank you for opening this issue,

Can you use Virtualbox? and do vagrant up --provision --provider=virtualbox ?

I don't have a windows machine, so I cannot test, but the error looks like the mounts. Can you hash out these lines in the Vagrantfile please

      unless machine[:synced_folders].nil?
        machine[:synced_folders].each do |folder|
          config.vm.synced_folder "#{folder[:ext_rel_path]}", "#{folder[:vm_path]}", owner: "#{folder[:vm_owner]}", mount_options: ["dmode=777,fmode=777"]
          # below will mount shared folder via NFS
          # config.vm.synced_folder "#{folder[:ext_rel_path]}", "#{folder[:vm_path]}", nfs: true, nfs_udp: false, mount_options: ['nolock', 'noatime', 'lookupcache=none', 'async'], linux__nfs_options: ['rw','no_subtree_check','all_squash','async']
        end
      end

Additionally, it looks like you will also be blokced by this https://developer.hashicorp.com/vagrant/docs/other/wsl#using-docker

star3am commented 10 months ago

I would suggest using Virtualbox or Docker on Windows, closing issue.