为什么 QEMU 在尝试提交快照时给出“权限被拒绝”?

为什么 QEMU 在尝试提交快照时给出“权限被拒绝”?

我正在完全模拟模式下运行 QEMU,并使用 QCOW2 映像-snapshot

我可以对机器进行更改,并且当我终止实例时,QCOW2 图像仍处于原始状态。

但是如果我想保留我的更改,我会连接到 telnet“Qemu monitor”并尝试该commit命令。但它总是给我拒绝权限

(qemu) snapshot_blkdev ide0-hd0 snap0
snapshot_blkdev ide0-hd0 snap0
Error: Could not create 'snap0': Permission denied
(qemu) commit all
commit all
'commit' error for 'all': Permission denied
(qemu) info block
info block
ide0-hd0 (#block698): json:{"backing": {"driver": "qcow2", "file": {"driver": ")
    Attached to:      /machine/unattached/device[24]
    Cache mode:       writeback, ignore flushes
    Backing file:     ./arch-x86.qcow2 (chain depth: 1)

ide1-cd0: [not inserted]
    Attached to:      /machine/unattached/device[25]
    Removable device: not locked, tray closed

floppy0: [not inserted]
    Attached to:      /machine/unattached/device[19]
    Removable device: not locked, tray closed

sd0: [not inserted]
    Removable device: not locked, tray closed

qemu-system 进程由用户 ID 1000 所有。它所在的 qcow2 文件和目录(也是 qemu 进程的路径)全部由用户 ID 1000 所有并可写入。

完整命令qemu-system-x86_64 -machine pc,vmport=off,mem-merge=off,dump-guest-core=off,kernel-irqchip=split -smp 4 -m 1G,slots=4,maxmem=8G -name vma -monitor tcp:127.0.0.1:9901,server,nowait -display none -daemonize -nic user,id=n1,ipv6=off,hostname=vma,hostfwd=tcp::9922-:22 -snapshot -boot c -drive file=./arch-x86.qcow2,index=0,media=disk,format=qcow2

答案1

相关内容