OLED display crashes when connecting USB
When your computer boots, or when you plug the board in with it booted, most likely the serial port that gets created (/dev/ttyACM0) is opened by the process modem-manager. That will cause the Arduino to reset giving you the same results you see when you reset the board in other ways.

I have had no end of trouble in the same manner with a green version of the same screen. The best results I have had is to control the power to the display and power it up at every boot.  You can do it with a simple P-channel logic level MOSFET or PNP transistor:







simulate this circuit &ndash; Schematic created using CircuitLab

If you chose, say, D3 (as an example) as your control GPIO you would go:

void setup() {
    pinMode(3, OUTPUT);
    digitalWrite(3, LOW);
    delay(1000); // Give it time to settle after powering up
    ... rest of setup code ...
}


You can also then use it to save power (if you want to) by turning the display off - simply set the pin back to INPUT and it will be turned off by R1.