Re: Unable to start a guest using qemu-kvm directly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 29.01.2012 19:17, Vinod Chegu wrote:
> 
> Dear All,
> 
> I am using RHEL 6.2 + KVM on a X86_64 server.  I have been able to create Linux 
> guests using virt-install (using virto and/or pci passthrough) and am able to 
> manage the guests using virsh and/or virt-manager for doing some basic stuff. 
> 
> Here is a sample guest (that I was able to create using virt-install and able to 
> boot fine using either virsh or virt-manager) :
> 
[]
> Tried to start the above guest using qemu-kvm directly (so that I can in future 
> specify different options etc).  But I am getting some errors. (pl. see below).
> 
> # /usr/libexec/qemu-kvm -version
> QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2), Copyright (c) 2003-2008 
> Fabrice Bellard
> 
> # /usr/libexec/qemu-kvm -S -M rhel6.2.0 -enable-kvm -m 4096 -smp 
> 1,sockets=1,cores=1,threads=1 -name testvm2 -uuid d44e8618-e48c-531b-01c4-
> 80fc2a026a25 -nodefconfig -nodefaults -chardev 
> socket,id=charmonitor,path=/var/lib/libvirt/qemu/testvm2.monitor,server,nowait -
> mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -
> drive file=/var/lib/libvirt/images/vmStorage/vm2.img,if=none,id=drive-virtio-
> disk0,format=qcow2,cache=none -device virtio-blk-
> pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -
> drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-
> drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev 
> tap,fd=23,id=hostnet0,vhost=on,vhostfd=24 -device virtio-net-
      ^^^^^                      ^^^^^^^^^^
> pci,netdev=hostnet0,id=net0,mac=52:54:00:7b:dc:d3,bus=pci.0,addr=0x3 -chardev 
> pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -
> device usb-tablet,id=input0 -vnc 127.0.0.1:0 -vga cirrus -device virtio-balloon-
> pci,id=balloon0,bus=pci.0,addr=0x5
> 
> 
> char device redirected to /dev/pts/5
> qemu-system-x86_64: -netdev tap,fd=23,id=hostnet0,vhost=on,vhostfd=24: TUNGETIFF 
> ioctl() failed: Bad file descriptor

libvirt pre-configures network tap devices and pre-opens
/dev/vhost-net file and passes these to qemu[-kvm] as
open, ready to use file descriptors.  Like you can do
to redirect stdin:

 cat file

there, cat opens "file" and reads it, or

 cat < file

where cat reads stdin.

In particular, libvirtd has more privileges to open
tap and vhost-net devices since it does that as root
but spawns qemu[-kvm] as unprivileged user.

[]
> Can someone please tell me what this means and any tips on how I can solve this? 
> Do I have to do some other setup to make qemu-kvm happy w.r.t the -netdev 
> options?

You need to understand how to (pre-)configure networking
for qemu (pre- if you want to run it as non-root), this
is described in the users guide and in a lot of howtos
all around the 'net.

/mjt
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux