Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Starting KVM with public bridge as normal user

148 views
Skip to first unread message

T o n g

unread,
Aug 18, 2010, 1:40:02 PM8/18/10
to
Hi,

I setup my KVM public bridge according to
https://help.ubuntu.com/community/KVM/Networking

But it doesn't say how I would start KVM with public bridge as normal
user. This is what I get:

$ kvm -net nic -net tap . . .
could not configure /dev/net/tun: Operation not permitted

Starting the same command as root runs fine.

How do you manage to start KVM with public bridge as a normal user?

PS. Debian shipped KVM with /etc/kvm/kvm-ifup but without /etc/kvm/kvm-
ifdown. So whenever I use kvm -net nic -net tap . . . , I'll get

/etc/kvm/kvm-ifdown: could not launch network script

Would that be OK? Would I get more and more TUN/TAP interfaces each time?

Thanks

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/i4h5ld$3a5$1...@dough.gmane.org

Javier Barroso

unread,
Aug 19, 2010, 8:30:02 AM8/19/10
to
On Wed, Aug 18, 2010 at 7:35 PM, T o n g <mlist4...@yahoo.com> wrote:
> Hi,
>
> I setup my KVM public bridge according to
> https://help.ubuntu.com/community/KVM/Networking
>
> But it doesn't say how I would start KVM with public bridge as normal
> user. This is what I get:
>
>  $ kvm -net nic -net tap . . .
>  could not configure /dev/net/tun: Operation not permitted
Maybe your user need to added to kvm group ? (I'm guessing now)

I cannot acess now to /usr/share/doc/ kvm related directories, but
sure it is documented there

Thanks


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/AANLkTiksEDq69KU1e1qJN...@mail.gmail.com

T o n g

unread,
Aug 19, 2010, 10:40:01 AM8/19/10
to
On Thu, 19 Aug 2010 14:28:54 +0200, Javier Barroso wrote:

>>  $ kvm -net nic -net tap . . .
>>  could not configure /dev/net/tun: Operation not permitted
> Maybe your user need to added to kvm group ? (I'm guessing now)

Yes, I've already add myself to the kvm group.

$ ls -Al /dev/net/tun
crw-rw-rw- 1 root kvm 10, 200 2010-08-15 00:16 /dev/net/tun

> I cannot acess now to /usr/share/doc/ kvm related directories, but sure
> it is documented there

I don't have them previously because the kvm package didn't include them
previously. Thanks for the point. I'm reading them now.

--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/i4jfgt$d7c$1...@dough.gmane.org

T o n g

unread,
Aug 19, 2010, 11:00:02 AM8/19/10
to
On Thu, 19 Aug 2010 14:36:14 +0000, T o n g wrote:

>> I cannot acess now to /usr/share/doc/ kvm related directories, but sure
>> it is documented there
>

> . . . Thanks for the point. I'm reading them now.

No, that's way too simple and doesn't cover the KVM public bridge at all.

,-----
| As an example, you can download the ‘linux-test-xxx.tar.gz’
| archive and copy the script ‘qemu-ifup’ in ‘/etc’ and configure
| properly sudo so that the command ifconfig contained in
| ‘qemu-ifup’ can be executed as root. You must verify that your
| host kernel supports the TAP network interfaces: the device
| ‘/dev/net/tun’ must be present.
|
| See Invocation to have examples of command lines using the TAP
| network interfaces.
`-----


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/i4jgse$d7c$2...@dough.gmane.org

Javier Barroso

unread,
Aug 19, 2010, 6:40:02 PM8/19/10
to
Hi,

On Thu, Aug 19, 2010 at 4:59 PM, T o n g <mlist4...@yahoo.com> wrote:
> On Thu, 19 Aug 2010 14:36:14 +0000, T o n g wrote:
>
>>> I cannot acess now to /usr/share/doc/ kvm related directories, but sure
>>> it is documented there
>>
>> . . . Thanks for the point. I'm reading them now.
>
> No, that's way too simple and doesn't cover the KVM public bridge at all.
Seems like you will have to use sudo or root:

>From qemu doc [1]
" Tap

The tap networking backend makes use of a tap networking device in the
host. It offers very good performance and can be configured to create
virtually any type of network topology. Unfortunately, it requires
configuration of that network topology in the host which tends to be
different depending on the operating system you are using. Generally
speaking, it also requires that you invoke QEMU as root."

>From another qemu-networking related site [2] (exec strace qemu -net
nic -net tap to see TUNSETIFF ioctl call):
"TAP devices are obtained by opening /dev/net/tun and invoking the
TUNSETIFF ioctl(). This is not usually allowed for unpriviledged users
so, in general, only root can use this method. "

I was wrong about adding user to kvm group, sorry

I hope this help

[1] http://wiki.qemu.org/Documentation/Networking#Tap
[2] http://people.gnome.org/~markmc/qemu-networking.html


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/AANLkTinEmUEoRw+Oyo3k8...@mail.gmail.com

T o n g

unread,
Aug 22, 2010, 8:00:02 PM8/22/10
to
On Fri, 20 Aug 2010 00:37:54 +0200, Javier Barroso wrote:

> . . . I hope this help . . .

Yes, thanks a lot!

--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/i4sdgk$9bq$1...@dough.gmane.org

0 new messages