Installing Multipass with Debian 12 (Bookworm) on WSL: A Step-by-Step Guide
This article provides a detailed guide on how to install Multipass with Debian 12 (Bookworm) on Windows Subsystem for Linux (WSL). Multipass is a command-line tool that enables users to create and manage virtual machines easily. The guide covers key concepts and includes subtitles, paragraphs, and code blocks to provide a clear and concise explanation.
Prerequisites
Before installing Multipass with Debian 12 (Bookworm) on WSL, ensure that you have the following prerequisites:
- A 64-bit version of Windows 10
- Windows Subsystem for Linux (WSL) enabled
- A Linux distribution installed on WSL, such as Ubuntu
Installing Multipass
To install Multipass, open your Linux terminal and run the following commands:
sudo snap install multipass
Note: The official Multipass documentation recommends installing Multipass as a snap package. However, the reader encountered issues while attempting to install the snap package. Instead, they can install Multipass using the package manager of their Linux distribution.
Installing Debian 12 (Bookworm) on Multipass
To install Debian 12 (Bookworm) on Multipass, run the following command:
multipass launch --name debian12 --cloud-init /path/to/cloud-init-debian12.yaml
Where /path/to/cloud-init-debian12.yaml is the path to the cloud-init configuration file for Debian 12 (Bookworm). The cloud-init configuration file should include the following contents:
#cloud-config
packages:
- debian-archive-keyring
- apt-transport-https
- curl
- lsb-release
# Add Debian backports repository
apt_preferences:
permitted:
- pin: release o=Debian,a=testing
pin-priority: 900
- pin: release o=Debian,a=stable
pin-priority: -10
# Install required packages
runcmd:
- curl -s https://deb.debian.org/debian/dists/bookworm/InRelease | sudo apt-key add -
- echo "deb https://deb.debian.org/debian/ bookworm main contrib non-free" | sudo tee /etc/apt/sources.list.d/bookworm.list
- sudo apt update
- sudo apt upgrade -y
Replace bookworm with the codename of Debian 12 (Bookworm) if it changes in the future.
Accessing the Debian 12 (Bookworm) Virtual Machine
To access the Debian 12 (Bookworm) virtual machine, run the following command:
multipass shell debian12
This article provided a step-by-step guide on how to install Multipass with Debian 12 (Bookworm) on WSL. The guide covered the following key concepts:
- Prerequisites for installing Multipass with Debian 12 (Bookworm) on WSL
- Installing Multipass using the package manager of the Linux distribution
- Creating a Debian 12 (Bookworm) virtual machine using Multipass and cloud-init
- Accessing the Debian 12 (Bookworm) virtual machine using Multipass