Skip to main content

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
/dev/sdd       263174212   1921572 247814484   1% /
tmpfs            6501380      4304   6497076   1% /mnt/wsl
tools          468204396 136964840 331239556  30% /init
none             6498980         0   6498980   0% /dev
none             6501380        28   6501352   1% /run
none             6501380         0   6501380   0% /run/lock
none             6501380         0   6501380   0% /run/shm
none             6501380         0   6501380   0% /run/user
tmpfs            6501380         0   6501380   0% /sys/fs/cgroup
drvfs          468204396 136964840 331239556  30% /mnt/c
drvfs          976760828 950763848  25996980  98% /media/tv
drvfs          976760828 950763848  25996980  98% /media/movies
/dev/sdc       263174212   2196196 247539860   1% /mnt/wsl/docker-desktop-data/isocache
none             6501380        12   6501368   1% /mnt/wsl/docker-desktop/shared-sockets/host-services
/dev/sdb       263174212    119036 249617020   1% /mnt/wsl/docker-desktop/docker-desktop-proxy
/dev/loop0        235772    235772         0 100% /mnt/wsl/docker-desktop/cli-tools

docker inspect (truncated for brevity)

palmueti@D-SJC-11012793:~$ 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"
  }
]