1
我目前使用qemu命令行参数来启动虚拟机。QEMU命令行替换为libvirt
我的命令行是:
/home/gnayan/QEMU-devel/qemu-ubuntu/qemu/x86_64-softmmu/qemu-system-x86_64
-trace events=/home/gnayan/qemu_events
-drive file=/home/gnayan/CUSTOM_QEMU_SYSTEM/UBUNTU/ubuntu.img,if=virtio,format=raw
-drive file=/home/gnayan/CUSTOM_QEMU_SYSTEM/UBUNTU/u1.img,if=virtio,format=raw
-m 1G -net nic,model=virtio -net user -redir tcp:2222::22 -enable-kvm &
我想使用类似的virsh或libvirt的工具的virt-安装等,但我有一个很难得到这样做是为了推出同一个VM。
我创建了域的xml:
<domain type="kvm">
<name>first</name>
<currentMemory unit="MB">1024</currentMemory>
<memory unit="MB">1024</memory>
<os>
<type arch='x86_64'>hvm</type>
</os>
<devices>
<emulator>/home/gnayan/QEMU-devel/qemu-ubuntu/qemu/x86_64-softmmu/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<source file='/home/gnayan/CUSTOM_QEMU_SYSTEM/UBUNTU/ubuntu.img'/>
<driver name='qemu' type='raw'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
然后尝试使用virsh define first.xml
我获得以下错误创建VM:
error: Failed to define domain from first.xml
error: internal error: Child process (LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /home/gnayan/QEMU-devel/qemu-ubuntu/qemu/x86_64-softmmu/qemu-system-x86_64 -help) unexpected exit status 126: libvirt: error : cannot execute binary /home/gnayan/QEMU-devel/qemu-ubuntu/qemu/x86_64-softmmu/qemu-system-x86_64: Permission denied
什么可能是错误的,我的Ubuntu设置。
我已经从源代码安装qemu。
路径/ home/gnayan/QEMU-devel/qemu-ubuntu/qemu/x86_64-softmmu /尚未导出,libvirt是否需要此路径?
我也得到了以下消息dmesg
type=1400 audit(1470991545.250:44): apparmor="DENIED" operation="exec" profile="/usr/sbin/libvirtd" name="/home/gnayan/QEMU-devel/qemu-ubuntu/qemu/x86_64-softmmu/qemu-system-x86_64" pid=21287 comm="libvirtd" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
[19990.781774] audit: type=1400 audit(1470991545.258:45): apparmor="DENIED" operation="exec" profile="/usr/sbin/libvirtd" name="/home/gnayan/QEMU-devel/qemu-ubuntu/qemu/x86_64-softmmu/qemu-system-x86_64" pid=21288 comm="libvirtd" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
感谢嗨,任何想法如何加入的virt跟踪参数-install或virsh? – Haswell
如果需要,您可以将标准输出重定向到指定的文件,但在我看来,适当的acction将使用--debug并在〜/ .cache/virt-manager/virt-install.log文件中搜索 – Ferrandinand
我的意思是跟踪events =/home/gnayan/qemu_events参数,这里qemu_events是一个文本文件,描述需要追踪哪些特定的qemu事件,我没有得到您的评论,请解释。然后Qemu跟踪器将事件信息填入ftrace跟踪缓冲区。 – Haswell