Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VirtualBox and Google Compute Engine [closed]

Can I run VirtualBox and an active VM on a server hosted on Google Compute Engine? If yes, what are the steps? Just install it and build the VM through VNC?

So far I have found similar solution for DigitalOcean where you simply install VirtualBox, xfce, VNC, etc. and it runs.

like image 258
Petar Yankov Avatar asked Jun 04 '15 15:06

Petar Yankov


People also ask

Is it possible to retrieve a virtual machine after deletion in GCP?

No, it is not possible to retrieve the instances that have been deleted once. If it has been stopped, it can be retrieved back by simply starting it again.

How do I reset Google Compute Engine?

In the vSphere vCenter, select the virtual machine. Right-click the VM and select Migrate for Google Compute Engine Operations > Restart.

How do I close a VM instance in Google Cloud?

To stop a VM, use the Google Cloud console, the gcloud CLI, or the Compute Engine API. In the Google Cloud console, go to the VM instances page. Select one or more VMs that you want to stop. Click Stop.

Why should you stop your VM instance when you're done?

You might want to stop a VM for several reasons: You no longer need the VM but want the resources that are attached to the VM—such as its internal IPs, MAC address, and persistent disk. You don't need to preserve the guest OS memory, device state, or application state.


2 Answers

  1. Create GCE instance
  2. SSH to that instance
  3. Download and install Virtualbox (wget DEB + sudo dpkg -i virtualbox-5*.deb)
  4. Upgrade system, build and install kernel modules
    • sudo apt-get update
    • sudo apt-get upgrade
    • sudo apt-get dist-upgrade
    • sudo apt-get install -y build-essential
    • sudo apt-get install -y linux-headers-$(uname -r)
    • sudo /etc/init.d/vboxdrv setup
  5. Profit!

To check if all is good just run VBoxManage --version. If some other errors are present google and resolve

like image 123
noz Avatar answered Nov 16 '22 02:11

noz


Yes, the same approach will work on a GCE VM.

You can also use Vagrant with the Google Compute Engine plugin to automate creation of virtual machines and GCE VMs.

like image 23
Misha Brukman Avatar answered Nov 16 '22 02:11

Misha Brukman