Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Virtualization
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Virtualization
For questions on VMWare, VirtualBox, Xen, QEMU and other virtualization software.

 
Thread Tools Display Modes
Old October 27th, 2007   #1
gazambuja
First Cup of Ubuntu
 
Join Date: Jan 2007
Beans: 12
Exclamation TUN/TAP and Ubuntu 7.10

Hi, i installed Qemu in my Ubuntu 7.10 x64, but TUN/TAP not work:

sudo qemu -hda disco.img -net nic,vlan=0 -net tap,vlan=0
/etc/qemu-ifup: could not launch network script
Could not initialize device 'tap'

I too install bridge-utils and vtun, but not work.

gustavo@LMC:~$ ls /dev/net/tun -lh
crw-rw---- 1 root root 10, 200 2007-10-14 21:44 /dev/net/tun


Any help?
gazambuja is offline   Reply With Quote
Old October 27th, 2007   #2
bodhi.zazen
Ubuntu Guru
 
bodhi.zazen's Avatar
 
Join Date: Apr 2006
Location: Montana
My beans are hidden!
Xubuntu Karmic Koala (testing)
Send a message via Yahoo to bodhi.zazen
Re: TUN/TAP and Ubuntu 7.10

You need to configure the device.

Here is the script I use : (add these lines to /etc/rc.local)

Quote:
# For Network Bridging/TAP

# Set permissions of tun device
chown root.users /dev/net/tun #If you like you can make a group "qemusers" and use "root.qemusers"
chmod g+rw /dev/net/tun

#Add a bridge, add eth0
brctl addbr br0
ifconfig eth0 0.0.0.0 promisc
brctl addif br0 eth0
dhclient br0

# Create tap1
tunctl -t tap1 -u <user> #Be sure to change "<user>" to your user name

# Enable tap1
brctl addif br0 tap1
ifconfig tap1 up
Then, enter this command :

Code:
sudo /etc/rc.local
If you do not use dhcp, you will need to set a static ip
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999


Last edited by bodhi.zazen; October 27th, 2007 at 12:00 PM..
bodhi.zazen is offline   Reply With Quote
Old October 27th, 2007   #3
gazambuja
First Cup of Ubuntu
 
Join Date: Jan 2007
Beans: 12
Re: TUN/TAP and Ubuntu 7.10

ok, i have question?
i change this line:
ifconfig eth1 0.0.0.0 promisc
to:
ifconfig eth0 0.0.0.0 promisc

(i not have eth1), but if i have eth0 with connection pppoe, this line, its fine for me?

My ifconfig now is:

gustavo@LMC:~$ ifconfig
eth0 Encapsulamento do Link: Ethernet Endereço de HW 00:1A:92:7C:0B:85
endereço inet6: fe80::21a:92ff:fe7c:b85/64 Escopo:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Métrica:1
pacotes RX:895462 erros:0 descartados:0 excesso:0 quadro:0
Pacotes TX:964223 erros:0 descartados:0 excesso:0 portadora:0
colisões:0 txqueuelen:1000
RX bytes:694405261 (662.2 MB) TX bytes:233050832 (222.2 MB)
IRQ:23 Endereço de E/S:0xc000
ppp0 Encapsulamento do Link: Protocolo Ponto-a-Ponto
inet end.: 201.95.112.43 P-a-P:200.204.210.246 Masc:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Métrica:1
pacotes RX:895124 erros:0 descartados:0 excesso:0 quadro:0
Pacotes TX:963879 erros:0 descartados:0 excesso:0 portadora:0
colisões:0 txqueuelen:3
RX bytes:674692077 (643.4 MB) TX bytes:207967694 (198.3 MB)
gazambuja is offline   Reply With Quote
Old October 27th, 2007   #4
bodhi.zazen
Ubuntu Guru
 
bodhi.zazen's Avatar
 
Join Date: Apr 2006
Location: Montana
My beans are hidden!
Xubuntu Karmic Koala (testing)
Send a message via Yahoo to bodhi.zazen
Re: TUN/TAP and Ubuntu 7.10

Ooops ;redface:

I editied my script back to eth0.

Your output looks OK to me ...

Now you need to add a bridge and tap (your internet access will go down during those steps)
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999

bodhi.zazen is offline   Reply With Quote
Old October 27th, 2007   #5
gazambuja
First Cup of Ubuntu
 
Join Date: Jan 2007
Beans: 12
Re: TUN/TAP and Ubuntu 7.10

i want have internet too (i use iptables for forwarding intenet to my guest).
gazambuja is offline   Reply With Quote
Old October 27th, 2007   #6
bodhi.zazen
Ubuntu Guru
 
bodhi.zazen's Avatar
 
Join Date: Apr 2006
Location: Montana
My beans are hidden!
Xubuntu Karmic Koala (testing)
Send a message via Yahoo to bodhi.zazen
Re: TUN/TAP and Ubuntu 7.10

LOL

Your internet will come back up once the bridge and tap are configured.

I am warning you that during the configuration process your internet connection will go down.
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999

bodhi.zazen is offline   Reply With Quote
Old October 28th, 2007   #7
gazambuja
First Cup of Ubuntu
 
Join Date: Jan 2007
Beans: 12
Re: TUN/TAP and Ubuntu 7.10

Hello, well, yesterday i install Ubuntu 7.10 x32 and for my sorprise, qemu and TUN/TAP work fine without any extrange configuration (only install and run)... But not all is good, today, i turn on my computer and qemu not work!!! the same error!

gustavo@LMC:~$ lsmod |grep tun
tun 12288 0
qemu kuboIT.img -net nic,vlan=0 -net tap,vlan=0,script=/etc/qemu-ifup
SIOCSIFADDR: Não há tal dispositivo
/etc/qemu-ifup:: ERRO ao obter marcadores da interface: Não há tal dispositivo
/etc/qemu-ifup: could not launch network script
Could not initialize device 'tap'

i not understand, i never add a bridge manualy

Last edited by gazambuja; October 28th, 2007 at 11:21 AM..
gazambuja is offline   Reply With Quote
Old October 28th, 2007   #8
bodhi.zazen
Ubuntu Guru
 
bodhi.zazen's Avatar
 
Join Date: Apr 2006
Location: Montana
My beans are hidden!
Xubuntu Karmic Koala (testing)
Send a message via Yahoo to bodhi.zazen
Re: TUN/TAP and Ubuntu 7.10

I assume you re-booted and my guess is you need to add a tap device again.

If this is the case, add the appropriate commands to /etc/rc.local and you will make a tap at boot.
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999

bodhi.zazen is offline   Reply With Quote
Old November 9th, 2007   #9
Powderhound
First Cup of Ubuntu
 
Powderhound's Avatar
 
Join Date: Nov 2007
Location: UK
Beans: 2
Ubuntu 7.10 Gutsy Gibbon
Re: TUN/TAP and Ubuntu 7.10

Hi, I have followed all the instructions in here to setup tap to allow access to the local network and Internet but I am unable to do so.
Could someone please look at my config and hopefully point me inthe right direction.

rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# For Network Bridging/TAP

# Set permissions of tun device
chown root.users /dev/net/tun #If you like you can make a group "qemusers" and use "root.qemusers"
chmod g+rw /dev/net/tun

#Add a bridge, add eth0
brctl addbr br0
ifconfig eth0 0.0.0.0 promisc
brctl addif br0 eth0
dhclient br0

# Create tap1
tunctl -t tap1 -u currans #Be sure to change "<user>" to your user name

# Enable tap1
brctl addif br0 tap1
ifconfig tap1 up

exit 0

================

ifconfig

currans@currans-desktop:~$ ifconfig
br0 Link encap:Ethernet HWaddr 00:02:A5:8F:82:C1
inet addr:10.238.38.20 Bcast:10.238.38.255 Mask:255.255.255.0
inet6 addr: fe80::202:a5ff:fe8f:82c1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14184 errors:0 dropped:0 overruns:0 frame:0
TX packets:3582 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2555368 (2.4 MB) TX bytes:404937 (395.4 KB)

eth0 Link encap:Ethernet HWaddr 00:02:A5:8F:82:C1
inet6 addr: fe80::202:a5ff:fe8f:82c1/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:14322 errors:0 dropped:0 overruns:0 frame:0
TX packets:3616 errors:0 dropped:0 overruns:0 carrier:0
collisions:1 txqueuelen:1000
RX bytes:2782373 (2.6 MB) TX bytes:409806 (400.2 KB)

qtap0 Link encap:Ethernet HWaddr 00:FF:B9:4F:28:3E
inet addr:10.111.111.254 Bcast:10.111.111.255 Mask:255.255.255.0
inet6 addr: fe80::2ff:b9ff:fe4f:283e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:53 (53.0 b) TX bytes:3601 (3.5 KB)

tap0 Link encap:Ethernet HWaddr 00:FF:66:CE:96:A5
inet addr:172.20.0.1 Bcast:172.20.255.255 Mask:255.255.0.0
inet6 addr: fe80::2ff:66ff:fece:96a5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:77 errors:0 dropped:0 overruns:0 frame:0
TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:7644 (7.4 KB) TX bytes:3888 (3.7 KB)

tap1 Link encap:Ethernet HWaddr 00:FF:A9:AB:16:31
inet6 addr: fe80::2ff:a9ff:feab:1631/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:10374 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)


ipconfig on the windows 98 virtual machine

dhcp enabled
IP address 10.0.2.15
default gateway 10.0.2.2
dhcp server 10.0.2.2

I also don't know where to disable the Qemu dhcp server, if I need to to prevent it picking up a dhcp address

Thanks for any assistance you can offer
Powderhound is offline   Reply With Quote
Old August 3rd, 2008   #10
shogun1234
First Cup of Ubuntu
 
Join Date: Sep 2006
My beans are hidden!
Re: TUN/TAP and Ubuntu 7.10

I follow the script and save that script as setup_qemu_network.sh. The content is as follow:

Code:
sudo /sbin/brctl addbr br0
sudo /sbin/ifconfig wlan0 0.0.0.0 promisc
sudo /sbin/brctl addif br0 wlan0
sudo /sbin/dhclient br0

/bin/tunctl -t tap1 -u `whoami`

sudo /sbin/brctl addif br0 tap1
sudo /sbin/ifconfig tap1 up
Its output shows:
Code:
device br0 already exists; can't create bridge with the same name
device wlan0 is already a member of a bridge; can't enslave it to bridge br0.
Internet Systems Consortium DHCP Client V3.0.6
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

wmaster0: unknown hardware address type 801
wmaster0: unknown hardware address type 801
Listening on LPF/br0/00:1f:3b:21:25:13
Sending on   LPF/br0/00:1f:3b:21:25:13
Sending on   Socket/fallback
DHCPREQUEST on br0 to 255.255.255.255 port 67
DHCPREQUEST on br0 to 255.255.255.255 port 67
DHCPDISCOVER on br0 to 255.255.255.255 port 67 interval 3
DHCPOFFER from 192.168.1.254
DHCPREQUEST on br0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.254
bound to 192.168.1.68 -- renewal in 1364 seconds.
Set 'tap1' persistent and owned by uid 1000
device tap1 is already a member of a bridge; can't enslave it to bridge br0.
Then I startup qemu with following code:
Code:
qemu -hda c.img -m 512 -net nic -net tap -localtime
but it returns
Code:
warning: could not configure /dev/net/tun: no virtual network emulation
Could not initialize device 'tap'
How to solve this problem?

Thank you very much,



Quote:
Originally Posted by bodhi.zazen View Post
You need to configure the device.

Here is the script I use : (add these lines to /etc/rc.local)



Then, enter this command :

Code:
sudo /etc/rc.local
If you do not use dhcp, you will need to set a static ip
shogun1234 is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:04 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry