Repository navigation
Description
Description
Not really being a bug per se but something to be considered:
1) The bundled virtiofsd module coming with the latest version of Docker Desktop for Linux is outdated. It's shipping 1.11.1 while 1.13.1 is current (as per this page: https://gitlab.com/virtio-fs/virtiofsd/-/releases)
2) The current way of using virtiofsd only allows for running it with the default parameters. For example, users being in need of the --inode-file-handles=mandatory argument cannot apply it since Docker Desktop for Linux refuses to work with a wrapper script and doesn't feature a way to pass on the argument to virtiofsd otherwise.
To expand, cases for using --inode-file-handles=mandatory are:
Scenarios with heavy IO, like mentioned here (https://gitlab.com/virtio-fs/virtiofsd/-/issues/168#note_1992834945) or here (https://gitlab.com/virtio-fs/virtiofsd/-/issues/121#note_1523059164)
Since Docker Desktop for Linux only allows for shared directories with the host via virtiofsd, the lack of applying the --inode-file-handles=mandatory argument might prevent some heavy IO tasks from finishing properly. Without mentioned argument, the IO task tends to consume all available host RAM (esp. on low RAM machines of course, but also ones with a decent amount) and trigger the oom killer of the OS, which kills Docker Engine.
Background:
I have tested the effectiveness of the --inode-file-handles=mandatory argument with a wrapper script and a VM using virtiofsd. With default virtiofsd parameters, the heavy IO task behaves like with Docker Desktop for Linux (which also uses a VM, to my knowledge), meaning it eventually consumes the host's RAM and triggers the oom killer.
Only with the wrapper script in place and enforcing "--inode-file-handles=mandatory" does virtiofsd perform without issues.
Reproduce
Version check:
/opt/docker-desktop/bin/virtiofsd --version- Compare version with virtiofsd repo at https://gitlab.com/virtio-fs/virtiofsd/-/releases
- Observe the difference
Using virtiofsd:
- There's no way to enforce arguments for the bundled virtiofsd in the Docker Desktop UI, command line or via a wrapper script. By this, virtiofsd operates on default parameters, in turn not using
--inode-file-handles=mandatory - Create a heavy IO task in the container of your choice, let it use a shared folder on the host
- Observe the RAM consumption and, depending on the task (let's say
repo syncof an Android LineageOS repo), eventual oom killer activation due to exhausted RAM of the host
Expected behavior
Re: virtiofsd version: A more current one should ship with the installer.
Re: The ability to issue virtiofsd arguments: Perhaps a selection and/or parameter entry field can be provided. If not, at least allow for wrapper scripts to be used, which is what I use for my normal VMs.
docker version
--removed--
docker info
--removed--
Diagnostics ID
--removed--
Additional Info
You might have reasons to ship with this version of virtiofsd, hence my note on this not being a bug per se. You might also have reasons to refuse a wrapper script being in place for virtiofsd. No complains, just a heads-up.
One can manually update the file of course, but a wrapper script is not accepted as Docker Engine then fails to start.
I linked the explanations from the virtiofsd author and the corresponding issues above, which might help to gauge the usefulness of the mentioned argument.
In case there is a way to enforce the beforementioned argument, please let me know. I will be most thankful. In fact, I already am since I really like and value Docker Desktop for Linux. :-)
Activity
CPioGH2002 commentedon May 31, 2025
Expanding: Trying to make the wrapper script work
First, I checked if Docker Desktop for Linux respects my system-wide PATH setup:
To my understanding, any wrapper script for virtiofsd being placed at
/usr/local/binand named "virtiofsd" should be called before the actual virtiofsd file if the PATH setup is respected. But if Docker Desktop calls up the file at/opt/docker-desktop/bin/directly, the wrapper script will be disregarded.I checked via
ps aux | grep virtiofsd(to see the path in use and if the--inode-file-handles=mandatoryargument shows up) and also ran my typical test container, the one with the heavy IO, just in case.Turns out that the latter scenario is in place, with the system-wide PATH setup not being in effect regarding the calls for virtiofsd by Docker Desktop for Linux. By this,
--inode-file-handles=mandatorydoesn't get applied, leading to the results described before.Other attempts
1) Directly replacing the original virtiofsd file Docker uses (at
opt/docker-desktop/bin) with the one for the script (which then points to the renamed original file) -> leads to Docker Engine failing to start.Script contents in that case:
2)
a) Trying to set an environment variable to make sure the call for virtiofsd encounters my wrapper script first -> There's no dialog in the Docker Desktop GUI to allow for that.
b) Launching Docker Desktop directly via the terminal with the added PATH value (
PATH=$PATH:/usr/local/bin /opt/docker-desktop/bin/docker-desktop) -> does not lead to my script being used3) Trying the same as in 2) but via Docker Desktop's settings file at
~/.docker/desktop/settings-store.json-> Any edits I made there either didn't apply or led to Docker Desktop refusing to start.4) Trying to pass on commands when running containers which would lead to Docker Desktop for Linux calling my wrapper script instead of the virtiofsd file directly -> No luck with that since only the environment of the container would be affected, not the one Docker Desktop itself runs in.
Non-script-based approach
I shortly tried to externally launch virtiofsd with the parameters and settings I need, to then launch Docker Desktop in the hope to "pick up" the socket, which it didn't do though. On that point, I will happily admit that the method is very new to me, so I could have made mistakes along the way.
Conclusions (of the layman I am)
CPioGH2002 commentedon Jun 9, 2025
On a tangent, it's interesting to see that people tend to recommend leaving Docker Desktop for Linux alone and sticking to the normal Docker setup, perhaps with third-party extensions like Portainer. Recent example: https://www.reddit.com/r/docker/comments/1l6er6v/docker_desktop_vs_engine_with_gui/
Given the problems arising from the VM setup, the inability to currently alter underlying mechanics (like virtiofsd parameters) and the amount of support (if present at all, albeit for the free tier), once would indeed concur.
Anyhow, if the virtiofsd-based problems mentioned in this thread ever clear up or at least receive some dev input, I would certainly welcome it. In the meantime, I shall uninstall Docker Desktop for Linux and go with the normal release of Docker. Not sure if that's the intended result. It's a shame since Docker Desktop certainly took some time to develop.
Edit: After re-reading my post, I noticed that it comes across way more passive-aggressive as intended. So please don't read in that tone/mood, but still notice that some parts of the Docker community already made up their mind about Docker Desktop on Linux, for one reason or another.
CPioGH2002 commentedon Jun 11, 2025
Update on getting rid of Docker Desktop for Linux and running the same task with Docker Engine: Even my heavy IO tasks now finish in no time and without errors or RAM exhaustion.
In some sense, this is good (as I am able to actually create some output) but also sad since one has to leave the otherwise nice looking and useful Docker Desktop GUI behind. Not sure if that's the desired outcome in the eyes of the company but, as mentioned before, there seems to be a certain consensus among Linux users to prefer Docker Engine over Docker Desktop at any given time.
Since beginners might fall for the appeal of the GUI while later encountering the possible errors due to the "VM" approach Docker Desktop uses (as opposed to the "direct" one by Docker Engine), mentioned consensus does seem to make sense. And if one wanted to add GUI elements, third parties are ready to help.
In short: If Docker Desktop (on Linux) causes problems, try Docker Engine and stick with it.
Xeeynamo commentedon Jun 18, 2025
Hey @CPioGH2002 thanks for the report! We're planning to ship Docker Desktop 4.43.0 with virtiofsd v1.13.1, which includes improvements in IOPS performance. While we’re aware that v1.13.2 is now available, we still need to complete internal performance and stability testing before considering its integration.
Yes, that’s expected behavior. Docker Desktop bundles specific versions of dependencies like
virtiofsdto ensure consistent performance and compatibility across various Linux distributions. For example, Ubuntu Plucky Puffin includes v1.13.0, Arch Linux uses v1.13.1, etc. By shipping our own version, we maintain a known baseline across all environments.If you want to use a custom wrapper to tweak the virtiofsd arguments, one workaround could be creating a symbolic link that replaces the bundled virtiofsd with your script, which then calls the latest
/usr/local/bin/virtiofsdinstalled on your Linux distro.CPioGH2002 commentedon Jun 18, 2025
Thanks for your answer, much appreciated.
Hearing that a more recent version of virtiofsd will be shipped is great news.
Did you see which methods I used to make the wrapper script work? I posted the results above and had no luck getting Docker Desktop for Linux to work with any of them. Docker Engine then simply fails to start.
Edit: To my understanding, the No.1 method I used (described above) is very similar to what you are proposing: In both cases, Docker Engine encounters either my wrapper script directly or a symlink to my wrapper script. I would envision that the results are the same in both cases = Docker Engine failing to start.
Please correct me if I'm wrong. I might try installing and testing Docker Desktop for Linux again then.
Edit2: I tried your advice, see the outcome below.
Regarding virtiofsd arguments in general: virtiofsd allows for some very useful options, especially for heavy IO tasks. If those could be implemented into Docker Desktop directly, nobody would need a workaround. Simply exposing the options (via an "extra commands" field or something) would already help.
CPioGH2002 commentedon Jun 19, 2025
Following your advice
Setup
I went about it this way:
Result
Docker Engine (in Docker Desktop for Linux) refusing to start with:
The directory mentioned is the one I set up as shared folder. It's present and available for the host OS. It's the same I used for other VMs on the system and with Docker Engine (stand-alone install) before, where it worked fine.
Conclusion
Unless I did something wrong and/or misunderstood your advice, the conclusion remains that the wrapper script isn't accepted. As for other methods I tried before this one, I'd refer to one of my previous posts.