# Slow Network in KVM/qemu Guests

## risq

Hi,

im running a Gentoo Host for various virtual machines.

The Host is connected via Gigabit network to my LAN, copy speed between a client on the LAN and the gentoo host is around 100 mb/s , which is quite ok and only limited by the harddrive speed.

Disk speed inside the virtual machines is also ok, but i have network issues:

- network speed between virtual machines is very slow (around 5mb/s on a copy job)

- network speed between host and a virtual machine is also very slow (also around 5mb/s on a copy job)

Im using a bridge setup with those two tap devices:

tap0      Link encap:Ethernet  HWaddr 00:00:00:00:00:01  

          inet6 addr: fe80::200:ff:fe00:1/64 Scope:Link

          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1

          RX packets:612301 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1142934 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:500 

          RX bytes:463080879 (441.6 MiB)  TX bytes:226302033 (215.8 MiB)

tap1      Link encap:Ethernet  HWaddr 00:00:00:00:00:02  

          inet6 addr: fe80::200:ff:fe00:2/64 Scope:Link

          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1

          RX packets:5907 errors:0 dropped:0 overruns:0 frame:0

          TX packets:792352 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:500 

          RX bytes:540048 (527.3 KiB)  TX bytes:69026827 (65.8 MiB)

Inside thhe virtual machines i use the virtio driver.

those are the setups for the vms (one windows machine, one backtrack5)

qemu-system-x86_64 -enable-kvm -usb -drive file=/virt/win7.img,cache=none,if=virtio -net nic,macaddr=00:00:00:00:00:10 -net tap,ifname=tap0,script=no,downscript=no -m 2048M -vnc :1 -rtc base=2009-05-05 &

qemu-system-x86_64 -enable-kvm -drive file=/virt/bt5.img,cache=none,if=virtio -net nic,macaddr=00:00:00:00:00:11  -net tap,ifname=tap1,script=no,downscript=no -m 1024M -vnc :2 &

Any hints are welcome..thx in advance

----------

## NeddySeagoon

risq,

```
- network speed between virtual machines is very slow (around 5mb/s on a copy job) 

- network speed between host and a virtual machine is also very slow (also around 5mb/s on a copy job) 
```

Does that mean from the KVM host to a VM or from an external host to a VM ?

For the former, data is read from the host HDD and written to the VM HDD, which is i reality just somewhere else on the host HDD.

For the latter - what protocol do you uae for the copy?

----------

## cach0rr0

 *risq wrote:*   

> 
> 
> qemu-system-x86_64 -enable-kvm -usb -drive file=/virt/win7.img,cache=none,if=virtio -net nic,macaddr=00:00:00:00:00:10 -net tap,ifname=tap0,script=no,downscript=no -m 2048M -vnc :1 -rtc base=2009-05-05 &
> 
> 

 

disk throughput on Windows 7 has been abysmal for me

possible to rule out this being a "windows virtio sucks" issue? Meaning, try a file transfer from your BT5 image, to your host OS. 

For me, gentoo guest to gentoo host is very quick, gentoo guest to another gentoo guest is very quick, but win7 guest to anything is very slow.

----------

