Skip to main content

Docker Desktop Blues: Solving the wsl-bootstrap Error

·630 words·3 mins·
Docker Desktop wsl-bootstrap error

When I was NOC admin for Zenimax Media, I was given a recycled database server in a junk purge that I turned into a cheap homelab with some spare parts and drives. For a while, it ran OpenMediaVault as I was getting my bearings with Docker, the *Arr Stack and some other DevOps technologies.

Unfortunately, between the motherboard and the ancient PSU, that box died a few months back and replacement parts weren’t in the budget. While I would never recommend doing this, a temporary solution was to migrate the necessary services to my main desktop using Docker Desktop and WSL21.

Always use a dedicated machine for Homelab projects.

Fix running wsl-bootstrap: exit status 1 error #

wsl-bootstrap-error
docker desktop wsl bootstrap error

You will see this error on occasion for various reasons and it’s never particularly informative. More often than not, either your WSL distro is borked somehow (I onced accidentally installed proxmox) or you have a mounted external drive that has become disconnected.

In either case, you’ll have to shut down the WSL executable, remount your drive(s) and restart the docker daemon.

Shutdown the WSL executable #

In a PowerShell prompt with elevated privileges type the following command to shutdown the active WSL2 instance.

wsl --shutdown

In the event that a drive has become disconnected, all WSL commands might freeze because of a container that is unable to be stopped or killed. You will have to use taskkill to stop the rouge process before you can use wsl --shutdown.

taskkill /f /im wslservice.exe

powershell taskkill command
wsl can now be shutdown after the process is killed

Identifying the available disk drive(s) #

To check which drives are available, open a PowerShell terminal and enter the following command. External drives formatted for Linux typically use the ext4 file system formatting and cannot be mounted or seen on your Windows filesystem.

Get-CimInstance -query "SELECT * from Win32_DiskDrive"

This will output the currently avaiable drives with a DeviceID under the \\.\PHYSICALDRIVE* format.

available drives via Get-CimInstance
You can also control the fields shown

The wmic command is also available for roughly the same info.

The wmic command-line utility has been deprecated as of Windows 10, version 21H12

In a PowerShell prompt type the following command

wmic diskdrive list brief

Your DeviceID may not be the same after a reboot, especially if you have added or removed devices since the last mount.

Example Output #

WD My Passport 0830 USB Device          \\.\PHYSICALDRIVE1  WD My Passport 0830 USB Device          1           2000363420160
Seagate Basic SCSI Disk Device          \\.\PHYSICALDRIVE4  Seagate Basic SCSI Disk Device          1           1000202273280
WDC WD80 EAZZ-00BKLB0 SCSI Disk Device  \\.\PHYSICALDRIVE2  WDC WD80 EAZZ-00BKLB0 SCSI Disk Device  1           8001560609280
SAMSUNG MZVL2512HCJQ-00BL7              \\.\PHYSICALDRIVE0  SAMSUNG MZVL2512HCJQ-00BL7              3           512105932800
SABRENT  SCSI Disk Device               \\.\PHYSICALDRIVE3  SABRENT  SCSI Disk Device               2           500105249280

Mounting external ext4 drives with wsl #

Once you’ve confirmed the desired drives are available you have to mount them with WSL2.

In a PowerShell prompt with elevated priveleges type the following command, replacing PHYSICALDRIVE1 with the appropriate DeviceID.

wsl --mount \\.\PHYSICALDRIVE1 --partition 1

You can also access a mounted ntfs formatted drive from within your WSL distro by creating a mounted directory and then using the drvfs file system interop plugin, with the command:

sudo mkdir /mnt/d
sudo mount -t drvfs D: /mnt/d

Accessing disk content #

Once successfully mounted, the disk can be accessed by the path pointed at by the config value: automount.root – the default value is /mnt/wsl.

From Windows, the disk can be accessed in Explorer by navigating to \\wsl$\<Distro>\<Mountpoint>

Restart Docker Desktop #

With the drive(s) mounted, launch the docker daemon.


  1. The Windows Subsystem for Linux, WSL2, is a Microsoft Windows tool that allows developers to run a Linux environment directly on their Windows system without the need for Virtual Machines or dual-booting. ↩︎

  2. The WMI command-line (WMIC) utility is deprecated

    WMIC: WMI command-line utility ↩︎

Bryan Bailey
Author
Bryan Bailey
Just an ordinary guy – a baby from the 80s. Got a little bit of ADD; perhaps, maybe.