🖥️Run on Google Cloud Platform (GCP) using QEMU

Intro

This guide provides an alternative for running CoinGet/CoinSend on Google Cloud Platform (GCP) using QEMU. It needs a two-level nested virtual machine (VM) environment and install the Android operating system in the L2 VM to run CoinGet/CoinSend. Ultimately, you will still be able to connect directly to the Android operating system via any VNC viewer. Source: https://cloud.google.com/compute/docs/instances/nested-virtualization/creating-nested-vms

As this approach involves the use of open-source software, certain risks may still exist. Therefore, please use it with caution and always download software from reliable sources.

A. Setting up VM instance

  1. Run the following command in Google Cloud CLI to create an instance with the following minimum specification. You may adjust higher. We are using n1-standard-4 instance in this tutorial with the following specifications.

    • Ubuntu 20.04 or above

    • 2 GHz dual-core processor or above

    • Min 4GB memory or above (8GB recommended)

    • Min 128GB storage space

gcloud compute instances create <your-server-name-here> --enable-nested-virtualization --min-cpu-platform="Intel Haswell" --image-family=ubuntu-2204-lts --image-project=<your-custom-project-name-here> --machine-type=n1-standard-4 --boot-disk-size=128
  1. Log into your newly created instance and install QEMU by running the following command.

sudo apt update && sudo apt upgrade -y
sudo apt install -y qemu qemu-kvm
sudo adduser `id -un` kvm
sudo reboot
  1. Download Android x86 iso file.

You can always find the latest version of the Android x86 ISO image in the official website: https://www.android-x86.org/download. However, please be aware that there may be risks, such as the ISO or download link being compromised. Always verify the authenticity of both the download link and the ISO image, and avoid downloading from unknown or untrusted sources. Alternatively, you may compile your own ISO image for added security.

wget https://sourceforge.net/projects/android-x86/files/Release%209.0/android-x86_64-9.0-r2.iso/download -O android-x86_64-9.0-r2.iso
  1. Create an virtual drive. You may replace androidx86 with a custom name and remember to amend your shell script accordingly in step 5 ( -drive file=<your-custom-name>.img,if=virtio \ ). You may also set the disk space higher as long as it is lower than your instance's disk space (as defined in step 1).

qemu-img create -f qcow2 androidx86.img 80G
  1. Execute the following script to provision QEMU virtual machine. Alternatively, you may also run this script by saving it to a shell script file and execute it, or use the command virt-install in virt-manager to do so. Virtual Machine Manager: https://virt-manager.org/

qemu-system-x86_64 \
-enable-kvm \
-M q35 \
-m 10240 \
-smp 4 \
-cpu host \
-device virtio-tablet-pci -device virtio-keyboard-pci \
-monitor stdio \
-boot menu\=on \
-net nic \
-net user \
-display vnc=:0,password=on \
-drive file=androidx86.img,if=virtio \
-cdrom android-x86_64-9.0-r2.iso

B. Setting up QEMU and Android operating system

  1. Connect to QEMU via any VNC Viewer on Desktop or Mobile Phone, such as TigerVNC, TightVNC and etc. We are using RealVNC in our example below and you may download from here RealVNC: https://www.realvnc.com/en/connect/download/

For MacOS users, you may use the built-in VNC feature by right click on Finder > Conenct to Server.

From this step onward, please ensure you see the correct screen as per shown and follow the instructions.

  1. Select Installation - Install Android-x86 to hard disk and press Enter.

In case you see the screen below instead of the screen above, please terminate QEMU emulator in your VM instance and restart from step A.5.

  1. Select OK

  2. Select Yes

  3. Press any key to continue

  4. Select New.

  5. Leave blank and press Enter.

  6. Leave blank and press Enter.

  7. Insert Yes and press Enter.

  8. Select OK.

  9. Select ext4 then OK

  10. Select Yes

  11. Select Yes

  12. Select Yes

  13. Select No

  14. Select Run Android-x86 then OK

  15. Android system should be able to boot up and run in QEMU emulator now, and click START

  16. Click See all WiFi networks and select VirtWifi

  17. Follow the steps as per instructed in Android system to complete the setup, until you see the following screen, select Quickstep for better experience, or you may choose Taskbar if you prefer.

  18. The Android operating system is now ready to use. Please note that the UI color might look different, however it will not affect the overall operation.

You may turn on Screen Lock for added security.

C. Optimising the App

We recommend you to lower down the system resolution so it will consume less computing resources and run faster, also for better UIUX experience.

  1. Pull up the app menu and open Terminal Emulator as circled.

  2. Insert the following command. Please note that copy paste is not available in Terminal Emulator.

su

You will see the following prompt after inserting su. Select Remember choice for 10 minutes here.

mkdir /mnt/tmp
mount -t ext4 /dev/block/vda1 /mnt/tmp
vi /mnt/tmp/grub/menu.lst
  1. Press i to enter Insert Mode, and look for the underlined line and add video=360x640 within line as circled below.

  2. Press Esc to quit Insert Mode, then insert :wq and press Enter to save.

  3. Use command reboot to restart Android system.

reboot
  1. You should now see your Android in 360x640 portrait mode, and you may proceed to download CoinGet/CoinSend from Play Store and complete the setup as usual.

  2. Upon installing CoinSend/ CoinGet, please ensure the app's Storage permission is turned on.

Last updated