Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to setup a virtual networking environment using open-wrt qemu and vde2 The script to boot two qemu instances and conenct them together is the following

IMAGE=/home/northpole/openwrt/trunk/bin/x86/openwrt-x86-generic-combined-jffs2-128k.img

sudo killall -q qemu
sudo killall -q wirefilter
sudo killall -q vde_switch

vde_switch -d --hub --sock num1.ctl -f colourful.rc
vde_switch -d --hub --sock num2.ctl -f colourful.rc
cp ${IMAGE} num1.image
cp ${IMAGE} num2.image

sudo qemu \
    -no-acpi -m 32M \
    -net vde,sock=num1.ctl,port=1 -net nic,macaddr=fe:fe:00:00:01:01 \
    -net nic -net tap,ifname=tapwrt1 \
    num1.image&

sudo qemu \
   -no-acpi -m 32M \
   -net vde,sock=num2.ctl,port=2 -net nic,macaddr=fe:fe:00:00:02:01 \
  -net nic -net tap,ifname=tapwrt2 \
 num2.image&

sudo ifconfig tapwrt1 inet 192.168.2.1 up 
sudo ifconfig tapwrt2 inet 192.168.3.1 up
wirefilter --daemon -v num1.ctl:num2.ctl

qemu num2.image boots properly

but this script, when run issues

warning: could not configure /dev/net/tun: no virtual network emulation

i'm not very familiar with all of qemu vde wirefilter and bash scripting so any additional tips/guides would be much appreciated

bellow are attached the diagnostics

bash -v ./test.sh 
IMAGE=/home/northpole/openwrt/trunk/bin/x86/openwrt-x86-generic-combined-jffs2-128k.img

sudo killall -q qemu
sudo killall -q wirefilter
sudo killall -q vde_switch

vde_switch -d --hub --sock num1.ctl -f colourful.rc
vde_switch -d --hub --sock num2.ctl -f colourful.rc
cp ${IMAGE} num1.image
cp ${IMAGE} num2.image

sudo qemu \
-no-acpi -m 32M \
-net vde,sock=num1.ctl,port=1 -net nic,macaddr=fe:fe:00:00:01:01 \
-net nic -net tap,ifname=tapwrt1 \
num1.image&

sudo qemu \
   -no-acpi -m 32M \
   -net vde,sock=num2.ctl,port=1 -net nic,macaddr=fe:fe:00:00:02:01 \
  -net nic -net tap,ifname=tapwrt2 \
 num2.image&

sudo ifconfig tapwrt1 inet 192.168.2.1 up 
sudo ifconfig tapwrt2 inet 192.168.3.1 up
warning: could not configure /dev/net/tun: no virtual network emulation
warning: could not configure /dev/net/tun: no virtual network emulation
wirefilter --daemon -v num1.ctl:num2.ctl

the bash -x outputs the same

share|improve this question
    
What's the output of ls -l /dev/net/tun, and what user are you running this as? –  mgorven May 30 '12 at 1:05
    
@mgorven i'm running as a user (i have root priviledges) and crw-rw-rw- 1 root root 10, 200 Jun 1 2012 /dev/net/tun –  NorthPole May 31 '12 at 18:34
add comment

1 Answer

up vote 0 down vote accepted

I fixed it:

tun module was missing for some reason and i didnt need qemu's network config script (/etc/qemu-ifup) so modprobe'd tun removed the script and ran as root and it worked

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.