From: Michael Tokarev <mjt@tls.msk.ru>
To: Vinod Chegu <vinodchegu@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: Unable to start a guest using qemu-kvm directly
Date: Sun, 29 Jan 2012 20:08:11 +0400 [thread overview]
Message-ID: <4F256EEB.5040106@msgid.tls.msk.ru> (raw)
In-Reply-To: <loom.20120129T154918-461@post.gmane.org>
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
next prev parent reply other threads:[~2012-01-29 16:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-29 15:17 Unable to start a guest using qemu-kvm directly Vinod Chegu
2012-01-29 16:08 ` Michael Tokarev [this message]
2012-01-31 22:29 ` Vinod Chegu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F256EEB.5040106@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=kvm@vger.kernel.org \
--cc=vinodchegu@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.