Hosting & Domaining Forum

Hosting Discussion => Hosting Software and Control Panels => Topic started by: JuliaSchneider on Mar 31, 2023, 12:02 AM

Title: Is there technology for creating Virtual Machines "on demand"?
Post by: JuliaSchneider on Mar 31, 2023, 12:02 AM
Greetings!

The KolibriOS operating system (www.kolibrios.org) has an automated build process on the server, which creates IMG + ISO files after every commit. These files can be burned onto a floppy disk/USB flash drive/CD, or run on a virtual machine. However, we also want to offer users the ability to directly run these IMG/ISO files on a virtual machine through their browsers.

To cater to the varying number of users who may want to try out this image, I propose the creation of individual on-demand virtual machines for each user. This means that when a user clicks on the "make a virtual machine" link, a new virtual machine is created specifically for them. When the user disconnects or remains inactive for more than 30 minutes, the virtual machine will be terminated.

In essence, each user will have their own independent virtual machine that operates within the browser, eliminating the need for installing a virtual machine on their computer.

I have extensively searched for a solution to this problem, but my Google searches have not yielded satisfactory results. It is possible that such a solution does not exist, or it may be referred to by a different name, making it difficult to find. When searching for "Virtual Machine on Demand," I come across cloud hosting platforms that allow the creation of additional virtual machines, but they come with their own operating systems. On the other hand, searching for "Virtual Machine in Browser" leads me to virtual machines that can be directly run from the browser, but there is no mention of "on-demand" capability. If anyone has any knowledge about, has heard of or used a similar solution, I would greatly appreciate your input.

Additionally, if anyone has any suggestions or insights related to the topic at hand, please feel free to share them.
Title: Re: Is there a technology for creating Virtual Machines "on demand"?
Post by: irfanyounas on Mar 31, 2023, 01:10 AM
qemu has the capability to run within a browser using JavaScript, as demonstrated by jslinux. This allows the virtual machine to be executed directly in the browser environment.

In terms of technical considerations, the compact size of KolibriOS makes it an ideal candidate for this approach. However, I am uncertain about the current requirements of KolibriOS and whether it is feasible to launch it using this method.
Title: Re: Is there a technology for creating Virtual Machines "on demand"?
Post by: Janvi on Mar 31, 2023, 02:23 AM
To enable the convenient management of virtual machines, you can install Proxmox VE on your machine. This will allow you to create a cloud of virtual machines, either through the local command-line interface (CLI) or in batches. Each virtual machine can have a read-only disk for deploying the operating system or an ISO mounted in a CD-ROM. Moreover, you can create a user in Proxmox for each virtual machine, following the naming convention of UserX for users and X as the serial number for virtual machines.

1. Whenever there is an update to the image source, a simple restart command will be necessary to apply the changes across all virtual machines.
2. Proxmox provides users with access to the virtual monitor via TightVNC in the browser, utilizing a Java-based connection address such as host.com/vnc?vm=102&user=test&password=pass.
3. Users can easily connect to an available virtual machine.

In terms of managing resources, it may not be necessary to create on-demand virtual machines. Instead, you can keep track of occupied resources and free up virtual machines once a user session is closed, effectively optimizing resource utilization.
Title: Re: Is there a technology for creating Virtual Machines "on demand"?
Post by: jenbaker on Mar 31, 2023, 02:52 AM
In reality, any virtualization system can be in high demand. The decision to offer it as a service can be based on whether you want to make it available for all users or specifically target certain groups, such as developers.

If the latter option is more suitable, you can consider utilizing the KVM Proxmox virtual machine management system. It provides console access through a Java VNC interface in the browser, offering a seamless experience for users.

Additionally, it's worth considering the specific needs and requirements of the target user group when deciding on the most suitable virtualization system and management solution.
Title: Re: Is there technology for creating Virtual Machines "on demand"?
Post by: indiaseos on Jul 07, 2024, 03:58 AM
The approach you're describing is known as Browser-based Virtualization or In-browser Virtualization, and it's an emerging field that has seen some advancements in recent years. The key challenge is to find a way to run a complete operating system, including the necessary hardware emulation, directly within a web browser without requiring any additional software or plugins to be installed on the user's computer.

One potential solution that may be worth exploring is Wasm (WebAssembly) technology. WebAssembly is a low-level, efficient, and portable bytecode format that can be executed in modern web browsers. It provides a way to run near-native performance code in the browser, including operating system emulation and virtualization.

There are a few projects and initiatives that have explored the use of WebAssembly for browser-based virtualization:

1. WASM-VM: WASM-VM is a project that aims to create a WebAssembly-based virtual machine that can run operating systems and applications directly in the browser. It uses WebAssembly to emulate the necessary hardware, allowing users to run various operating systems, including Linux and FreeBSD, within their web browsers.

2. Freeorion: Freeorion is a turn-based strategy game that runs entirely in the browser using WebAssembly. It includes a virtual machine implementation that allows the game to run a complete operating system and game logic within the browser.

3. Wasmer: Wasmer is a WebAssembly runtime that can be used to run WebAssembly-based applications, including operating system emulators, directly in the browser. It provides a platform-agnostic way to execute WebAssembly code.

These projects demonstrate the feasibility of running virtual machines and operating systems within a web browser using WebAssembly. However, to fully address your use case of on-demand virtual machines, you would need to combine this technology with a server-side infrastructure that can dynamically create and manage the virtual machine instances for each user.

One approach could be to use a serverless computing platform, such as AWS Lambda or Google Cloud Functions, to spin up and manage the individual virtual machines. When a user requests a new virtual machine, the serverless function could create a new instance, run the necessary emulator or virtualization layer using WebAssembly, and then expose the virtual machine through a web-based interface.

This would allow you to scale the virtual machine instances on-demand and only charge or utilize resources for the duration of the user's session. Additionally, you could explore the use of WebRTC or other real-time communication protocols to provide a more seamless and responsive user experience within the browser.

It's worth noting that this is a complex problem, and there may be technical and performance challenges to overcome. However, the combination of WebAssembly-based virtualization and serverless computing could provide a viable solution for your use case of offering on-demand virtual machines directly within a web browser.