- Access Linux files from Windows
- Access Windows files from Linux
WSL automatically mount the Windows drive as /mnt. To access C drive, we can use /mnt/c
- Export/Import a Distro
Export: wsl --export ...
Import: wsl --import ...
- Create a custom Distro from a docker container
- Firstly, we pull a container from Docker hub
- Second step is to start the container with docker run command.
- Third step: we add user for WSL
useradd -m YOURUSERNAME
passwd YOURUSERNAME
- Then we add /etc/wsl.conf file to let WSL know the user we created
echo -e "[user] \ndefault=YOURUSERNAME" > /etc/wsl.conf
- If we want to add more configuration, we can add at this step.
- After finish adding the configurations, we can export the Docker container to the Tar file using docker export command.
- Then we use wsl --import command to import the Tar file. And now we have a new Distro to run.
- Create a custom Distro from a docker container using Docker file
For the manual steps above, we can build a Docker file to create a custom Distro.
No comments:
Post a Comment