nadchif / in-browser-virtual-machine

Run a Virtual Machine in your browser and boot Alpine 3.20 or FreeDOS 1.2
https://nadchif.github.io/in-browser-virtual-machine/
MIT License
39 stars 10 forks source link

Issues running on Termux #1

Open b9Joker108 opened 1 month ago

b9Joker108 commented 1 month ago

Hi

Thanks for your code.

I git cloned and checked out only your Alpine Linux branch and installed. But, this is my shell output:

❯ npm run dev

> browser-vm@0.0.0 dev
> vite

  VITE v5.4.8  ready in 557 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
Error: spawn /usr/bin/google-chrome ENOENT                                                                                             at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)

And, the container image booted up successfully in my browser, but as I am on a Tablet, I couldn't enter "root" at the login prompt. When I select the screen to type, the virtual keyboard is off screen and when the keyboard is back on screen, the field isn't selected, so it is a Catch 22! The hack I have learnt to get the keyboard back in similar situations, which in the Samsung flavour of Android is pressing a particular button, doesn't work in the browser context, like it does in other apps, such as Termux and RVMC Viewer, for example.

b9Joker108 commented 1 month ago

Generally, if I press the chevron button at the far right of the bottom bar of the Samsung Android OS, the virtual keyboard comes back onscreen, and then typing in the active field on the screen is possible. But, doing the same hack in this situation and context, instead, moves the browser page to prior viewed page and so, the loaded and booted VM of the Alpine Linux image in the browser is lost! Any idea of a workaround?

Button

nadchif commented 1 month ago

Hi @b9Joker108 I don't think by default the v86 is configured as mobile friendly 😅

There is a work around using Xterm.js which may work better on a mobile tablet.

Check out this branch: https://github.com/nadchif/in-browser-virtual-machine/tree/boot-linux-terminal

Please try it out and share how it goes 🤞😊

b9Joker108 commented 1 month ago

I am a bit confused how I check out and git clone that branch. I was amazed that I actually did the last one successfully! Could you please spoon-feed me a bit more?

nadchif commented 1 month ago

Sure, First, clone the repository:

git clone https://github.com/nadchif/in-browser-virtual-machine.git

Navigate into the directory

cd  in-browser-virtual-machine

Checkout the branch

git checkout boot-linux-terminal

Install dependencies

npm install

Run

npm run dev
b9Joker108 commented 1 month ago

I am a bit confused, as I installed the branch: boot-linux-terminal, which is the Alpine image, specifically last time and had the issue with the virtual keyboard, as per this issue. But, you are telling me pretty much to do the same thing, but have made a note about Xterm.js. I don't understand how I ensure that Xterm.js is specified, if I just do the same commands I did initially?