Android Vhdx

3 views
Skip to first unread message

Kum Verna

unread,
Aug 5, 2024, 12:58:29 AM8/5/24
to clofefesfrees
Thefollowing are instructions on how to run Android-x86 inside VirtualBox.

Note: For optimal performance, make sure you have enabled either VT-x or AMD-V in your host operating system's BIOS.



Android-x86 versions tested against Virtualbox versions. Date Tested Virtualbox Host OS Android-x86 Result ??2.2.4Windows XP??Good ??3.0.2Fedora 11??Good Nov. 2 20175.2.0Windows 106.0-r3 32/64 bitGood


Download an ISO of Android-x86 from here. Caution If you are using Android-x86 for debugging purposes, some binaries (gdb for example) are built for 32-bit architectures and will not support debugging 64-bit binaries such as the Android app host. Download a 32-bit distribution instead.


If you have not already created a VirtualBox virtual machine for Android-x86 yet, do so as follows: Click the "New" button, and name your new virtual machine however you like. Set Type to Linux, and Version to Linux 2.6 / 3.x / 4.x. Note that you should choose the appropriate bit type for the version of Android-x86 that you downloaded. Specify how much RAM will be allocated to your virtual machine when you run it. Android doesn't specify a bare-minimum requirement for memory, just keep in mind what apps you plan on running. 2GB (2048MB) is a good place to start, and you can change this later if you need to. Create a new Hard disk image which will act as your machine's storage. The recommended starting size of 8GB is enough. Click through the rest of the options for creating your Hard disk. Your virtual machine has now been created. It still needs to be initially installed at this point.


Tested on VirtualBox 64-bit for Windows, version 5.2.0. Android-x86 version 6.0-r3, both 32-bit and 64-bit.



Select your machine, then click the Settings button and refer to the below recommended configuration to make sure your settings match. [System] Recommended: Processor(s) should be set above 1 if you have more than one virtual processor in your host system. Failure to do so means every single app (like Google Chrome) might crush if you try to use it. [Display]: Optional: Video Memory may be increased beyond the minimum selected automatically. The affects of this are unknown.Mandatory: Unless guest additions are installed[1], change the default VMSVGA to VBoxVGA. Optional: Enable 3D Acceleration may be checked. The Linux Guest Additions must (VirtualBox v6.1+) / may (VirtualBox v6.0 and below) need to be installed[2][1] to get any benefit from this.Failure to do so means you won't even be able to launch Android-X86 in the first place.[3] [Storage] Find the first "Empty" item (this should have an icon of a CD). In the Attributes, click on the CD icon with a small down arrow, and pick "Choose Optical Virtual Disk File...". Specify the Android-x86 ISO that you downloaded. [Audio] Intel HD Audio seems to be natively supported in Android-x86. [Network] By default, your installation of Android-x86 will be able to automatically connect to the internet. If not, you can try to enable WiFi in Settings/Network & Internet, and connect to showing VirtWifi. If you do not want to connect to the internet in VirtualBox, uncheck Enable Network Adapter under the Adapter 1 tab.


When you are prompted to Choose a partition: If you upgrade Android-x86 from a previous version, just select the existing partition. Agree to overwrite it when prompted.If this is a new VM, choose to Create/Modify partitions. Use Bootable but not GPT! This will cause the GRUB installation to fail later. You may partition your disk however you see fit. If you just want a simple installation, create one partition taking up the entire disk and format it as ext4.


Continue through the installation. You should install GRUB when it prompts you to. You may also leave /system as read and write when prompted.

Once the installation is complete, force close/shut down the virtual machine and remove the ISO from the virtual CD drive.

Finaly, start Android-x86. If it's a new machine, once loaded you can perform the Android setup to begin using your machine.


This section describes two ways to upload music files into Android running on a vbox so you can play them by the Music app. Of course, you can save the files to the virtual disk mounted at /sdcard, as described above.


Adb is Android Debug Bridge, a tool to debug Android system. If you compile from source, it is located in out/host/linux-x86/bin/adb. Otherwise you can get it from Android SDK. Suppose the network of your vbox is OK, you can upload a file from your host by ADBHOST= out/host/linux-x86/bin/adb push /sdcard You need to know the ip of your vbox. You can get it by Alt-F1 and netcfg. You may also need to reboot Android to see the uploaded files. Of course in this way you have to mount /sdcard to a virtual disk partion.



For complex network settings of the VirtualBox VM, you should refer to Debug How To on how to connect adb to the VM.


If we want to debug with adb via network, we should ensure the ip of vbox can be accessed by host machine. So we should change the Network Adapter type of vbox to Bridged Adapter. After starting the android-x86, we should follow the above Settings/[Network] section to ensure the network of android-x86 is enabled, and enable USB debugging in Settings/System/Developer Options. Then we can get the device ip from Settings/System/About tablet/IP address. For example, if we see the ip address is 192.168.0.116, then we can use following command to connect android-x86 in vbox from host machine. adb connect 192.168.0.116 Then you can use adb command to debug android-x86 such as get log, and dump system information.


I'm trying to figure out how to mount a virtual drive into my android file system. By this I mean that I want to make a new folder (that doesn't really exist) appear somewhere in my Android file system tree and have all requests to view the contents of, read data from or write data to that folder (or any of it's supposed children), from all other apps, handled by my custom app.


I assume that to do this I will somehow have to override whatever part of Android handles requests to access files for reading and writing (e.g. FileInputStream and FileOutputStream), test whether the requested file is part of this virtual file tree, and if it is, handle the request, or else, pass it to the default handler.


I doubt you can go so deep in unrooted phone. It's kind-a possible with modified kernel: -developers.com/showthread.php?t=1306336 . Unless you want to put changes into AOSP and compile it yourself, in which case I can't help you : ( .


However, for some unknown reasons, the progress is stuck at a certain value, so I close the terminal window. But then i found that i cannot open the subsystem anymore. I tried to open some apps and the Amazon app store. Each time the subsystem was launched, the launching window would last for a time, and then it closed itself and opened an identical one. This thing repeated about three or four times and finally stopped.


When i open the task manager to monitor the whole progress, i find that each time when the window was closed, the progress vemmemWSA would reboot. And when the window was closed for the last time, it ended.


I thought there was something wrong with the vdisk, because when i tried to used the Repair function, it didn't fix it. I copyed the userdata.2.vhdx and Reset wsa. it worked.but when i used the old vdisk file to covered the new one, the same problem appeared again.


However, (though the "Compress contents to save disk space" and "Encrypt contents to secure data" checkboxes are unselected), it cannot work and an error was reported:"The requested operation could not be completed due to a virtual disk system limitation. Virtual hard disk files must be uncompressed and unencrypted and must not be sparse."


Based on your description, it seems that the virtual disk ("userdata.2.vhdx") of the Windows Subsystem for Android is damaged, which caused WSA startup failure. You mentioned that you tried to use the Repair function, but it didn't fix the issue. You can try the following steps to repair the damaged virtual disk:


With Visual Studio, you can easily test and debug your .NET MAUI app for Android in emulators for situations where an Android device isn't available. However, if hardware acceleration isn't available or enabled, the emulator will run very slowly. You can significantly improve the performance of the emulator by enabling hardware acceleration and by using virtual device images that are appropriate for your processor architecture. For more information, see Configure hardware acceleration for the Android Emulator on developer.android.com.


The emulator provides versatile networking capabilities that can be used for different purposes, including connecting to an emulator running on a Mac from inside a Windows virtual machine (VM). For more information, see Connect to an Android emulator on a Mac from inside a Windows virtual machine.


The Intel Hardware Accelerated Execution Manager (HAXM) is deprecated from emulator 33.x.x.x, and has been replaced by AEHD on Intel processors. For information about using HAXM on emulator 32.x.x.x and lower, see Configure VM acceleration using Intel HAXM on Windows on developer.android.com.


For the best experience on Windows, it's recommended you use WHPX to accelerate the Android emulator. If WHPX isn't available on your computer, then AEHD can be used. The Android emulator automatically uses hardware acceleration if the following criteria are met:


Make sure that the virtual device you created in the Android Device Manager is an x86-64 or x86-based system image. If you use an Arm-based system image, the virtual device won't be accelerated and will run slowly.


If your computer doesn't support Hyper-V, you should use AEHD to accelerate the Android emulator. Before you can install and use AEHD, read the following section to verify that your computer supports AEHD.

3a8082e126
Reply all
Reply to author
Forward
0 new messages