Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install with no internet from WSL 2 #11

Closed
ballardt opened this issue Feb 11, 2021 · 4 comments · Fixed by #15
Closed

How to install with no internet from WSL 2 #11

ballardt opened this issue Feb 11, 2021 · 4 comments · Fixed by #15

Comments

@ballardt
Copy link

ballardt commented Feb 11, 2021

The instructions in the README seem to use apt to install packages from within WSL 2, but, as far as I understand, the purpose of the software is to provide internet access to the VM. In my case, for example, I cannot use apt as it is listed in the README commands, even with Docker Desktop for Windows installed, as it fails to resolve the request to the package repository.

Am I missing something, or does this software require a functioning apt get to work? Thanks, if I could get it working this would be extremely helpful for several people on my team. In any case, I am thinking I may be able to download the packages manually and install with dpkg.

@albertony
Copy link
Contributor

albertony commented Feb 11, 2021

No you are not missing something... unless I am missing something too! :)

But I did this: Located download links for individual package files on my host computer and downloaded them from a browser (or rather, a PowerShell script), then used the package tool in wsl in "offline-mode" to install the packages from file, by referencing them in the /mnt/c/etc. path back where they are on the host. Needs the package socat, but then it needs some dependencies that are also missing so there are a couple more.

Debian:

Ubuntu 20.04:

  • Only missing socat package. Download url can be retrieved by the folowing command in wsl: apt-get install socat --print-uris -qq. Then download this link on host etc, and install it just like with Debian.

Alpine:

  • Tested the official "Minimal root filesystem" distribution from alpinelinux.org, so not actually a WSL distribution at all, but works like a charm. Except, needs bash to run the wsl-vpnkit script.
  • Downloads from https://dl-cdn.alpinelinux.org/alpine/latest-stable/main/x86_64/
  • Packages needed: ncurses-terminfo-base, ncurses-libs, readline, socat, bash
  • Install with apk add --quiet --repositories-file /dev/null <packagefiles>....

Also download npiperelay and Docker Desktop on host. As for the vpnkit.exe and vpnkit-tap-vsockd I downloaded just downloaded the Docker installer and instracted it with 7-Zip, first the .exe then the iso, to just grap these two files.

@ballardt
Copy link
Author

@albertony This did indeed work for me, thank you!

@sakai135
Copy link
Owner

Thanks for the detailed steps, @albertony. The steps in the README were intended for when you have access to the internet within WSL2 but no access when connected to the VPN, since that was the situation I had. I'll try to update the README sometime soon to incorporate this where you don't have internet access at all within WSL2.

@andyneff
Copy link

Another option is to convert the WSL to WSL1, install packages, and convert it back to WSL2

  • wsl --set-version {distro_name} 1
  • wsl --set-version {distro_name} 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants