gpt4 book ai didi

json - qemu :commandline in libvirt? "Permission denied"错误如何解决

转载 作者:行者123 更新时间:2023-12-04 13:45:53 24 4
gpt4 key购买 nike

请在下面找到我的 dom xml 示例。我正在运行命令 virsh create 并收到此错误:

Unable to open file <json file located inside install_dir>

这个文件的权限都很好。
qemu:commandline下的参数是否需要特殊权限?标签?无论我在本节中提到的参数和文件如何,我都会收到错误消息。
 <domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>my_instance</name>
<uuid>35615c44-b004-4b3f-9f42-da182b9662ee</uuid>
<memory unit='KiB'>786432</memory>
<currentMemory unit='KiB'>786432</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='armv7l' machine='my_machine'>hvm</type>
<kernel>/home/user/KernelPath/zImage</kernel>
<dtb>/home/user/DTPPath/emmc.dtb</dtb>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-arm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/home/user/Install_Dir/emmc.dat'/>
<target dev='sd' bus='scsi'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'/>
<controller type='scsi' index='0'/>
<serial type='pty'>
<target port='0'/>
</serial>
<serial type='pty'>
<target port='1'/>
</serial>
<serial type='pty'>
<target port='2'/>
</serial>
<serial type='pty'>
<target port='3'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='60316' autoport='no' websocket='60381' listen=''>
<listen type='address' address=''/>
</graphics>
<graphics type='sdl'/>
<video>
<model type='qxl'/>
</video>
<memballoon model='none'/>
</devices>
<qemu:commandline>
<qemu:arg value='-spdir'/>
<qemu:arg value='/home/user/Install_Dir'/>
<qemu:arg value='-show-cursor'/>
</qemu:commandline>
</domain>

最佳答案

Libvirt 将尝试使用专用用户帐户(通常是 qemu:qemu 用户/组对)运行 guest ,并应用 SELinux 或 AppArmor 规则来限制它。通常,libvirt 会自动设置文件所有权并将 SELinux/AppArmor 策略设置为“正常工作”。 qemu 命令行传递虽然是 libvirt 的一个黑匣子,所以它不知道它需要与您的 /home/user/Install_Dir 相关联。小路。如果您的用户/组所有权是正确的,那么它可能是拒绝访问的 SELinux/AppArmor 策略。唯一可行的解​​决方法是禁用它们(通过 /etc/libvirt/qemu.conf ),并接受较低的安全保护

关于json - qemu :commandline in libvirt? "Permission denied"错误如何解决,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48657281/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com