Difference between revisions of "Automated Android OS deployment with openQRM IaaS Cloud"

From openQRM
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
[[Category:Deployment]]
 
[[Category:Deployment]]
 
[[Category:IaaS]]
 
[[Category:IaaS]]
 +
[[Category:Cloud]]
 +
This How-to is about how to provide Android system "on demand" with a private openQRM Cloud.
 +
 +
'''Requirements'''
 +
 +
# One physical Server - at least 1 GB of Memory
 +
# At least 100 GB of Diskspace
 +
# VT (Virtualization Technology) enabled in the Systems BIOS so that the openQRM Server can run Virtual Machines later
 +
'''NOTE''' The Android OS support in openQRM is only available in the openQRM Enterprise Edition >= 5.1.4!
 +
 +
=== 1. Install openQRM ===
 +
For this How-To, we assume you have successfully [[Install openQRM on Debian|installed openQRM]] and have at least referenced our [[Cloud Computing with openQRM|Cloud Computing with openQRM on Debian How-To]] before. If not, it is highly suggested to complete both before continuing
 +
 +
'''NOTE'''
 +
 +
For this How-To we have used an additional physical System as a KVM Virtualization host, simply integrated in openQRM via the "local-server" plugin. The setup is also possible If you have just one system and use the openQRM server itself as the KVM Host.
 +
 +
=== 2. Downloading Android ===
 +
Here is the fully installed openQRM server
 +
[[File:Csm 000 android a62bccaa33.png|none|thumb|390x390px|Fully installed openQRM server]]
 +
As install preparation, please login to your KVM Host as "root" and execute the following commands to download the ''android-x86-4.4-RC2.iso'' installation iso file for the Android installation in a VM.
 +
mkdir /iso
 +
 +
cd /iso
 +
 +
wget -O android-x86-4.4-RC2.iso sourceforge.net/projects/android-x86/files/Release%204.4/android-x86-4.4-RC2.iso/download
 +
 +
=== 3. Installing Android ===
 +
We now start by creating a new server for the Android OS installation. The image of this server is later used as a "master-image" for the openQRM Cloud. Please go to:
 +
 +
'''''Datacenter -> Server -> Add new server'''''.
 +
 +
Provide a name (here "android44") and a description.
 +
[[File:Csm 001 andriod ea04584e2a.png|none|thumb|390x390px|Add new server]]
 +
In the second server wizard step please select "New resource"
 +
[[File:Csm 002 android ec2378af32.png|none|thumb|390x390px|Select 'New Resource']]
 +
Select the type of Virtual Machine you would like to create. Here we choose "KVM VM (localboot).
 +
[[File:Csm 003 android b0545f281f.png|none|thumb|390x390px|Type of Virtual Machine]]
 +
Now select your KVM Host. In the VM overview please click on "Add local VM".
 +
[[File:Csm 004 android 4a9b048c82.png|none|thumb|390x390px|VM Overview]]
 +
In the create VM form please select at least 2 GB memory. Also make sure you set the "Disk interface" for the virtual disk image to "IDE" (virtio support in Android is still experimental).
 +
[[File:Csm 005 android 4a6c66c304.png|none|thumb|390x390px|Create VM form]]
 +
You can leave the "Network card type" to "virtio". This will work fine even without the virtio support in the Android OS.
 +
 +
Further down in the VM create form select to boot from an ISO image and use the file-picker to pick the ISO file to boot from on the KVM Host. Also provide a VNC password and adjust the vnc-keymapping to your needs. Then click on "submit".
 +
[[File:Csm 006 android 7ba27d1d16.png|none|thumb|390x390px|Boot from ISO Image]]
 +
The next step will continue with the server wizard. Simply select the newly created VM resource.
 +
[[File:Csm 007 android 8c0989ccae.png|none|thumb|390x390px|Server Wizard]]
 +
When configuring the image for the server please click on "new image".
 +
[[File:Csm 008 android daea66a2e3.png|none|thumb|390x390px|Click 'New Image']]
 +
In the image type selection choose "LVM deployment for KVM".
 +
[[File:Csm 009 android 79d1c1a9d7.png|none|thumb|390x390px|Image type selection]]
 +
Now please select the KVM storage from the type "KVM LVM Storage".
 +
[[File:Csm 010 android 867a5cb6e2.png|none|thumb|390x390px|KVM LVM Storage]]
 +
This presents an overview about all the existing LVM volume groups on this storage. Please select one volume group to create the new image on. Here we choose the "lvols" LVM volume group.
 +
 +
If you haven't setup LVM on your KVM storage Host yet click on "add volume group" which will open up the device-manger plugin to setup and manage the attached storage devices with LVM.
 +
[[File:Csm 011 android c7a256fb1b.png|none|thumb|390x390px|Device-manager plugin]]
 +
In the LVM volume overview please click on "add new logical volume".
 +
[[File:Csm 012 android df0cd85dfa.png|none|thumb|390x390px|LVM volume overview]]
 +
In the "create volume" form please provide the volume size (in MB). Here we go with 2000 MB which is sufficient to install the Android OS.
 +
 +
The volume size is fully adjustable and provides an automated LVM-resize and filesystem resize for the first partition of the volume. This functionality is also available for "snap" and "clone" actions. Please notice that due to the technical implementation of LVM, snapshots can only be resized smaller or equal to the "master volume" while the LVM clone action allows resizing to a bigger size than the "master".
 +
 +
For Cloud deployment the preferred deployment action (snap or clone) can be configured in the KVM plugins configuration options in the plugin manager.
 +
[[File:Csm 013 android f32c4aad95.png|none|thumb|390x390px|Create Volume form]]
 +
Creating the new volume and its image object in openQRM continues with the server wizard. Please click on submit on the pre-selected just created image.
 +
[[File:Csm 014 android 79d7c35a6e.png|none|thumb|390x390px|Click Submit]]
 +
In the "image edit" section you can set a custom password for the image console- and ssh login. Please notice that for Windows OS installation on an image the image type should be set to "windows" instead of "linux".
 +
[[File:Csm 015 android f77e7faa8f.png|none|thumb|390x390px|Set custom password]]
 +
The previous action finalizes the server wizard and forwards to the server list. Click on the "start" button of the new created server.
 +
 +
Just for info:
 +
 +
 +
Starting a server will "combine" the "resource" with the "image" configured in the "server". Stopping a "server" will automatically "separate" the "image" from the "resource". That way each of the objects in openQRM become completely independent from each other and e.g. can be re-combined with different or updated sub-objects. Also this makes it very straight forward to e.g. restart an "image" with a different "resource" (even with a different resource type in case of P2V/V2P) in case of a automatic high-availability fail-over event.
 +
[[File:Csm 016 android 7f57edb516.png|none|thumb|390x390px|Server overview]]
 +
Please confirm starting the server.
 +
[[File:Csm 017 android ef5c453be9.png|none|thumb|390x390px|Start Server]]
 +
When the server is started please click on the "NoVNC" in the server action tab. This will open up a VNC console in the web-browser and allows to install the Android OS.
 +
[[File:Csm 018 android 232aa58d6b.png|none|thumb|390x390px|Click 'NoVNC']]
 +
Here's the VNC console of the VM. In the Grub menu of the starting VM booting from the Android installation iso please select the last option "Installation - install Androidx86 to hard disk" and press return.
 +
[[File:Csm 019 android 5e18532130.png|none|thumb|390x390px|Grub Menu]]
 +
When the installer starts please select "create/modify partitions"
 +
[[File:Csm 020 android d7e78f072d.png|none|thumb|390x390px|Create/Modify Partitions]]
 +
Select "new" to create a new partition.
 +
[[File:Csm 021 android bf76c9cff0.png|none|thumb|390x390px|Create New partition]]
 +
Select "primary".
 +
[[File:Csm 022 android 8815eb39b3.png|none|thumb|390x390px|Select Primary]]
 +
Make sure to set the "bootable" flag.
 +
[[File:Csm 023 android 049f6241f1.png|none|thumb|390x390px|Bootable flag]]
 +
Now select "write" and confirm to setup the partition.
 +
[[File:Csm 024 android 9cb10d317a.png|none|thumb|390x390px|Confirm partition setup]]
 +
Back in the Android installer select the just created new partition sda1.
 +
[[File:Csm 025 android 0ff39567c0.png|none|thumb|390x390px|Select new partition]]
 +
Please select "ext3" as the filesystem type for this partition.
 +
[[File:Csm 026 android 054f3e134c.png|none|thumb|390x390px|Select 'ext3']]
 +
Confirm with "Yes" to create the filesystem.
 +
[[File:Csm 027 android 4266fa6fa6.png|none|thumb|390x390px|Create filesystem]]
 +
Also select "Yes" when the installer asks if to install the grub boot-manager.
 +
[[File:Csm 028 android d6543a747f.png|none|thumb|390x390px|Install grub boot-manager]]
 +
In the following dialog also select "Yes" for making the system partition of the Android OS read+writeable. This is useful (and needed) to adjust the Android image later.
 +
[[File:Csm 029 android 72b1f886db.png|none|thumb|390x390px|Select Yes]]
 +
 +
=== 4. After Android Installation ===
 +
When the Android installation is finished please select "reboot".
 +
[[File:Csm 031 android 0244316552.png|none|thumb|390x390px]]
 +
Please remember that the VM configuration is still set to boot from the installation iso!
 +
 +
Therefore it is now recommended to stop the automated boot of the Android installation iso since this will boot into a live-system from the iso but not from the disk.
 +
 +
We are going to update the VM configuration to boot from local disk in the next step.
 +
[[File:Csm 032 android f2604510f6.png|none|thumb|390x390px|Update VM configuration]]
 +
In the server list please stop the server.
 +
[[File:Csm 033 android d023458181.png|none|thumb|390x390px|Stop the Server]]
 +
Confirm stopping the server.
 +
[[File:Csm 034 android 83e9d7f585.png|none|thumb|390x390px|Confirm stopping the server]]
 +
Now please go to
 +
 +
'''''Plugins -> Virtualization -> KVM -> VMs'''''
 +
 +
select the KVM Host and click on "edit"
 +
[[File:Csm 035 android 20e37f618d.png|none|thumb|390x390px|Select KVM host]]
 +
In the VM overview please click on "update" of the server's VM.
 +
[[File:Csm 036 android 3193f7837d.png|none|thumb|390x390px|Update Server VM]]
 +
Now set the boot sequence to boot from "local" and click on submit. After that please go back to the server list and start the server. When the server is started click again on the "NoVNC" action button of the server.
 +
[[File:Csm 037 android 7f5fa3cf74.png|none|thumb|390x390px|Set boot sequence to boot from Local]]
 +
Here is the first boot screen of the Android OS running in the KVM VM.
 +
[[File:Csm 038 android e21781a3c1.png|none|thumb|390x390px|First Boot screen]]
 +
In the Wi-Fi selection please click on "skip".
 +
[[File:Csm 040 android 31added84a.png|none|thumb|390x390px|Click 'Skip']]
 +
In the "Got Google" dialog please click on "No" and "remind me later".
 +
[[File:Csm 041 android fcb155a238.png|none|thumb|390x390px|Select 'No']]
 +
In the next "Google location" dialog use the right arrow to go on.
 +
[[File:Csm 042 android 3bf6ffb040.png|none|thumb|390x390px|Click the right arrow]]
 +
Set date and time.
 +
[[File:Csm 043 android 211260326d.png|none|thumb|390x390px|Set date and time]]
 +
And create a user.
 +
[[File:Csm 044 android 577331d52f.png|none|thumb|390x390px|Create a user]]
 +
The Android OS will now further boot up.
 +
[[File:Csm 045 android 0c4929d4cb.png|none|thumb|390x390px|Android OS booting]]
 +
Here is the Android start-up screen. Go to the application by the middle button in the Android UI.
 +
[[File:Csm 046 android 32c6b28fc7.png|none|thumb|390x390px|Android Start-up screen]]
 +
Click on the "terminal emulator" app icon to start a terminal session.
 +
 +
In the terminal you can use "su" to get root access.
 +
 +
Please follow the next steps to configure SSH access and install the "openQRM client for Android" in the image.
 +
[[File:Csm 047 android 107336afe8.png|none|thumb|390x390px|Click on the "terminal emulator" app]]
 +
 +
=== 5. Enable sshd ===
 +
To get access the the Android OS filesystem use "kpartx" to mount the first partition of the logical volume. This should be only done when the image is not in use by an active VM, so the first thing is to stop the server.
 +
 +
Please go to the server list and stop the "android44" server.
 +
 +
Then please run on your KVM host in a root terminal:
 +
kpartx -av /dev/lvols/android44
 +
 +
mount /dev/mapper/lvols-android44p1 /mnt/
 +
 +
ssh-keygen -b 2048 -C android44 -t rsa -f ssh_host_rsa_key
 +
(when it asks for a passphrase just press return)
 +
ssh-keygen -b 1024 -C android44 -t dsa -f ssh_host_dsa_key
 +
(when it asks for a passphrase just press return)
 +
 +
Now copy all generated file to /mnt/android-4.4-RC2/data/ssh/
 +
cp ssh_host* /mnt/android-4.4-RC2/data/ssh/
 +
Also download the "sshd_config" file for the Android OS from the Android plugin's usage page and copy it to /mnt/android-4.4-RC2/data/ssh/
 +
cp sshd_config /mnt/android-4.4-RC2/data/ssh/
 +
Finally add your personal public key to /mnt/android-4.4-RC2/data/.authorized_keys
 +
cat /root/.ssh/id_rsa.pub > /mnt/android-4.4-RC2/data/.authorized_keys
 +
The sshd service on the Android OS will be automatically started by the openQRM Client for Android which is explained as the next step.
 +
 +
=== 6. Install the openQRM Client for Android OS ===
 +
Download the openQRM Client for Android OS from the Android plugin's usage page.
 +
 +
Copy it to /mnt/android-4.4-RC2/data/openqrm-client-android.sh
 +
cp openqrm-client-android.sh /mnt/android-4.4-RC2/data/
 +
To automatically start the openQRM Client for Android follow the steps below:
 +
 +
1) Create a directory /mnt/android-4.4-RC2/system/vendor/etc
 +
mkdir -p /mnt/android-4.4-RC2/system/vendor/etc
 +
2) Create a file "init.sh" in this directory with the following command:
 +
echo "sh -x /data/openqrm-client-android.sh" > /mnt/android-4.4-RC2/system/vendor/etc/init.sh
 +
Now please umount the Android filesystem and release kpartx with the following commands:
 +
umount /mnt
 +
 +
kpartx -dv /dev/lvols/android44
 +
Now please start the server again.
 +
 +
After the above configuration we can now passwordless login to the Android system by ssh.
 +
[[File:Csm 048 android 27d6e91163.png|none|thumb|390x390px|Passwordless login]]
 +
The Android "master image" for Cloud deployment is now configured and ready to use. Please go the the server list again and stop the server.
 +
 +
Then go to
 +
 +
'''''Plugins -> Cloud -> Configuration -> Private Images'''''
 +
[[File:Csm 049 android 2e0892c45f.png|none|thumb|390x390px|Private image manager]]
 +
And set the Android "master image" to be used by "Everybody".
 +
[[File:Csm 050 android 57726c8421.png|none|thumb|390x390px|Android master image]]
 +
Go to the openQRM Cloud login page
 +
 +
'''''Plugins -> Cloud -> Portal'''''
 +
 +
and login to the Cloud.
 +
 +
Please notice that enabling the Cloud automatically creates an "admin" project with the "openqrm" user and the same password as set for the openQRM administration UI.
 +
[[File:Csm 051 android 4ddfa6e7a5.png|none|thumb|390x390px|openQRM administration UI]]
 +
In the Cloud user dashboard please click on "new instance".
 +
[[File:Csm 052 android a4f9732f2b.png|none|thumb|390x390px|New Instance]]
 +
In the "instance create" form please select the "android44" image and adjust cpu, disk, memory and network according to your needs.
 +
[[File:Csm 053 android 268a41f825.png|none|thumb|390x390px|Adjust resources]]
 +
The instance is now going to start. While starting it goes through the following phases:
 +
 +
* approve
 +
* create
 +
* start
 +
* active
 +
[[File:Csm 054 android ec298cd5ad.png|none|thumb|390x390px|Instance starting]]
 +
Here is the permission and limits overview while the instance is still starting.
 +
[[File:Csm 055 android 74f5b697eb.png|none|thumb|390x390px|Permission and limits overview]]
 +
Here is the permissions and limits overview when the instance is fully up and running.
 +
[[File:Csm 056 android 05f302f106.png|none|thumb|390x390px|Instance is fully up and running]]
 +
In the Instance overview in the Cloud portal please click on "NoVNC" to gain console access to the Android OS.
 +
[[File:Csm 057 android 90262545b6.png|none|thumb|390x390px|Click on "NoVNC"]]
 +
Here again the Android UI after fully started up in the openQRM Cloud, requested and cloned from the "master image" on demand.
 +
[[File:Csm 058 android 95d6fb2e98.png|none|thumb|390x390px|Android UI after fully started up]]
 +
Please open up the "terminal emulator" app again.
 +
[[File:Csm 059 android 263a9d4e9b.png|none|thumb|390x390px|Open Terminal Emulator]]
 +
 +
In the terminal run
 +
su
 +
to get root access
 +
[[File:Csm 060 android e1b15c6555.png|none|thumb|390x390px|Click 'Allow']]
 +
Here is the network configuration of the Android OS started in the openQRM Cloud. Please notice the correctly configured external IP address to be accessible by the Cloud users "remotely".
 +
[[File:Csm 061 android 9502725d80.png|none|thumb|390x390px|Network configuration of the Android OS]]
 +
 +
'''Congratulations!!'''
 +
 +
You have successfully completed this How-To!
 +
 +
'''NOTE AGAIN'''
 +
 +
The Android OS support in openQRM is only available in the openQRM Enterprise Edition >= 5.1.4!

Latest revision as of 11:47, 3 November 2020

This How-to is about how to provide Android system "on demand" with a private openQRM Cloud.

Requirements

  1. One physical Server - at least 1 GB of Memory
  2. At least 100 GB of Diskspace
  3. VT (Virtualization Technology) enabled in the Systems BIOS so that the openQRM Server can run Virtual Machines later

NOTE The Android OS support in openQRM is only available in the openQRM Enterprise Edition >= 5.1.4!

1. Install openQRM

For this How-To, we assume you have successfully installed openQRM and have at least referenced our Cloud Computing with openQRM on Debian How-To before. If not, it is highly suggested to complete both before continuing

NOTE

For this How-To we have used an additional physical System as a KVM Virtualization host, simply integrated in openQRM via the "local-server" plugin. The setup is also possible If you have just one system and use the openQRM server itself as the KVM Host.

2. Downloading Android

Here is the fully installed openQRM server

Fully installed openQRM server

As install preparation, please login to your KVM Host as "root" and execute the following commands to download the android-x86-4.4-RC2.iso installation iso file for the Android installation in a VM.

mkdir /iso
cd /iso
wget -O android-x86-4.4-RC2.iso sourceforge.net/projects/android-x86/files/Release%204.4/android-x86-4.4-RC2.iso/download

3. Installing Android

We now start by creating a new server for the Android OS installation. The image of this server is later used as a "master-image" for the openQRM Cloud. Please go to:

Datacenter -> Server -> Add new server.

Provide a name (here "android44") and a description.

Add new server

In the second server wizard step please select "New resource"

Select 'New Resource'

Select the type of Virtual Machine you would like to create. Here we choose "KVM VM (localboot).

Type of Virtual Machine

Now select your KVM Host. In the VM overview please click on "Add local VM".

VM Overview

In the create VM form please select at least 2 GB memory. Also make sure you set the "Disk interface" for the virtual disk image to "IDE" (virtio support in Android is still experimental).

Create VM form

You can leave the "Network card type" to "virtio". This will work fine even without the virtio support in the Android OS.

Further down in the VM create form select to boot from an ISO image and use the file-picker to pick the ISO file to boot from on the KVM Host. Also provide a VNC password and adjust the vnc-keymapping to your needs. Then click on "submit".

Boot from ISO Image

The next step will continue with the server wizard. Simply select the newly created VM resource.

Server Wizard

When configuring the image for the server please click on "new image".

Click 'New Image'

In the image type selection choose "LVM deployment for KVM".

Image type selection

Now please select the KVM storage from the type "KVM LVM Storage".

KVM LVM Storage

This presents an overview about all the existing LVM volume groups on this storage. Please select one volume group to create the new image on. Here we choose the "lvols" LVM volume group.

If you haven't setup LVM on your KVM storage Host yet click on "add volume group" which will open up the device-manger plugin to setup and manage the attached storage devices with LVM.

Device-manager plugin

In the LVM volume overview please click on "add new logical volume".

LVM volume overview

In the "create volume" form please provide the volume size (in MB). Here we go with 2000 MB which is sufficient to install the Android OS.

The volume size is fully adjustable and provides an automated LVM-resize and filesystem resize for the first partition of the volume. This functionality is also available for "snap" and "clone" actions. Please notice that due to the technical implementation of LVM, snapshots can only be resized smaller or equal to the "master volume" while the LVM clone action allows resizing to a bigger size than the "master".

For Cloud deployment the preferred deployment action (snap or clone) can be configured in the KVM plugins configuration options in the plugin manager.

Create Volume form

Creating the new volume and its image object in openQRM continues with the server wizard. Please click on submit on the pre-selected just created image.

Click Submit

In the "image edit" section you can set a custom password for the image console- and ssh login. Please notice that for Windows OS installation on an image the image type should be set to "windows" instead of "linux".

Set custom password

The previous action finalizes the server wizard and forwards to the server list. Click on the "start" button of the new created server.

Just for info:


Starting a server will "combine" the "resource" with the "image" configured in the "server". Stopping a "server" will automatically "separate" the "image" from the "resource". That way each of the objects in openQRM become completely independent from each other and e.g. can be re-combined with different or updated sub-objects. Also this makes it very straight forward to e.g. restart an "image" with a different "resource" (even with a different resource type in case of P2V/V2P) in case of a automatic high-availability fail-over event.

Server overview

Please confirm starting the server.

Start Server

When the server is started please click on the "NoVNC" in the server action tab. This will open up a VNC console in the web-browser and allows to install the Android OS.

Click 'NoVNC'

Here's the VNC console of the VM. In the Grub menu of the starting VM booting from the Android installation iso please select the last option "Installation - install Androidx86 to hard disk" and press return.

Grub Menu

When the installer starts please select "create/modify partitions"

Create/Modify Partitions

Select "new" to create a new partition.

Create New partition

Select "primary".

Select Primary

Make sure to set the "bootable" flag.

Bootable flag

Now select "write" and confirm to setup the partition.

Confirm partition setup

Back in the Android installer select the just created new partition sda1.

Select new partition

Please select "ext3" as the filesystem type for this partition.

Select 'ext3'

Confirm with "Yes" to create the filesystem.

Create filesystem

Also select "Yes" when the installer asks if to install the grub boot-manager.

Install grub boot-manager

In the following dialog also select "Yes" for making the system partition of the Android OS read+writeable. This is useful (and needed) to adjust the Android image later.

Select Yes

4. After Android Installation

When the Android installation is finished please select "reboot".

Csm 031 android 0244316552.png

Please remember that the VM configuration is still set to boot from the installation iso!

Therefore it is now recommended to stop the automated boot of the Android installation iso since this will boot into a live-system from the iso but not from the disk.

We are going to update the VM configuration to boot from local disk in the next step.

Update VM configuration

In the server list please stop the server.

Stop the Server

Confirm stopping the server.

Confirm stopping the server

Now please go to

Plugins -> Virtualization -> KVM -> VMs

select the KVM Host and click on "edit"

Select KVM host

In the VM overview please click on "update" of the server's VM.

Update Server VM

Now set the boot sequence to boot from "local" and click on submit. After that please go back to the server list and start the server. When the server is started click again on the "NoVNC" action button of the server.

Set boot sequence to boot from Local

Here is the first boot screen of the Android OS running in the KVM VM.

First Boot screen

In the Wi-Fi selection please click on "skip".

Click 'Skip'

In the "Got Google" dialog please click on "No" and "remind me later".

Select 'No'

In the next "Google location" dialog use the right arrow to go on.

Click the right arrow

Set date and time.

Set date and time

And create a user.

Create a user

The Android OS will now further boot up.

Android OS booting

Here is the Android start-up screen. Go to the application by the middle button in the Android UI.

Android Start-up screen

Click on the "terminal emulator" app icon to start a terminal session.

In the terminal you can use "su" to get root access.

Please follow the next steps to configure SSH access and install the "openQRM client for Android" in the image.

Click on the "terminal emulator" app

5. Enable sshd

To get access the the Android OS filesystem use "kpartx" to mount the first partition of the logical volume. This should be only done when the image is not in use by an active VM, so the first thing is to stop the server.

Please go to the server list and stop the "android44" server.

Then please run on your KVM host in a root terminal:

kpartx -av /dev/lvols/android44
mount /dev/mapper/lvols-android44p1 /mnt/
ssh-keygen -b 2048 -C android44 -t rsa -f ssh_host_rsa_key 

(when it asks for a passphrase just press return)

ssh-keygen -b 1024 -C android44 -t dsa -f ssh_host_dsa_key

(when it asks for a passphrase just press return)

Now copy all generated file to /mnt/android-4.4-RC2/data/ssh/

cp ssh_host* /mnt/android-4.4-RC2/data/ssh/

Also download the "sshd_config" file for the Android OS from the Android plugin's usage page and copy it to /mnt/android-4.4-RC2/data/ssh/

cp sshd_config /mnt/android-4.4-RC2/data/ssh/

Finally add your personal public key to /mnt/android-4.4-RC2/data/.authorized_keys

cat /root/.ssh/id_rsa.pub > /mnt/android-4.4-RC2/data/.authorized_keys

The sshd service on the Android OS will be automatically started by the openQRM Client for Android which is explained as the next step.

6. Install the openQRM Client for Android OS

Download the openQRM Client for Android OS from the Android plugin's usage page.

Copy it to /mnt/android-4.4-RC2/data/openqrm-client-android.sh

cp openqrm-client-android.sh /mnt/android-4.4-RC2/data/

To automatically start the openQRM Client for Android follow the steps below:

1) Create a directory /mnt/android-4.4-RC2/system/vendor/etc

mkdir -p /mnt/android-4.4-RC2/system/vendor/etc

2) Create a file "init.sh" in this directory with the following command:

echo "sh -x /data/openqrm-client-android.sh" > /mnt/android-4.4-RC2/system/vendor/etc/init.sh

Now please umount the Android filesystem and release kpartx with the following commands:

umount /mnt
kpartx -dv /dev/lvols/android44 

Now please start the server again.

After the above configuration we can now passwordless login to the Android system by ssh.

Passwordless login

The Android "master image" for Cloud deployment is now configured and ready to use. Please go the the server list again and stop the server.

Then go to

Plugins -> Cloud -> Configuration -> Private Images

Private image manager

And set the Android "master image" to be used by "Everybody".

Android master image

Go to the openQRM Cloud login page

Plugins -> Cloud -> Portal

and login to the Cloud.

Please notice that enabling the Cloud automatically creates an "admin" project with the "openqrm" user and the same password as set for the openQRM administration UI.

openQRM administration UI

In the Cloud user dashboard please click on "new instance".

New Instance

In the "instance create" form please select the "android44" image and adjust cpu, disk, memory and network according to your needs.

Adjust resources

The instance is now going to start. While starting it goes through the following phases:

  • approve
  • create
  • start
  • active
Instance starting

Here is the permission and limits overview while the instance is still starting.

Permission and limits overview

Here is the permissions and limits overview when the instance is fully up and running.

Instance is fully up and running

In the Instance overview in the Cloud portal please click on "NoVNC" to gain console access to the Android OS.

Click on "NoVNC"

Here again the Android UI after fully started up in the openQRM Cloud, requested and cloned from the "master image" on demand.

Android UI after fully started up

Please open up the "terminal emulator" app again.

Open Terminal Emulator

In the terminal run

su

to get root access

Click 'Allow'

Here is the network configuration of the Android OS started in the openQRM Cloud. Please notice the correctly configured external IP address to be accessible by the Cloud users "remotely".

Network configuration of the Android OS

Congratulations!!

You have successfully completed this How-To!

NOTE AGAIN

The Android OS support in openQRM is only available in the openQRM Enterprise Edition >= 5.1.4!