WSL 1/2

Mount paths with dvrfs

Today I spent some time with Stuart in linux-chat working out why Plex couldn't see files on Docker on Alpine on WSL2 on Windows over an SMB share on the network to another windows host.

We were able to get this working by doing a dvrfs mount on the ubuntu WSL2 kernel, added it to fstab, and then starting the plex container from within wsl2 via compose.

 

The final configs:

/etc/fstab

//192.168.4.80/TV  /media/tv  drvfs  defaults  0  0
//192.168.4.80/Movies  /media/movies  drvfs  defaults  0  0

mounts in memory (truncated for brevity)

drvfs on /media/tv type 9p (rw,relatime,dirsync,aname=drvfs;path=UNC\192.168.4.80/TV;symlinkroot=/mnt/,mmap,access=client,msize=262144,trans=virtio)
drvfs on /media/movies type 9p (rw,relatime,dirsync,aname=drvfs;path=UNC\192.168.4.80/Movies;symlinkroot=/mnt/,mmap,access=client,msize=262144,trans=virtio)
...
#/media/tv
drvfs on /mnt/wsl/docker-desktop-bind-mounts/Ubuntu-20.04/eb9beb42b66be85869c45a8e9d974dbc2c0b54f140e916651a8bd023ef835f26 type 9p (rw,relatime,dirsync,aname=drvfs;path=UNC\192.168.4.80/TV;symlinkroot=/mnt/,mmap,access=client,msize=262144,trans=virtio)
#/media/movies
drvfs on /mnt/wsl/docker-desktop-bind-mounts/Ubuntu-20.04/6c1bf2b4364795af46e328868804222b43c9c901292966edc0ffa1ca3247ed87 type 9p (rw,relatime,dirsync,aname=drvfs;path=UNC\192.168.4.80/Movies;symlinkroot=/mnt/,mmap,access=client,msize=262144,trans=virtio)
#/config
/dev/sdd on /mnt/wsl/docker-desktop-bind-mounts/Ubuntu-20.04/4510a910c7ceb4c75ac2a6f22441043d60d1c85d4837fc67e76342c85974b890 type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)

Mounted FS (truncated for brevity)

Filesystem     1K-blocks      Used Available Use% Mounted on
drvfs          976760828 950763848  25996980  98% /media/tv
drvfs          976760828 950763848  25996980  98% /media/movies

docker inspect (truncated for brevity)

$ cat dp.jq | jq .[0].Mounts
[
  {
    "Type": "bind",
    "Source": "/run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu-20.04/eb9beb42b66be85869c45a8e9d974dbc2c0b54f140e916651a8bd023ef835f26",
    "Destination": "/media/tv",
    "Mode": "rw",
    "RW": true,
    "Propagation": "rprivate"
  },
  {
    "Type": "bind",
    "Source": "/run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu-20.04/6c1bf2b4364795af46e328868804222b43c9c901292966edc0ffa1ca3247ed87",
    "Destination": "/media/movies",
    "Mode": "rw",
    "RW": true,
    "Propagation": "rprivate"
  },
  {
    "Type": "bind",
    "Source": "/run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu-20.04/4510a910c7ceb4c75ac2a6f22441043d60d1c85d4837fc67e76342c85974b890",
    "Destination": "/config",
    "Mode": "rw",
    "RW": true,
    "Propagation": "rprivate"
  }
]