A practical handbook that will help you bridge the gap between Windows and Linux to develop apps that leverage the best features across both ecosystems with seamless interoperability
▶Book Description
Windows Subsystem for Linux (WSL) allows you to run native Linux tools alongside traditional Windows applications. Whether you're developing applications across multiple operating systems or looking to add more tools to your Windows environment, WSL offers endless possibilities.
You'll start by understanding what WSL is and learn how to install and configure WSL along with different Linux distros. Next, you'll learn techniques that allow you to work across both Windows and Linux environments. You'll discover how to install and customize the new Windows Terminal. We'll also show you how to work with code in WSL using Visual Studio Code (VS Code). In addition to this, you'll explore how to work with containers with Docker and Kubernetes, and how to containerize a development environment using VS Code.
While Microsoft has announced support for GPU and GUI applications in an upcoming release of WSL, at the time of writing these features are either not available or only in early preview releases. This book focuses on the stable, released features of WSL and giving you a solid understanding of the amazing techniques that you can use with WSL today.
By the end of this book, you'll be able to configure WSL and Windows Terminal to suit your preferences, and productively use Visual Studio Code for developing applications with WSL.
▶What You Will Learn
⦁Install and configure Windows Subsystem for Linux and Linux distros
⦁Access web applications running in Linux from Windows
⦁Invoke Windows applications, file systems, and environment variables from bash in WSL
⦁Customize the appearance and behavior of the Windows Terminal to suit your preferences and workflows
⦁Explore various tips for enhancing the Visual Studio Code experience with WSL
⦁Install and work with Docker and Kubernetes within Windows Subsystem for Linux
⦁Discover various productivity tips for working with Command-line tools in WSL
▶Key Features
⦁Configure and control WSL to suit your needs and preferences
⦁Discover tips for working seamlessly between Windows and WSL Linux distros
⦁Learn how to work effectively with containers in WSL, as well as how to containerize your development environments with Visual Studio Code to isolate your dependencies
▶Who This Book Is For
This book is for developers who want to use Linux tools on Windows, including Windows-native programmers looking to ease into a Linux environment based on project requirements or Linux developers who've recently switched to Windows. This book is also for web developers working on open source projects with Linux-first tools such as Ruby or Python, or developers looking to switch between containers and development machines for testing apps. Prior programming or development experience and a basic understanding of running tasks in bash, PowerShell, or the Windows Command Prompt will be required.
▶What this book covers
⦁ Chapter 1, Introduction to the Windows Subsystem for Linux, gives an overview of what the WSL is, and explores the differences between WSL 1 and WSL 2.
⦁ Chapter 2, Installing and Configuring the Windows Subsystem for Linux, takes you through the process of installing WSL 2, how to install Linux distributions with WSL, and how to control and configure WSL.
⦁ Chapter 3, Getting Started with Windows Terminal, introduces the new Windows Terminal. This new, open source terminal from Microsoft is evolving rapidly and provides a great experience for working in your shell with WSL 2. You will see how to install Windows Terminal, work with it, and customize its appearance.
⦁ Chapter 4, Windows to Linux Interoperability, starts to dig into the interoperability features that WSL offers, by looking at how to access files and applications in your Linux distributions from Windows.
⦁ Chapter 5, Linux to Windows Interoperability, continues exploring the WSL interoperability features by showing how to access Windows files and applications from Linux, and some interoperability tips and tricks.
⦁ Chapter 6, Getting More from Windows Terminal, explores some more in-depth aspects of Windows Terminal, such as customizing tab titles and splitting tabs into multiple panes. You will see various options for this, including how to control Windows Terminal from the command line (and how to reuse command-line options to work with a running Windows Terminal). You will also see how to add custom profiles to boost your day-today workflows.
⦁ Chapter 7, Working with Containers in WSL, covers working with Docker Desktop to run the Docker daemon in WSL 2. You will see how to build and run a container for a sample web application. The chapter also shows how to enable and work with the Kubernetes integration in Docker Desktop to run the sample web application in Kubernetes in WSL.
⦁ Chapter 8, Working with WSL Distros, walks you through the process of exporting and importing a WSL distro. This technique can be used to copy a distribution to another machine or to create a copy on the local machine. You will also see how to use container images to quickly create new WSL distros.
⦁ Chapter 9, Visual Studio Code and WSL, gives a quick introduction to Visual Studio Code before exploring the Remote-WSL extension for working with code in your WSL distro file system from Visual Studio Code. With this approach, you retain the rich GUI experience of Visual Studio Code with your code files, tools, and application all running in WSL.
⦁ Chapter 10, Visual Studio Code and Containers, continues the exploration of Visual Studio Code by looking at the Remote-Containers extension, which allows you to package all your project dependencies into a container. This approach allows you to isolate dependencies between projects to avoid conflicts, and also enables new team members to rapidly get started.
⦁ Chapter 11, Productivity Tips with Command-Line Tools, takes a look at some tips for working with Git at the command line, followed by some ways to handle JSON data. After this, it explores both the Azure and Kubernetes command-line utilities and ways they can each be used to query information, including further exploration of handling JSON data.