diff --git a/lxd/instance/drivers/driver_qemu_templates.go b/lxd/instance/drivers/driver_qemu_templates.go
index <HASH>..<HASH> 100644
--- a/lxd/instance/drivers/driver_qemu_templates.go
+++ b/lxd/instance/drivers/driver_qemu_templates.go
@@ -279,9 +279,10 @@ mem-path = "{{$hugepages}}"
 prealloc = "on"
 discard-data = "on"
 {{- else}}
-qom-type = "memory-backend-ram"
+qom-type = "memory-backend-memfd"
 {{- end }}
 size = "{{$memory}}M"
+share = "on"
 
 [numa]
 type = "node"
lxd/instance/drivers: Change memory backend

This changes the memory backend to memory-backend-memfd. Also, this
turns on `share`. Both are required for virtio-fs.