"IOError: [Errno 71] Protocol error" when reading a file with python in a virtualbox debian machine "IOError: [Errno 71] Protocol error" when reading a file with python in a virtualbox debian machine linux linux

"IOError: [Errno 71] Protocol error" when reading a file with python in a virtualbox debian machine


The most probable cause of this error is a bug in the VirtualBox Linux Guest Additions, more specifically, one of its device drivers vboxguest (which communicates with the host) and vboxsf (which provides shared folder services on the guest on top of vboxguest).

Background: When using the Linux read(2) system call on VirtualBox shared files, specific conditions make the VirtualBox driver(s) fail with error 71 (EPROTO) – Protocol error (see tickets below). The error originates in the Linux kernel space and propagates via the C library to applications (see errno(3)). In this case, the application happens to be the Python interpreter.

There is nothing wrong with the Python code or file permissions. The code just performs a legitimate sequence of operations which triggers the error.

Relevant VirtualBox tickets:

According to ticket #8463, this bug (or a related one) was fixed in VirtualBox Linux Guest Additions 5.1.14 / 5.0.32 on January 17, 2017.