VirtualBox

Opened 5 years ago

Closed 2 years ago

#19122 closed enhancement (fixed)

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 (7)

in reply to:  description ; comment:1 by Socratis, 5 years ago

Guest type: otherall
Host type: Linuxall
Summary: Can't increase MTU size for a Host-only adapter on linux hostRFE: Can't increase MTU size for a Host-Only adapter
Type: defectenhancement

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 by GnomeUser, 5 years ago

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 5 years ago by GnomeUser (previous) (diff)

in reply to:  1 comment:3 by GnomeUser, 5 years ago

Have also found a relevant issue #12722

comment:4 by GnomeUser, 4 years ago

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 by GnomeUser, 4 years ago

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 by Klaus Espenlaub, 4 years ago

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.

comment:7 by aeichner, 2 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette