Is there are way to change Android's default screen orientation? I have a general purpose Android computer that has no sensors.  It requires an external monitor to view output via HDMI.  It always displays in landscape unless the app running specifies portrait.  

1) The screen PHYSICALLY needs to be displayed in portrait.
2) The OS always displays in landscape, unless an app overrides orientation.

3) How to change the default (currently landscape) orientation to portrait in the OS?

Is there a setting in Android that determines default orientation or does this require a hack?  I have root access.
Run this from adb shell or from a root terminal:

content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0


Change the value to 1 if you want to go back to Landscape (2 and 3 also work for upside-down portrait and reverse landscape).