How to create a Linux VM in GCP/Azure/AWS which can be accessed over a browser

122 Views Asked by At

I am working on a project where a user clicks a link/button that says Access VM on a webpage, it should internally spin up a Linux based VM (using GCP, AWS or Azure) and provide the VM terminal in a new browser tab for the user to play around in the VM.

How can I achieve this using GCP/AWS/Azure? Which type of VM should I create so that the user can access the VM terminal over a browser without using an SSH client?

I tried creating a VM on Azure and explored the Bastion option. But this Bastion session should always be initiated from within the Azure portal.

Do we have any other option within GCP, AWS or Azure to achieve this?

I am looking for something similar to katacoda website.

1

There are 1 best solutions below

0
On

There's no built in feature in GCP that will allow such thing possible. There is a button "SSH" in the VM's list but you have to be able to view the list and also have the permission to connect to the instance. But that requires to actually log into GCP which I believe is not what you want.

**You could try and built some solution that after clicking an "Connect" button you your website would send a series of commands to GCP's API to create & connect to the new isntance. It's possible but rather complicated.

Have a look at the documentation how to connect to VM using browser - maybe it will give yolu some ideas.

Ultimately use many other 3rd party tools but you still need to provide an address and credentials - additionally you rely on a service that you don't control so you have to take security (and reliability) into consideration.

At the end you may also consider going through general information how to connect to GCP's instances.