You are not logged in.

#1 2012-08-15 19:48:39

nixIT
Member
Registered: 2010-01-13
Posts: 429

QEMU/KVM bridge networking howto

Hello all,

I had a dialog here:  https://bbs.archlinux.org/viewtopic.php?id=145177  but I inadvertently hijacked the OP thread, for that I deeply apologize and decided to start my own thread.

I've been struggling with getting my bridge networking working with QEMU/KVM.  I would love to get my KVM Windows 7 install working with bridge network so I can access my internal lan, but so far I am out of luck.  When I follow the Wiki's I completely hose my network settings and can't get online with my Arch host.

I've followed the wiki's here:

https://wiki.archlinux.org/index.php/QE … al_network

should I be using this wiki instead:

https://wiki.archlinux.org/index.php/KV … Networking

I'm kinda confused on how to approach this since there are separate wikis for QEMU and KVM.

I have a couple of confusing questions, that I hope someone can answer, or lead me in a direction to help me find a solution.  Free internet beer for helping.  smile

From a vanilla install of Arch, if I would like to run Windows 7 64-bit in a VM, should I use QEMU or KVM?  I did get the windows 7 up and running, not sure how, but it's not on my internet LAN, the VM can only access the internet.

Can someone help me out step by step or pointing me in a direction that can help get a bridge network set up between my host, which will need a static IP address, and my VM, which I would prefer to have another static IP address on my network.

I've tried using virtualbox but the performance was slower than using QEMU/KVM.

BTW, what's the difference between QEMU and KVM?  I'm confused by that as well.  I would even be willing to write up a "beginners guide" if I can get help getting mine set up.

any help is greatly appreciated.

--nixIT


ASRock 970 Extreme4  | AMD FX 8350 | 32GB G.SKILL Ripjaw X  | 180GB Corsair Force Series GS SSD | MSI GeForce GTX 960 GTX Gaming 4G 4GB

Offline

#2 2012-08-16 09:17:05

niklaas
Member
From: Vienna
Registered: 2012-07-24
Posts: 26

Re: QEMU/KVM bridge networking howto

nixIT wrote:

any help is greatly appreciated.

I'm running KVM on several productive servers with multiple virtual servers. But they're all running Debian or CentOS, so I don't know about doing this on arch, yet.

Nevertheless, this wiki entry http://cooker.techsnail.com/index.php/X … d_IPTables helped me a lot because it also points out a work around for the fact that libvirt overwrites the existing iptables rules which (of course) causes lot's of trouble when setting up the (virtual) network configuration. The wiki entry gives quite a good overview but unfortunately was very difficult to find.

I'd like to share it*, maybe this helps.

*I didn't write it. ;-)

Offline

#3 2012-08-16 12:55:45

nixIT
Member
Registered: 2010-01-13
Posts: 429

Re: QEMU/KVM bridge networking howto

@niklaas,

Thanks for the wiki link.  I will give it a shot, anything at this point to help me get my VM's on my lan is a big help.

--nixIT

**EDIT... Just opened the link and read through it, I think part of my brain exploded.  smile  I didn't understand much of that if any of it.  sad

Last edited by nixIT (2012-08-16 19:07:03)


ASRock 970 Extreme4  | AMD FX 8350 | 32GB G.SKILL Ripjaw X  | 180GB Corsair Force Series GS SSD | MSI GeForce GTX 960 GTX Gaming 4G 4GB

Offline

#4 2012-08-16 20:57:23

nixIT
Member
Registered: 2010-01-13
Posts: 429

Re: QEMU/KVM bridge networking howto

does this post:  http://www.archlinux.org/news/netcfg-28 … atibility/  affect setting up a bridge network to use in QEMU/KVM?

--nixIT


ASRock 970 Extreme4  | AMD FX 8350 | 32GB G.SKILL Ripjaw X  | 180GB Corsair Force Series GS SSD | MSI GeForce GTX 960 GTX Gaming 4G 4GB

Offline

#5 2012-08-18 23:38:43

nixIT
Member
Registered: 2010-01-13
Posts: 429

Re: QEMU/KVM bridge networking howto

Anyone? 

Anyone using Qemu/KVM with Arch have any tips to get bridged networking running?

--nixIT


ASRock 970 Extreme4  | AMD FX 8350 | 32GB G.SKILL Ripjaw X  | 180GB Corsair Force Series GS SSD | MSI GeForce GTX 960 GTX Gaming 4G 4GB

Offline

#6 2012-08-19 00:11:22

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 717
Website

Re: QEMU/KVM bridge networking howto

I do things manually on my system so, for two VM:

    ip tuntap add dev tap0 mode tap user djgera
    ip tuntap add dev tap1 mode tap user djgera
    brctl addbr br0
    brctl setfd br0 0.0
    brctl addif br0 eth0
    brctl addif br0 tap0
    brctl addif br0 tap1
    ip link set dev br0 up
    ip link set dev tap0 up
    ip link set dev tap1 up
    ip addr del 192.168.0.77/24 dev eth0
    ip addr add 192.168.0.77/24 broadcast + dev br0
    ip route add default via 192.168.0.1

then each qemu-kvm instance that I lauch add:

   -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:00 -netdev type=tap,id=net0,ifname=tap0,script=no,downscript=no
   -device virtio-net-pci,netdev=net1,mac=52:54:00:12:34:01 -netdev type=tap,id=net1,ifname=tap1,script=no,downscript=no

Offline

#7 2012-08-19 01:45:31

nixIT
Member
Registered: 2010-01-13
Posts: 429

Re: QEMU/KVM bridge networking howto

@djgera,

Thanks for responding.  What kind of IP address(static, dynamic) will this give the host and client?  do I just execute the lines from the CLI, or do I put them in a script/configuration file?

--nixIT


ASRock 970 Extreme4  | AMD FX 8350 | 32GB G.SKILL Ripjaw X  | 180GB Corsair Force Series GS SSD | MSI GeForce GTX 960 GTX Gaming 4G 4GB

Offline

#8 2012-08-19 03:17:57

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 717
Website

Re: QEMU/KVM bridge networking howto

192.168.0.77 is my IP on my HOST and is set static, I am behind a router, so in guest or set via static or dynamic, just what your want.

If you want to put in a script , sure you can do.

Offline

#9 2012-08-19 09:46:00

niklaas
Member
From: Vienna
Registered: 2012-07-24
Posts: 26

Re: QEMU/KVM bridge networking howto

nixIT wrote:

**EDIT... Just opened the link and read through it, I think part of my brain exploded.  smile  I didn't understand much of that if any of it.  sad

Well, I think, that's the catch: KVM may be faster than virtualbox but it's more difficult as well. But there's some hope: The first time I read the article, I also didn't understand everything. Just try to search some more information about it on the internet. There's plenty about it, especially about the "network topic". And it's a good thing to know more about the media you are using every day.

Offline

Board footer

Powered by FluxBB