9

If you've used an Android device, you're aware that there are some apps that force the display to portrait and ignore the device's orientation sensor. On a real device, this is not a problem, as you can physically rotate the device in your hands to use the app.

However, I am trying to use such an app on android-x86 in Oracle's VirtualBox on a Linux Mint PC, and cannot physically rotate my monitor. I have tried the f9-f12 keys that send a rotation event to the app, but since the orientation is fixed, this has no effect.

Short of keeping my neck cricked at a 90° angle, how might I configure android-x86, VirtualBox, and/or Linux to display the app right side up? To be clear, I don't have access to the source code of the app.

Aprel
  • 484
  • 1
  • 5
  • 10
  • 3
    You would want to change the orientation of your screen. In good 'old windows simply hit Ctrl+Alt+Arrow key to rotate in that direction. How about this for linux: http://www.faqforge.com/linux/rotating-screen-in-ubuntu-and-linux-mint/ – chiliNUT Feb 05 '15 at 04:09
  • 1
    @chiliNUT Can confirm changing whole screen orientation works, but not ideal. Would be perfect if only VirtualBox window was rotated. – Aprel Feb 05 '15 at 04:26
  • 1
    I think thats kind of a tall order! On a windows platform I've employed the technique of rotating the entire screen and its been good enough for me. I could see from a convenience perspective that it might be nice to rotate just the virtualbox window, but AFAIK that is not possible – chiliNUT Feb 05 '15 at 04:31
  • This is not a programming question and should have been asked on SuperUser instead. – SubliemeSiem Feb 26 '16 at 14:38
  • Related: https://stackoverflow.com/questions/13451231/how-to-resize-physical-android-screen-from-terminal-shell – baptx Jun 18 '21 at 11:39

2 Answers2

13

For sure now is too late to reply, anyway I discovered that I can rotate back my vd resetting resolution of screen on the fly. If my device is 1200x800 (landscape) and it is rotated left by an app I can get it vertical by shell comamnd: (adb shell) wm size 800x1200

alrama
  • 618
  • 11
  • 17
  • 1
    Thanks! Especially easy with android x86 because a root shell is accessible with alt+f1 – STM Jan 04 '18 at 18:48
  • 1
    from menu (Virtual machine manager) i select send alt-f1, and i get terminal, how do i get back to gui ? ok for me it ended up being alt-f7 – Pieter Aug 03 '19 at 09:35
  • Good to know, I tested with Android x86 version 7 on VirtualBox, however apps like TikTok are still crashing. I tried the resolution 600x1040 which partially worked with TikTok on Anbox (Android version 7 also). – baptx Jan 02 '21 at 15:28
9

I found that Rotation Locker (com.devasque.rotationlocker) solved the problem for me. Via this mailing list post.

opello
  • 3,254
  • 2
  • 23
  • 23
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – rcs Aug 21 '15 at 00:04
  • @rcs Good point. I wish I'd been mentioned in your reply so I could have edited the answer before it was deleted. The likelihood of the application display name changing seems substantially higher than the Google Play URL being invalidated. I feel like my updated answer mitigates either risk at this point. – opello Sep 23 '15 at 04:19
  • 1
    Simple alternative is to install App Rotator or Smart Auto-Rotate from the appstore and it is free. From the app then we can set any other app to be portrait, landscape, or auto. I post this because it is very useful based on my experience. Thanks, Source: http://linux.about.com/od/howtos/tp/5-Essential-Tips-And-Tricks-For-Using-Android-Within-VirtualBox.htm – Santosa Sandy Jul 01 '16 at 13:55