VirtualBox

Ticket #19122 (new enhancement)

Opened 20 months ago

Last modified 3 months ago

RFE: Can't increase MTU size for a Host-Only adapter

Reported by: GnomeUser Owned by:
Component: network Version: VirtualBox 6.0.14
Keywords: Cc:
Guest type: all Host type: all

Description

The host is Ubuntu 18.04.3

# ip link set vboxnet0 mtu 9000 Error: mtu greater than device maximum.

Change History

comment:1 in reply to: ↑ description ; follow-up: ↓ 3 Changed 20 months ago by socratis

  • Host type changed from Linux to all
  • Type changed from defect to enhancement
  • Guest type changed from other to all
  • Summary changed from Can't increase MTU size for a Host-only adapter on linux host to RFE: Can't increase MTU size for a Host-Only adapter

Replying to GnomeUser:

# ip link set vboxnet0 mtu 9000
Error: mtu greater than device maximum.

That's right, MTU sizes can only be set for the "NAT" option. Changing this from a "Defect" to a "Request for enhancement" (RFE).

Are you trying to solve a specific problem by attempting to do this?

comment:2 Changed 20 months ago by GnomeUser

It is just slow, the host is running proxy and the guest can barely achieve 300 Mb/s reaching the network. Very high CPU load. I've tried to increase MTU to lower the load and probably gain more speed when I run into this error.

Host type changed from Linux to all

On Win10 host running VB 10.0.8, command

netsh interface ipv4 set subinterface "VirtualBox Host-Only Ethernet Adapter" mtu=9000

works fine. It seems to be linux host specific

Last edited 20 months ago by GnomeUser (previous) (diff)

comment:3 in reply to: ↑ 1 Changed 20 months ago by GnomeUser

Have also found a relevant issue #12722

comment:4 Changed 13 months ago by GnomeUser

To fix the issue just one line of code needs to be added to the function vboxNetAdpNetDevInit of VBoxNetAdp-linux.c here is the patch:

--- src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
+++ src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
@@ -274,6 +274,9 @@
     pNetDev->hard_start_xmit = vboxNetAdpLinuxXmit;
     pNetDev->get_stats = vboxNetAdpLinuxGetStats;
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+    pNetDev->max_mtu = 65535;
+#endif
 
     pNetDev->ethtool_ops = &gEthToolOpsVBoxNetAdp;

I've built and tested it. Please include it into the next release.

comment:5 Changed 3 months ago by GnomeUser

In the VB 6.1.20 the patch was partially accepted, but the maximum MTU size was overwritten to 16110. Why? It is a virtual device.

comment:6 Changed 3 months ago by klaus

Yes, the device is virtual, but the emulated devices inside the VM still have limitations. Intel E1000 has a limitation of 16128 bytes according to  linux 5.11 driver code. This means a MTU of 16110. I know that virtio-net would be able to deal with more, but allowing more than the most frequently used NIC in VMs may also increase the number of complaints.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use