qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Using tap device for qemu
@ 2015-03-10  4:59 Gayathri Nagarajan
  2015-03-10  6:32 ` Shannon Zhao
  0 siblings, 1 reply; 3+ messages in thread
From: Gayathri Nagarajan @ 2015-03-10  4:59 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 915 bytes --]

I have a problem with networking in qemu. I want to use the Linux tap
device for qemu network. For that

*1. I created a bridge -*

$ sudo brctl addbr br0

*2. I used the following qemu-ifup script*

#!/bin/sh
set -x

switch=br0

if [ -n "$1" ];then
        /usr/bin/sudo /usr/sbin/tunctl -u `whoami` -t $1
        /usr/bin/sudo /sbin/ip link set $1 up
        sleep 0.5s
        /usr/bin/sudo /usr/sbin/brctl addif $switch $1
        exit 0
else
        echo "Error: no interface specified"
        exit 1
fi

*3. When I run qemu using*

$ qemu-system-i386 -m 200M -cdrom images/ss.iso -serial stdio -device
e1000,netdev=net0,mac=DE:AD:BE:EF:00:C0 -netdev
tap,id=net0,script=/home/user/qemu-ifup

*/home/user/qemu-ifup:could not launch network script*

*qemu-system-i386: -netdev tap,id=net0,script=/home/user/qemu-ifup:
Device 'tap' could not be initialized*


How do I resolve this problem?

Thank you

gayathri

[-- Attachment #2: Type: text/html, Size: 2285 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Using tap device for qemu
  2015-03-10  4:59 [Qemu-devel] Using tap device for qemu Gayathri Nagarajan
@ 2015-03-10  6:32 ` Shannon Zhao
  2015-03-10  7:20   ` Gonglei
  0 siblings, 1 reply; 3+ messages in thread
From: Shannon Zhao @ 2015-03-10  6:32 UTC (permalink / raw)
  To: Gayathri Nagarajan, qemu-devel

On 2015/3/10 12:59, Gayathri Nagarajan wrote:
> I have a problem with networking in qemu. I want to use the Linux tap device for qemu network. For that
> 
> *1. I created a bridge -*
> 
> $ sudo brctl addbr br0 
> 
> *2. I used the following qemu-ifup script*
> 
> #!/bin/sh
> set -x
> 
> switch=br0
> 
> if [ -n "$1" ];then
>         /usr/bin/sudo /usr/sbin/tunctl -u `whoami` -t $1
>         /usr/bin/sudo /sbin/ip link set $1 up
>         sleep 0.5s
>         /usr/bin/sudo /usr/sbin/brctl addif $switch $1
>         exit 0
> else
>         echo "Error: no interface specified"
>         exit 1
> fi
> 
> *3. When I run qemu using*
> 
> $ qemu-system-i386 -m 200M -cdrom images/ss.iso -serial stdio -device e1000,netdev=net0,mac=DE:AD:BE:EF:00:C0 -netdev tap,id=net0,script=/home/user/qemu-ifup
> 
> */home/user/qemu-ifup:could not launch network script*
> 

Please check whether qemu-ifup exits at this directory and qemu-ifup has executable permission.

> *qemu-system-i386: -netdev tap,id=net0,script=/home/user/qemu-ifup: Device 'tap' could not be initialized*
> 
> 
> How do I resolve this problem?
> 
> Thank you
> 
> gayathri
> 
> 


-- 
Thanks,
Shannon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Using tap device for qemu
  2015-03-10  6:32 ` Shannon Zhao
@ 2015-03-10  7:20   ` Gonglei
  0 siblings, 0 replies; 3+ messages in thread
From: Gonglei @ 2015-03-10  7:20 UTC (permalink / raw)
  To: Shannon Zhao, Gayathri Nagarajan, qemu-devel

On 2015/3/10 14:32, Shannon Zhao wrote:
> On 2015/3/10 12:59, Gayathri Nagarajan wrote:
>> I have a problem with networking in qemu. I want to use the Linux tap device for qemu network. For that
>>
>> *1. I created a bridge -*
>>
>> $ sudo brctl addbr br0 
>>
>> *2. I used the following qemu-ifup script*
>>
>> #!/bin/sh
>> set -x
>>
>> switch=br0
>>
>> if [ -n "$1" ];then
>>         /usr/bin/sudo /usr/sbin/tunctl -u `whoami` -t $1
>>         /usr/bin/sudo /sbin/ip link set $1 up
>>         sleep 0.5s
>>         /usr/bin/sudo /usr/sbin/brctl addif $switch $1
>>         exit 0
>> else
>>         echo "Error: no interface specified"
>>         exit 1
>> fi
>>
>> *3. When I run qemu using*
>>
>> $ qemu-system-i386 -m 200M -cdrom images/ss.iso -serial stdio -device e1000,netdev=net0,mac=DE:AD:BE:EF:00:C0 -netdev tap,id=net0,script=/home/user/qemu-ifup
>>
>> */home/user/qemu-ifup:could not launch network script*
>>
> 
> Please check whether qemu-ifup exits at this directory and qemu-ifup has executable permission.
> 
Yes, the script has to have executable permission.

Regards,
-Gonglei
>> *qemu-system-i386: -netdev tap,id=net0,script=/home/user/qemu-ifup: Device 'tap' could not be initialized*
>>
>>
>> How do I resolve this problem?
>>
>> Thank you
>>
>> gayathri
>>
>>
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-10  7:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-10  4:59 [Qemu-devel] Using tap device for qemu Gayathri Nagarajan
2015-03-10  6:32 ` Shannon Zhao
2015-03-10  7:20   ` Gonglei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).