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

Im running Virtualbox on a Ubuntu 12.04 server (host) and I'm running a Windows 7 as guest os. Im using the (virtual) Intel PRO/1000 MT network card.

I get good network performance for download using both nat and bridged network settings but upload speed is really slow using nat.

I have tied this on tow different servers, one brand new, and one a several years old, both gave the same result.

If you can explain this behavior or have ideas of further test I can perform please let me know.

share|improve this question

closed as off-topic by HopelessN00b Apr 3 at 8:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – HopelessN00b
If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers 3

up vote 5 down vote accepted

I used the following setting:

modifyvm <vm> --natsettings1 1500,1024,1024,1024,1024

This is what I came up with based on http://www.virtualbox.org/manual/ch09.html#nat-adv-settings

--natsettings<1-N> [<mtu>],[<socksnd>],[<sockrcv>],[<tcpsnd>], [<tcprcv>]

It looks like a dev made a units conversion issue with the send speed vs download speed. By default the "tcprcv" is way way way higher than the "tcpsnd".

share|improve this answer
    
Thanks! This really made my day. I got a great result by using low buffering and maximum send and receive windows. –  user1622094 Nov 21 '12 at 12:56
1  
I'm struggling with the same problem, and I've tried a variety of values in in the --netsettings options with no change. I'd be interested to know which precise values worked for you. Can you please share? –  Avian00 Mar 7 '13 at 16:07

On Ubuntu 14.04, I had to use the virtio NIC type to get decent speeds from VirtualBox:

modifyvm --nictype1 virtio
share|improve this answer

I did a little benchmarking.

= Summary =

  1. Use bridged adapter if possible, it is much faster than NAT.

  2. For throughput on multiple connections (winner):

    --natsettings1 1500,64,64,64,1024
    
  3. For throughput on single connection:

    --nictype1 Am79C973
    
  4. I have heard good things about virtio in other environments.

= Detailed measurements =

    # host os: windows7
    # guest os: ubuntu14

    # natsettings: $mtu,$socksnd,$sockrcv,$tcpsnd,$tcprcv
    # list of space separated results in Mbit/s from:
    # iperf -c other-box -P $x

    # --natsettings 16000,1024,1024,1024,1024
    # https://twitter.com/alphazo/status/142200878068277248
    # x:=1 :  70 100 120  97  99
    # x:=4 : 574 517 519 497 548
    # x:=8 : 552 585 509 613 597

    # --natsettings 16000,128,128,0,0
    # http://en.helpdoc-online.com/virtualbox_4.1.2/source/ch09s11.html
    # x:=1 :  57  48  52  46  54
    # x:=4 : 150 146 134 154 182 183
    # x:=8 : 204 171 277 195 186

    # --natsettings 1500,1024,1024,1024,1024
    # http://serverfault.com/questions/447775/virtualbox-slow-upload-speed-using-nat/450734#450734
    # x:=1 :  67  69  74  86  63
    # x:=4 : 514 520 614
    # x:=8 : 549 579 572

    # --natsettings 1500,64,64,64,1024
    # https://www.virtualbox.org/ticket/10034?cversion=0&cnum_hist=8
    # http://www.kiwix.org/wiki/Black%26White_Project/Compilation_Farm/Setup
    # x:=1 :  99  74  71  85  96 119 103  83 107  80
    # x:=4 : 647 696 688 677 701 540 582 498 510 533
    # x:=8 : 610 666 622 607 677 586 510 528

    # --natsettings 1500,64,64,64,2048 (my experiment 7)
    # x:=1 :  81  62  57
    # x:=4 : 179 146 151

    # --natsettings 1500,64,64,64,512 (my experiment 8)
    # x:=1 :  55  63  75
    # x:=4 : 377 380 477
    # x:=8 : 412 544 485
    # x:=16: 174 379 376

    # --natsettings 1500,64,64,64,1024 (repeat)
    # x:=4 : 673 680 745

    # --natsettings 16000,64,64,64,2048 (my experiment 9)
    # x:=1 :  48  47  59
    # x:=4 : 123 149

    # --natsettings 1500,64,64,64,1280 (my experiment 10)
    # x:=1 :  43  47  46
    # x:=4 : 145 149 159

    # --natsettings 1500,64,64,64,768 (my experiment 11)
    # x:=1 :  58  79  95
    # x:=4 : 566 470 510

    # --natsettings 1500,64,64,64,640 (my experiment 12)
    # x:=1 :  75  88  56
    # x:=4 : 550 491 547
    # x:=8 : 549 532 

    # --natsettings 1500,128,128,128,1024 (my experiment 13)
    # x:=1 :  70 109  57
    # x:=4 : 503 480 549 596

    # --natsettings 1500,32,32,32,1024 (my experiment 14)
    # x:=1 :  73  81 108
    # x:=4 : 582 598 511
    # x:=8 : 550 675 563

    # --natsettings 16000,256,256,0,0
    # http://stackoverflow.com/questions/26389285/vagrant-waiting-for-chef-zero-to-start
    # x:=1 :  64  41  60  41
    # x:=4 : 143 184 147
    # x:=8 : 122 204 210

    # --natsettings 1500,4096,4096,1024,1024 (my experiment 1)
    # x:=1 : 130  93  87 109 104
    # x:=4 : 524 565 559 566
    # x:=8 : 556 607 552 543 536 588

    # --natsettings 16000,4096,4096,1024,1024 (my experiment 2)
    # x:=1 :  84  69  78  66  86
    # x:=4 : 517 525 575 540 560
    # x:=8 : 566 576 575

    # --natsettings 16000,8182,8182,8182,8182 (my experiment 3)
    # x:=1 :  53  60  53  48  47
    # x:=4 : 170 161 177
    # x:=8 : 175 203 253 177

    # --natsettings 16000,8182,8182,128,128 (my experiment 4)
    # x:=1 :  34  44  45  45
    # x:=4 : 221 236 196
    # x:=8 : 224 277 266

    # --natsettings 16000,128,128,8182,8182 (my experiment 5)
    # x:=1 :  48  38  50
    # x:=4 : 165 203 190
    # x:=8 : 207 186 204

    # default natsettings
    # x:=1 :  41  49  46  58  48
    # x:=4 : 171 152 176 149 161
    # x:=8 : 215 203 258 208 194

    # bridged adapter (82540EM)
    # x:=1 : 826 681 860 732 824 688 788 660 665 660 731 924 787 # fantastic speeds! :D
    # x:=4 : 666 691 689 680 684
    # x:=8 : 588 587 581 572 592

    # --nictype1 virtio (default natsettings)
    # x:=1 :  13  15  14
    # x:=4 :  70  82  50
    # x:=8 : 244  96 103
    # x:=16: 103 111 196 111  96

    # --nictype1 Am79C970A (default natsettings)
    # x:=4 : 210 233 237

    # --nictype1 Am79C973 (default natsettings)
    # x:=4 : 215 244 224

    # --nictype1 82540EM (default natsettings)
    # x:=4 : 165 153 200 184

    # --nictype1 82543GC (default natsettings)
    # x:=4 : 133 147 173

    # --nictype1 82545EM (default natsettings)
    # x:=4 : 153 130 151

    # --nictype1 Am79C973 --natsettings 1500,64,64,64,1024 (my experiment 6)
    # x:=1 : 172 118 145 117 107 # really good!
    # x:=4 : 372 368 364 372 370 # why so bad?
    # x:=8 : 358 360 363
share|improve this answer

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