当前位置: 首页 > 工具软件 > VMLite > 使用案例 >

vmlite-android 屏幕旋转90,How to change the screen size of vmlite android?

濮阳繁
2023-12-01

问题

I installed vmlite's android image which is great but there is one thing I don't find solution: How to change the screen size?

It has a fix ratio of the width/height of the screen, but I need to change it to simulate some android phones.

I searched a lot but not find a solution, please help.

UPDATE

The grub menu is as following:

cmdline (hd0,2)/cmdline

kernel --use-cmd-line (hd0,2)/kernel

initrd (hd0,2)/ramdisk

I haved add a custom size using this command:

VBoxManage.exe setextradata "android-vmlite" "CustomVideoMode1" "480x800x32"

Then add vga-ask to all of the 3 menu options, but none works.

When press b on them, it doesn't ask to choose model.

回答1:

Ok, I've done some research and finally was able to edit the virtual box image. Here's how:

If you go to vmlite image's grub entries on boot , the kernel entry (one with "kernel" keyword) has an argument --use-cmd-line , this cmdline is defined in the first entry cmdline (hd0,2)/cmdline, which is a file called cmdline placed inside boot hard disk's third partition.

This file has the kernel options:

init=/init qemu=1 console=ttyS0 console=tty0 vga=788 verbose androidboot.hardware=vbox_x86 androidboot.console=ttyS0 android.qemud=ttyS1

Now you must edit this file called cmdline to change vga=788 option to vga=ask.

Editing: (on a Linux machine)

You need to install vdfuse.

sudo apt-get install virtualbox-fuse

create two empty folders somewhere.

sudo mkdir /mnt/image

sudo mkdir /mnt/partition

Then mount the virtual box image (vdi, vmdk or vhd etc) to a folder. (Lets say virtualbox disk image file is /tmp/vmlite.vmdk and we'll mount it to /mnt/image folder)

vdfuse -w -f /tmp/vmlite.vmdk /mnt/image

Some files will be created in mount folder named EntireDisk, Partition1 , Partition2, Partition3 and so on.

since we are interested in third partition, we will mount the corresponding file to /mnt/partition:

sudo mount -o loop /mnt/image/Partition3 /mnt/partition

See the contents:

sudo ls -l /mnt/partition

There'd be cmdline, ramdisk and kernel.

Now we edit the cmdline file (we'll use gedit text editor, you can use one you like):

sudo gedit /mnt/partiton/cmdline

make the edits, change vga=788 to vga=ask, save and close. Verify new file contents:

sudo cat /mnt/partition/cmdline

Unmount files and images:

sudo umount /mnt/partition

sudo umount /mnt/image

and if we don't need those two folders:

sudo rm /mnt/image

sudo rm /mnt/partition

Done, boot image from virtual box. It'll say press ENTER to view available video modes, On Enter a list is shown, type the digit of choice, or type "scan" to search for more display modes.

NOTE: Not all modes worked ,use VESA modes with color depth 24 or 32 and supported aspect ratios.

回答2:

please refer to this thread:

http://forum.xda-developers.com/showthread.php?p=19785371

You can change this file, cmdline, inside (hd0,2)

init=/init qemu=1 console=ttyS0 console=tty0 vga=788 verbose androidboot.hardware=vbox_x86 androidboot.console=ttyS0 android.qemud=ttyS1

==>

init=/init qemu=1 console=ttyS0 console=tty0 vga=ask verbose androidboot.hardware=vbox_x86 androidboot.console=ttyS0 android.qemud=ttyS1

Thank wingman for his detailed instructions.

Another option is to attach the vmdk file to a running linux vm (if you have one), the disk would auto mount to make life simpler.

来源:https://stackoverflow.com/questions/12493599/how-to-change-the-screen-size-of-vmlite-android

 类似资料: