Giter Site home page Giter Site logo

rosenbjerg / wsl2-podman Goto Github PK

View Code? Open in Web Editor NEW
35.0 2.0 5.0 50 KB

Script for installing WSL2 + podman and podman-compose (or docker and docker-compose)

License: GNU General Public License v3.0

Batchfile 2.61% PowerShell 97.39%
wsl2 podman podman-compose docker docker-compose

wsl2-podman's Introduction

For podman on Windows, see the 1st party installation guide here

WSL2 podman/docker install script

Script for installing WSL2 + podman and podman-compose (or docker and docker-compose), and adding Windows "aliases" for convenience

Installation

  • Download and extract the .bat and .ps1 files into same folder and run the .bat script (will prompt for admin rights)
  • Switch from localhost to ::1 or wsl if you experience problems connecting to a container from some application on the host

Improvements and other suggestions

Please create issues for improvements or suggestions to the script

Known problems

Running the installer

If you experience problems starting the installer using the .bat script, it may be because the .ps1 file is blocked in Windows.

Right-click on the .ps1 file and select Properties. Then in the General tab, you will see the option to unblock it. After unblocking, you should be able to start the install script.

If that doesn't solve it, you may need to move the two files to another directory, possibly due OneDrive synchronization of the current folder. Moving the two files to the root of C:\ should resolve the issue.

Absolute paths

One problem with this docker-desktop alternative is that you cannot use absolute paths for mounting. Instead you will have to either use relative paths or rewrite C:\ to /mnt/c/ and use forward slashes

Connecting to containers using localhost

Some applications automatically resolve localhost to 127.0.0.1 (IPv4) which Windows doesn't forward to WSL2, without checking the Windows hosts file. This means you may experience problems connecting to the containers running in WSL2, if using localhost.

If you do experience this, try changing localhost/127.0.0.1 to ::1 (for TCP connections and [::1] for HTTP) or to wsl

Missing internet connectivity when using Cisco AnyConnect on Windows host

Connecting or disconnecting the AnyConnect client can cause internet connectivity problems in WSL2. Running the following powershell command with elevated rights fixes this:

Get-NetAdapter | Where-Object {$_.InterfaceDescription -Match 'Cisco AnyConnect'} | Set-NetIPInterface -ErrorAction SilentlyContinue -InterfaceMetric 6000 | Out-Null

wsl2-podman's People

Contributors

rosenbjerg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wsl2-podman's Issues

Podman package not found

Distro: Ubuntu 20.04.3 LTS (GNU/Linux 5.10.16.3-microsoft-standard-WSL2 x86_64)

Installing podman ..
E: Unable to locate package podman


Warning when installing podman

I used the script to install podman, I got the error:
/mnt/c/install-wsl2-container-runtime.sh: line 24: $'\r': command not found

I see the power shell replacement:

"@ -replace '"',"`"" -replace "`r",""

Maybe the trailing line in the script interferes with it, or simply dos2unix should be run on it?

Full output was:

Processing triggers for man-db (2.9.1-1) ...
- Installing pip3 ..
- Installing podman-compose through pip3 ..
- Adding aliases for docker and docker-compose in .profile ..
/mnt/c/install-wsl2-container-runtime.sh: line 24: $'\r': command not found

Adding WSL podman wrapper bat files ..
Adding bat file directory to current user's PATH environment variable ..

Adding hosts file entries for convenience ..
Adding '::1 wsl' to hosts file
Adding '::1 docker' to hosts file
Adding '::1 podman' to hosts file

You should now have podman, podman-compose available in your terminal
(the aliases docker and docker-compose were also added)
Please share improvements and suggestions as issues on https://github.com/rosenbjerg/wsl2-podman

Press enter to close this window

Create a github release

Scripts seem to be excellently prepared. However, to run them, i have to either git clone or download them raw one by one.
I woul better have a zip archive downloadable from the github releases section.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.