Backing encrypted drive

ca flag

Creating a backing image for the master image that is encrypted using LUKS:

qemu-img create -f qcow2 -b dev.qcow2 -F qcow2 -o encrypt.format=luks,encrypt.key-secret=dev --object secret,id=dev,data='same_as_for_dev.qcow2' dev-inc.qcow2

libvirt configuration:

<disk type="file" device="disk">
  <driver name="qemu" type="qcow2" cache="unsafe"/>
  <source file="/home/user/qemu/dev-inc.qcow2"/>
  <target dev="vda" bus="virtio"/>
  <encryption format="luks" engine="qemu">
    <secret type="passphrase" uuid="0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f"/>
  <address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>

getting this error:

Error starting domain: internal error: Unexpected enum value 0 for virStorageEncryptionEngine

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/", line 72, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/", line 108, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/", line 57, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/", line 1384, in startup
  File "/usr/lib/python3/dist-packages/", line 1353, in create
    raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: Unexpected enum value 0 for virStorageEncryptionEngine

Is it possible to crate a backing image for the encrypted qcow2, if yes, then what am I missing?

turtle avatar
sz flag
in libvirt config what is cache="unsafe" doing?
Jonas avatar
ca flag
Is it related to my question? I need max possible disk performance.
turtle avatar
sz flag
I just dont see that in the libvirt configuration options, i'd try it without that.
turtle avatar
sz flag
Try it with Cache=none
Jonas avatar
ca flag
Getting the same error
I sit in a Tesla and translated this thread with Ai:


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.