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

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值