Screen randomly rotates on Ubuntu 17.10

I have an HP Pavilion 14 inch laptop.

I recently upgraded from Ubuntu 17.04 to 17.10.

Everything went well, but when I boot up the system, my screen rotation was set to left.

Then I tried using xandr to rotate my screen, but my every effort failed.

Can anybody help me on the same?


Had the same issue. Seems like a bug. I disabled the screen rotation from task bar(top right) and it went to landscape mode. Just check if this works for you. Also, xrandr does not work on Wayland.

gsettings set org.gnome.settings-daemon.peripherals.touchscreen orientation-lock true

Additionally, the below command ought to disable the orientation plugin completely.

gsettings set org.gnome.settings-daemon.plugins.orientation active false

Also, gnome provides an option to rotate the screen from Settings -> Devices -> Displays -> Orientation setting (search for displays in 'Activities').


One of the easiest way that I found to fix this problem on Ubuntu 17.10:

enter image description here


Solution: If you're stuck, here's a solution that worked on a 2012 HP Envy 14":

sudo apt-get remove iio-sensor-proxy (UbuntuForums Source)

Then log out and log back in.

Caveat: orientation lock icon is gone from the menu bar and you can't use the gyroscope (if it even exists in your device) to change orientation but that's not a problem since you don't want orientation changes anyway :). If you ever want to re-enable the feature, reverse the process:

sudo apt-get install iio-sensor-proxy

Observations: The HP Envy did not respond to the gsettings changes suggested here. It also did not respond to physically rotating the laptop or tilting the screen. Orientation settings were also missing from the settings application.

For some reason the auto-rotate code gets triggered after it's been asleep and it's impossible to get it to return to normal without CLI intervention.

The laptop does not recognize orientation changes or tilting the lid so I'm not sure why the orientation (rotation) automatically changed in the first place.


Weirdly, I noted my screen changed orientation when I plugged in my DS4 (PS4) controller while Steam was running. The gyro in the controller flipped my screen. I had to turn the controller on its head to get the proper screen orientation and then locked the orientation via task bar icon.

This is not going to be a solution for everyone, but it solved my issue.


I am having the same issue on a HP pavilion 15 touchscreen (skylake).

There is no Orientation under Display!

While turning the laptop upside down and setting the orientation-lock true I got it back on track and it seems to stay there.