utmapp / docs.getutm.app

UTM documentation
Creative Commons Zero v1.0 Universal
41 stars 61 forks source link

Add `davfs2` instructions to mount shared WebDAV directory in Linux #21

Open martin-braun opened 1 year ago

martin-braun commented 1 year ago

Instructions explain the bare minimum steps to auto mount a WebDAV network drive on boot that is hosted by spice-vdagent.


I still have one problem with this, though. mount -a will mount the shared WebDAV, but it's very slow (30 seconds or more). Also, no matter which fstab options I test, it will not attempt to wait for it to connect when booting, it will cancel immediately.

During boot I see:

[FAILED] Failed to mount /media/dav. SEE 'systemctl status media-dav.mount for details. [DEPEND] Dependency failed for Remote File Systems.

After boot systemctl status media-dav.mount returns:

× media-dav.mount - /media/dav
     Loaded: loaded (/etc/fstab; generated)
     Active: failed (Result: exit-code) since Mon 2023-05-22 09:22:52 UTC; 18s ago
      Where: /media/dav
       What: http://127.0.0.1:9843
       Docs: man:fstab(5)
             man:systemd-fstab-generator(8)
        CPU: 30ms

May 22 09:22:52 ubuntu-server systemd[1]: Mounting /media/dav...
May 22 09:22:52 ubuntu-server mount.davfs[843]: davfs2 1.6.1
May 22 09:22:52 ubuntu-server systemd[1]: media-dav.mount: Mount process exited, code=exited, status=255/EXCEPTION
May 22 09:22:52 ubuntu-server systemd[1]: media-dav.mount: Failed with result 'exit-code'.
May 22 09:22:52 ubuntu-server systemd[1]: Failed to mount /media/dav.

Testing with /etc/fstab:

http://127.0.0.1:9843 /media/dav davfs user,rw,nolock,auto,_netdev,delay_connect 0 0

After manually running mount -a, systemctl status media-dav.mount returns:

● media-dav.mount - /media/dav
     Loaded: loaded (/etc/fstab; generated)
     Active: active (mounted) since Mon 2023-05-22 09:25:01 UTC; 31s ago
      Where: /media/dav
       What: http://127.0.0.1:9843
       Docs: man:fstab(5)
             man:systemd-fstab-generator(8)
        CPU: 30ms

So it should work, but it does not. I think spice-webdavd is too slow, I wonder how I can wait for it to be ready?

These instructions are not ready to be contributed. Any help is appreciated. For instance a working fstab configuration to load the shared WebDAV drive.