Yes, I can definitely help! The error you're seeing:
overlayfs: upper fs missing required features
suggests that the filesystem you're using as the upper, i.e., the part where Docker tries to write changes when using overlay2 storage driver, does not support all the features required by OverlayFS.
Since you've mounted /var/lib/docker using virtiofs, that can be the root cause.
🔍 Understanding the Problem
When you're using OverlayFS (especially with the Docker overlay2 storage driver), the underlying filesystem must support some key features like:
d_type support (dirent.d_type) – tells the filesystem to track whether entries are files, directories, or symlinks, etc.
- Copy-on-write semantics
- Extended attributes (
xattr)
- Proper inode management
Some shared or virtualized filesystems (like virtiofs) may not support all required features, or may not advertise them properly, even if technically possible.
📛 About virtiofs
virtiofs is a shared filesystem designed for VMs to access a directory from the host with various performance and integration benefits. But:
- It may not currently support all OverlayFS requirements, especially
xattr or d_type.
- It's relatively new and evolving; support depends on QEMU/libvirt/kernel versions.
✅ Solutions & Recommendations
✔️ 1. Use a Different Filesystem for /var/lib/docker
If possible, the cleanest solution would be:
Don’t mount /var/lib/docker using virtiofs.
Use a native Linux filesystem like ext4, xfs, or btrfs inside the VM.
In practice:
- Store Docker data within the VM's disk (virtual disk image).
- You can mount your virtiofs somewhere else, e.g.
/shared-data, and bind-mount individual needed folders into containers.
Docker heavily relies on overlay2, and using an incompatible FS can cause serious issues.
✔️ 2. Switch to a Different Docker Storage Driver
If you're stuck using virtiofs, you could try switching to a more compatible storage driver, like vfs. However, note:
vfs is much slower because it doesn’t leverage copy-on-write.
- It’s not recommended for production workloads.
How to switch to vfs:
Create or modify Docker’s daemon config:
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<EOF
{
"storage-driver": "vfs"
}
EOF
Then restart Docker:
sudo systemctl restart docker
⚠️ You may also have to clear existing /var/lib/docker contents if they were created with overlay2.
✔️ 3. Create a Separate Ext4 Volume for Docker
You can attach another disk to your VM, format it with ext4, and mount it at /var/lib/docker.
Example:
mkfs.ext4 /dev/vdb
mount /dev/vdb /var/lib/docker
Add to /etc/fstab for persistence.
✔️ 4. Use virtiofs Elsewhere
Instead of placing Docker’s internal data on virtiofs, mount your shared directory at e.g. /shared and access it from within containers via bind mounts.
Example:
docker run -v /shared:/mnt/shared my-image
This way, Docker uses a supported local filesystem, and only shares what’s needed into containers.
🧪 Debugging Tips
If you're unsure what's missing, you can run:
xfs_info /var/lib/docker
getfattr -d /var/lib/docker
Also:
grep overlay /proc/filesystems
And test running overlay manually:
mkdir lower upper work merged
mount -t overlay overlay -o lowerdir=lower,upperdir=upper,workdir=work merged
If it fails, your upper or work dirs are on an incompatible FS.
✅ Recommended Setup (Best Practice)
- Use
ext4 or xfs on Docker’s storage (/var/lib/docker)
- Keep
virtiofs for passing shared data (/shared), not for Docker’s internals
- Avoid exotic filesystems or network shares for Docker unless absolutely necessary
Let me know more about your setup (like lsblk, mount, docker info, or docker version outputs) if you want a more tailored fix!