qemu-discuss
[Top][All Lists]
Advanced

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

Re: [Qemu-discuss] QEMU with pre-created TAP in user mode


From: Mike Lovell
Subject: Re: [Qemu-discuss] QEMU with pre-created TAP in user mode
Date: Thu, 28 Jun 2012 08:27:41 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

On 06/28/2012 08:05 AM, anatoly techtonik wrote:
Hi,

I've read that QEMU should work in user mode without sudo if TAP
interface is pre-created. But I can not make it work. The interface is
created with sudo:

$ sudo tunctl
Set 'tap0' persistent and owned by uid 0
$ sudo ifconfig tap0 192.168.16.1/24

But when I launch QEMU in user mode - it fails:
$ qemu-kvm -hda linux.img -net user -net nic -net nic -net
tap,ifname=tap0,script=no
qemu-kvm: -net tap,ifname=tap0,script=no: could not configure
/dev/net/tun (tap0): Operation not permitted
qemu-kvm: -net tap,ifname=tap0,script=no: Device 'tap' could not be initialized

Is that possible to run QEMU with TAP device to access guest from host
without giving up admin rights?
Did I miss something?

it is possible to do this and you are close. since you didn't specify a -u option to tunctl, the newly created tap device is only usable by root, or uid 0. try 'sudo tunctl -u <your username>' and then running qemu. this option to tunctl specifies which user has ownership of the tap device. you will also need to make sure that your user has the ability to read and write to /dev/net/tun.

mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]