Though guest VM inside google compute engine raises concerns about performance, there are situations where they prove useful. In this post I am going to discuss how we can install a ubuntu guest VM on google compute engine instance.
There are few caveats though - we can install a KVM compatible hypervisor only on Linux VM instances running only on Haswell or newer processors. Also, Haswell based processors are not available in all GCP regions - they are available in certain regions in US(US central) and Europe.
Windows compute engines do not support nested virtualization.
We need to create compute engines supporting nested virtualization off of disk images tagged with a specific license, namely:
"--licenses https://compute.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx";
With these restrictions in mind, lets proceed with the following steps to launch a compute engine which will host a ubuntu guest VM on top of oracle virtualbox.
1) Log into GCP console and launch the cloud shell:
2) set project:$ gcloud compute disks create virtualization-tagged-disk --image-project ubuntu-os-cloud --image-family ubuntu-1804-lts --zone us-central1-a --licenses "https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
It might ask for authorization - click on "Authorize".
5) Launch an instance selecting the disk and appropriate region and processor:
Once the compute engine instance is started - we can ssh into it and setup a desktop environment so that we can access it via RDP.
Setting up RDP and install oracle virtualbox:
Setup RDP on the compute engine:
1) Once inside the compute engine instance - we can uncomment following series of command to setup the RDP server environment and change the password for root user and then exit and connect back to the box via a remove RDP client:
Note: For better view install xfce4 goodies:
apt-get install xfce4 xfce4-goodies
No comments:
Post a Comment