Solved Networking hangs on large uploads from 13.0-RELEASE guest

I have a VB VM as a local repo for packages used by my server and test machines. The host (PCLinuxOS) is configured as follows:
Code:
]$ /sbin/ifconfig
br0       Link encap:Ethernet  HWaddr 1A:D3:64:EC:9D:3A 
          inet addr:10.0.2.100  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::f1:c1ff:fe34:7c22/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:271 errors:0 dropped:0 overruns:0 frame:0
          TX packets:323 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:25182 (24.5 KiB)  TX bytes:33729 (32.9 KiB)

eth0      Link encap:Ethernet  HWaddr FC:AA:14:94:8B:14 
          inet addr:192.168.1.xx  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::feaa:14ff:fe94:8b14/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:477832 errors:0 dropped:0 overruns:0 frame:0
          TX packets:256791 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:400610989 (382.0 MiB)  TX bytes:119935506 (114.3 MiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:37 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5807 (5.6 KiB)  TX bytes:5807 (5.6 KiB)

tap0      Link encap:Ethernet  HWaddr 6A:09:69:99:B8:EC 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap1      Link encap:Ethernet  HWaddr 1A:D3:64:EC:9D:3A 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap2      Link encap:Ethernet  HWaddr FE:97:FD:6B:4C:ED 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap3      Link encap:Ethernet  HWaddr 2A:73:44:CD:20:B2 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap4      Link encap:Ethernet  HWaddr AE:5A:8E:34:A8:03 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap5      Link encap:Ethernet  HWaddr FE:63:A5:2C:D8:0C 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap6      Link encap:Ethernet  HWaddr DA:E0:CD:E5:1F:C3 
          inet6 addr: fe80::d8e0:cdff:fee5:1fc3/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:329 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap7      Link encap:Ethernet  HWaddr 9A:80:1E:FA:01:66 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
(LAN IP address munged) and the guest on tap6 with bridged networking using the emulated Intel 8254OEM adapter. Iptables is used on the host to forward packets to and from the VM. This worked well on 11.4 and mostly works on 13.0.

Code:
]# ifconfig
em0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
        ether 08:00:27:db:c2:15
        inet 10.0.2.161 netmask 0xffffff00 broadcast 10.0.2.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

However, on upgrading to 13.0 yesterday I had great difficulty updating and reinstalling packages on my machines because when downloading packages by http from the VM, every few files the connectivity from the VM would drop. There were no error messages, but communication between the VM and the rest of the network would stop until I issued init 1 and exited, which would restart the network. It would then be possible to download a few more packages to the local machine before the VM lost networking again. It is as if the VM chokes on uploading large files to the machine requesting them.

I have tried changing the network adapter in VB but nothing other than the current card will work. Paravirtualisation fails, possibly because as a build and serve packaging machine it does not have Guest Additions installed since X is not used.

In the absence of error messages it's difficult to know how to troubleshoot this problem.
 
A very good question. I'll have to wait until it happens again as my VB logs only go back 3 days and I haven't needed to download anything from the build machine since the major version upgrade of my server., which obviously needed a large number of packages to be reinstalled at once.

It could be months or even years before this annoyance surfaces again,
 
Try configuring virtualbox so it uses vtnet(4) (virtio-net) interfaces instead.

Paravirtualisation fails, possibly because as a build and serve packaging machine it does not have Guest Additions installed since X is not used.
Don't need the guest additions for that, vtnet(4) is included in the GENERIC kernel. If you need the guest additions, there's a version without X; emulators/virtualbox-ose-additions-nox11 (or emulators/virtualbox-ose-additions-nox11-legacy if you need the older version).
 
I have a VB VM as a local repo for packages used by my server and test machines. The host (PCLinuxOS) is configured as follows:
Code:
]$ /sbin/ifconfig
br0       Link encap:Ethernet  HWaddr 1A:D3:64:EC:9D:3A
          inet addr:10.0.2.100  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::f1:c1ff:fe34:7c22/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:271 errors:0 dropped:0 overruns:0 frame:0
          TX packets:323 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:25182 (24.5 KiB)  TX bytes:33729 (32.9 KiB)

eth0      Link encap:Ethernet  HWaddr FC:AA:14:94:8B:14
          inet addr:192.168.1.xx  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::feaa:14ff:fe94:8b14/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:477832 errors:0 dropped:0 overruns:0 frame:0
          TX packets:256791 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:400610989 (382.0 MiB)  TX bytes:119935506 (114.3 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:37 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5807 (5.6 KiB)  TX bytes:5807 (5.6 KiB)

tap0      Link encap:Ethernet  HWaddr 6A:09:69:99:B8:EC
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap1      Link encap:Ethernet  HWaddr 1A:D3:64:EC:9D:3A
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap2      Link encap:Ethernet  HWaddr FE:97:FD:6B:4C:ED
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap3      Link encap:Ethernet  HWaddr 2A:73:44:CD:20:B2
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap4      Link encap:Ethernet  HWaddr AE:5A:8E:34:A8:03
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap5      Link encap:Ethernet  HWaddr FE:63:A5:2C:D8:0C
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap6      Link encap:Ethernet  HWaddr DA:E0:CD:E5:1F:C3
          inet6 addr: fe80::d8e0:cdff:fee5:1fc3/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:329 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tap7      Link encap:Ethernet  HWaddr 9A:80:1E:FA:01:66
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
(LAN IP address munged) and the guest on tap6 with bridged networking using the emulated Intel 8254OEM adapter. Iptables is used on the host to forward packets to and from the VM. This worked well on 11.4 and mostly works on 13.0.

Code:
]# ifconfig
em0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
        ether 08:00:27:db:c2:15
        inet 10.0.2.161 netmask 0xffffff00 broadcast 10.0.2.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

However, on upgrading to 13.0 yesterday I had great difficulty updating and reinstalling packages on my machines because when downloading packages by http from the VM, every few files the connectivity from the VM would drop. There were no error messages, but communication between the VM and the rest of the network would stop until I issued init 1 and exited, which would restart the network. It would then be possible to download a few more packages to the local machine before the VM lost networking again. It is as if the VM chokes on uploading large files to the machine requesting them.

I have tried changing the network adapter in VB but nothing other than the current card will work. Paravirtualisation fails, possibly because as a build and serve packaging machine it does not have Guest Additions installed since X is not used.

In the absence of error messages it's difficult to know how to troubleshoot this problem.
Currently I have DragonFlyBSD and OpenBSD in VM. Neither supports Virtualbox so obviously no VB additions installed. However downloading large files works (I downloaded 4.6GB file so if this is large enough then VM does not affect internet connectivity), Similarly I just downloaded large file (dvd) now in FreeBSD-13 in VM. So it looks like neither VM software nor FreeBSD in VM is causing an issue with the connectivity and downloading large files.
I would check messages for errors and maybe try tcpdump when downloading to see if there are any errors from VM networking.
I would suggest to look at possible VM host networking errors also.
Maybe some sysctl network tuning.
 
What do you mean by downloading? My VM is the source of the files so it is uploading them from its perspective. It is my server which is downloading the files from the VM. This problem only began when I upgraded the VM from 11.4 to 13.0. Before then package upgrades on the server were downloaded from the VM even if Apache and mod_php?? or perl were included. The problem appears to be in the VM because restarting the connection in the VM seems to reset it, whereas messing around on the host or the server does not..
 
Try configuring virtualbox so it uses vtnet(4) (virtio-net) interfaces instead.


Don't need the guest additions for that, vtnet(4) is included in the GENERIC kernel. If you need the guest additions, there's a version without X; emulators/virtualbox-ose-additions-nox11 (or emulators/virtualbox-ose-additions-nox11-legacy if you need the older version).
Thanks very much, but it doesn't seem to work. When I select that device in VB to be used as the ethernet adapter the VM has no networking at all. I tried adding the module in /etc/rc.conf but just saw a message on boot telling me it was already loaded, so I thought it might need to interface with something on the VB side through GA. If not, I don't know why it wouldn't work unless I have to do something to change the networking configuration when changing adapter. I don't know what that would be as the only configuration I know is to set two parameters (ifconfig_em0 and defaultrouter) in /etc/rc.conf.
 
What do you mean by downloading? My VM is the source of the files so it is uploading them from its perspective. It is my server which is downloading the files from the VM. This problem only began when I upgraded the VM from 11.4 to 13.0. Before then package upgrades on the server were downloaded from the VM even if Apache and mod_php?? or perl were included. The problem appears to be in the VM because restarting the connection in the VM seems to reset it, whereas messing around on the host or the server does not..
It works with NFS server. I can upload the same 4.6GB file to the server.
FreeBSD-14 in VM networking works without virtualbox additions.

Maybe something happened to your client, but you don't need vb additions to setup networking. If your case is different, then your setup is probably broken.

Try to setup NAT instead of bridge
 
… the only configuration I know is to set two parameters (ifconfig_em0 and defaultrouter) in /etc/rc.conf.

Before starting the guest:

1625895237260.png


– then in the guest:

sysrc -f /etc/rc.conf ifconfig_em0+=NOAUTO
sysrc -f /etc/rc.conf if_vtnet_load="YES"
sysrc -f /etc/rc.conf ifconfig_vtnet0="DHCP"
service netif stop em0 && service netif start vtnet0
 
I need bridged because my VMs need to accept incoming connections, not just outgoing requests. NAT, so far as I know, only works for clients, not servers. The same applies to DHCP. I need static addresses.

However, the key was to change ifconfig_em0=... to ifconfig_vtnet0=..., so thanks @grahamperrin for the tip.

Now to see whether this makes a difference. That might take some time!
 
My comments weren't particularly aimed at you. Others were suggesting I should change from bridged to NAT or use DHCP, neither of which meet my needs, and which turn out to be irrelevant. What I didn't understand was that the ifconfig... parameter has to be suffixed appropriately to match the adapter in use, even if they are all emulated ethernet adapters. Once I knew that things just worked.

Update: I've now downloaded the entire local repository using a web browser and nothing hung, so it appears changing the network adapter has fixed the problem. As it's likely this is a quirk between 13.0-RELEASE and VB and its virtualised Intel chip and using paravirtualisation works I think I'll call this one solved for now.
 
Back
Top