Handy little copy and paste for changing the resolution on a headless X Windows based system (Works in teamviewer)
Create a file in your home directory that will run when a new x session is opened for your user:
cd ~ nano .xprofile
Put the below in the file (adjusting resolution if you want something other than 1080):
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync xrandr --addmode VIRTUAL1 1920x1080_60.00 xrandr --output VIRTUAL1 --mode 1920x1080_60.00 xrandr --output LVDS1 --off
Don’t forget to mark the file as executable (may or may not be required):
chmod 777 .xprofile