Giter VIP home page Giter VIP logo

fedora-wsl2's Introduction

fedora-wsl2

Support custom Fedora-based WSL2 distributions. The distributions are built based on custom Fedora 32+ Docker images from which the filesystem is exported as a tarball.

> ./build.sh -?
Usage:
    build.sh [--version <version>][--user <user>][--distro <distroType>][--sshPub <pubKey>][--sshPriv <privKey>]

--version=<version>     - Fedora version (32+)
--user=<user>           - specify the non-root username which will be created with sudo access
--distro=<distroType>   - specify the type of distro to build:
                            - base   - minimal Fedora distro
                            - podman - Fedora distro with Podman, Buildah (NOTE: work in progress)
                            - cpp    - C++ development
--sshPub=<pubKey>       - specify an existing ssh public key file to insert in user's .ssh directory
--sshPriv=<privKey>     - specify an existing ssh private key file to insert in user's .ssh directory

The tarball then can be imported as a WSL distribution from Powershell:

> wsl --import Base /path/to/<baseWslDir> wsl-fedora32-base.tar

OR

> wsl --import Podman /path/to/<podmanWslDir> wsl-fedora32-podman.tar 

Base image

This is a small image based on the Fedora 32+ Docker base image

Podman image

This image is based on the Fedora 32+ Docker base image with packages added to support Podman and Buildah.

Thanks to Jonathan Bowman's post for identifying steps to get rootless Podman working under WSL2.

C++ image

This image adds C++ development tools

Alternative Docker support

The alternative way to achieve container support within a WSL2 distro is as follows:

  1. Install Docker Desktop for Windows, and enable the WSL2 backend.
  2. Import the Fedora WSL2 distro as shown above.
  3. From the Docker Desktop select Settings -> General -> WSL Integration and choose the Fedora WSL2 distro which was imported. This will create the /usr/bin/docker symlink and add the docker group in /etc/group.
  4. Start the Fedora WSL2 distro.
  5. As root or via sudo add the non-root user to the docker group in /etc/group.

fedora-wsl2's People

Contributors

cjlove avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

fedora-wsl2's Issues

Podman support on WSL2

Full podman functionality is not yet working

  • Can pull the hello-world image and run it as a non-root user.
  • Can't pull the fedora:32 image. Various issues saving the image.

Customize user support.

The build.sh script should allow a command-line argument to specify the username. The existing Dockerfile for each image should be treated as a template which is customized with the specified username.

The end result is that the chosen username is created, with UID/GID 1000 and is set up for password-less sudo support.

Add C++ dev image

Tools to include: gcc/g++, clang, clang tools, CMake make, gdb, gtest, lcov

Unable to change container hostname

Even with the hostname rpm installed in the image, the hostname gets set to the WSL2 host system's hostname. Would like to be able to override this.

Note that hostnamectl doesn't work since systemd isn't running.

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.