

- #WSL WINDOWS TERMINAL STARTING DIRECTORY HOW TO#
- #WSL WINDOWS TERMINAL STARTING DIRECTORY INSTALL#
- #WSL WINDOWS TERMINAL STARTING DIRECTORY CODE#
If you want this shell to be the default shell when Windows Terminal starts, search for the “defaultProfile” setting in the WSL settings file and set this to the guid of your new Fedora shell.Ĭheck the Windows Command Line blog for the latest announcements about WSL and Windows Terminal. in the Windows Terminal settings JSON file, search for “fedora” and add commandline and startDirectory entries to set your user.Įxample: (replace the GUID with the GUID for your Fedora entry, and replace the user name with your own). Customize WSL to make the shell default to your user and its corresponding home directory.Į.g. Replace “myuser” below with the username you want to use:Ĩ. Fortunately python3 is already installed in this Docker image.Ĭreate a user and add it to the sudoers group By default you’re logged in as root and some basic packages like passwd and dictionary are missing. To use the Fedora Docker container as your go-to command shell a little extra configuration is required. Start Windows Terminal – you should see the list of WSL images in the drop-down and can customize accordingly in Terminal settings. Confirm the container imported correctly by listing your WSL distributions. It has to be a separate location for each one you create, so think about this before running the command.Ħ. Note: the “./fedora” argument in this example sets where WSL will maintain the root folder for this distribution. Get the Docker container ID using “docker ps -a” and export the container as a tar file Create a new container based on this image, with an interactive bash shell:Ĥ. Note: It’s a good idea to create a specific folder to do the work in.ģ.

Using the Docker command pull the container image for the Linux distribution of your choice:
#WSL WINDOWS TERMINAL STARTING DIRECTORY INSTALL#
To install Docker desktop for Windows see. If you don’t want to run Docker desktop on Windows you could alternatively do steps 1-4 on a Linux VM using Docker and then copy the tar file to Windows for step 5. To get started you need the following installed on your Windows machine:ĭocker is required to get a Docker image and put it in a tar file format for WSL. This example can be extended to any Linux distribution which is available as a Docker container. Fedora is a popular RPM-compatible distribution owned by Red Hat (IBM), and it is not currently available as a free WSL distribution in the Microsoft Store (there is a non-free 3rd party remix version in the store). This is the directory the shell starts in when it is loaded. Using Fedora Linux as an example let’s go through the steps of running your own Fedora shell in Windows Terminal. As well as providing a customizable tabbed way to use existing command shells like PowerShell, command.exe, Azure Cloud Shell and WSL Store offerings like Ubuntu, you can also create your own custom shell from a Docker container image.
#WSL WINDOWS TERMINAL STARTING DIRECTORY CODE#
It’s a must-have utility like VS Code where once you start using it you wonder how you ever managed without it. Windows Terminal is the best command line tool on Windows.

#WSL WINDOWS TERMINAL STARTING DIRECTORY HOW TO#
This article shows how to run a custom Linux shell (in this case Fedora) in Windows Terminal.
