Mount Windows Network Disk to WSL

This guide outlines an alternative method to mount Samba shares in WSL by utilizing mapped network drives in Windows, bypassing common CIFS errors.

1. Backgroud

Mount samba directly in wsl like linux is difficult

1
2
3
4
Password for root@//filesystem.domain/root:
mount error: cifs filesystem not supported by the system
mount error(19): No such device
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

2. Solution

But is easily mount net disk in windows file manager. So if your windows share is already mapped to a drive in the Windows host, it can be even simpler.

Suppose you already mounted the share on Z:. In that case the following will work:1

1
2
sudo mkdir /mnt/z
sudo mount -t drvfs 'Z:' /mnt/z

3. Reference

使用 Hugo 构建
主题 StackJimmy 设计