LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-23-2016, 04:28 PM   #1
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 371

Rep: Reputation: 103Reputation: 103
Question qemu tun/tap problem running from qemu on slackware 14.2 64bit


running on slackware 14.2 64bit
Hi all, I have created a bridge (editing rc.inet1.conf ) giving it the ip that the eth0 used to have, and the host machine networks ok.
running
Code:
qemu-system-x86_64 -cpu qemu64 -m 4G -drive /data/images/slack14.2_64bit_base.qcow2 -boot c -net nic,vlan=0,model=i82551 -net tap,vlan=0,ifname=tap0 -enable-kvm -display gtk
with the following for /etc/qemu-ifup and /etc/qemu-ifdown
Code:
#!/bin/sh
echo "create $1"
/usr/sbin/openvpn --mktun --dev $1 --user `id -un`
/sbin/ifconfig $1 0.0.0.0 promisc up
echo "add $1 to br0"
/usr/sbin/brctl addif br0 $1
and

Code:
#!/bin/sh
echo "remove $1 from bridge br0"
brctl delif br0 $1
echo "remove device $1"
/usr/sbin/openvpn --rmtun --dev $1
i get the error message
Quote:
cannot ioctl tunsetiff tap0 device or resource busy (errno=16)
on creation of the tap device.

if I manually run
Code:
/etc/qemu-ifup
then
Code:
/etc/qemu-ifdown
I get no error messages at all.

I should say that the scripts are executable and I am running everything as root.

I can't see why the script doesn't work when called by qemu-system-x86_64 yet works fine when called directly. The echo statements just allow me to witness the script being called from either method, ie. are just for debugging.
Has anyone got any ideas how to sort this?
I should also say that the rest of the virtual machine appears to run just fine.
 
Old 09-23-2016, 04:57 PM   #2
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 890

Rep: Reputation: Disabled
Hi,

Instead of using OpenVPN to create the tun device, you might try the tool that is made specifically for that purpose: tunctl, although I have no idea if it's gonna solve your problem.

My blind guess would be that openvpn command somehow interferes, but that's only a guess.

BTW, maybe this would be of help? It's another method for doing what you want; the helper program is installed under: /usr/libexec/qemu-bridge-helper

--
Best regards,
Andrzej Telszewski

Last edited by atelszewski; 09-23-2016 at 05:02 PM.
 
1 members found this post helpful.
Old 09-23-2016, 06:13 PM   #3
slacker1337
Member
 
Registered: Jun 2012
Location: Connecticut, USA
Distribution: Slackware
Posts: 131

Rep: Reputation: 38
I avoid the ifup/down scripts and just use the qemu-bridge-helper to create my qemu VM network devices. Just
Code:
chmod u+s /usr/libexec/qemu-bridge-helper
and add "allow br0" to /etc/qemu/bridge.conf.
Code:
qemu-system-x86_64 -m 512 -net nic -net bridge,br=br0
 
1 members found this post helpful.
Old 09-24-2016, 03:29 AM   #4
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 371

Original Poster
Rep: Reputation: 103Reputation: 103
thanks guys, I'll give it a go and report back; ( although it would be nice to know why one method seems broken.)
I installed qemu using sbopkg, just for reference.
The main objective is to have the vm's on the same lan as the real lan, with the same ip4 mask, so to all intents and purposes, they are just local pc's.
 
Old 09-24-2016, 12:50 PM   #5
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 371

Original Poster
Rep: Reputation: 103Reputation: 103
the -net bridge,br=br0 works just fine, thanks slacker1337 and atelszewski
I had to create the /etc/qemu directory as it didn't exist, and then add the
Code:
allow br0
to bridge.conf as mentioned.

Last edited by timsoft; 09-24-2016 at 12:54 PM. Reason: minor layout
 
Old 09-25-2016, 07:46 PM   #6
slacker1337
Member
 
Registered: Jun 2012
Location: Connecticut, USA
Distribution: Slackware
Posts: 131

Rep: Reputation: 38
Glad to hear you got it working! Enjoy!
 
  


Reply

Tags
qemu, slackare, tap


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] QEMU not working Slackware 14.1 64bit TarFile Linux - Virtualization and Cloud 19 02-01-2015 11:05 PM
[SOLVED] Switching to TUN / TAP for KVM / QEMU - need some help fruitwerks Gentoo 2 09-21-2014 08:16 PM
[SOLVED] Problem running qemu on slackware 14.1 (32bit) insectiod Slackware 15 08-07-2014 05:54 AM
bridging, tun/tap, qemu issues kc8tbe Linux - Networking 10 03-19-2007 01:47 PM
qemu tun/tap sudo problem andbn Linux - Networking 2 10-20-2006 01:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration