question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make VM sandboxing optional

See original GitHub issue

I know this may be controversial, but considering that VM may not be foolproof, perhaps an option to not use VM may be useful? E.g., if the host app only allows running vetted plugins.

VM causes issues with plugins intended to run in window context. I have troubles accessing setTimeout, Blob and other native window features. Also it breaks React’s useEffect, although that can be worked around by passing the plugin useEffect implementation from the host (so far I can’t find workarounds for native window features).

(Context: I’m working on a project that uses plugins in Electron, and plugins provide both components that run in Node context and components that run in browser window context.)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
strogonoffcommented, Nov 2, 2020

I should withdraw this request, as no-VM loading of trusted code is actually straightforward to do per my previous comment. Plugin manager is still handy for installing plugins from NPM and running plugin’s Node (main thread) code within VM sandbox.

0reactions
strogonoffcommented, Nov 2, 2020

I think by running VM-loaded module in browser context I was stretching what VM was intended to do, and passing native window functions to VM sandbox would not be possible any time soon. Considering plugin code is trusted, plain require() may be the way to go in browser context. Conveniently, PluginManager’s getInfo()?.location can be used to construct the path to require. Thanks for this useful package!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use Windows Sandbox - a lightweight virtual machine
In this step-by-step tutorial, learn how to use Windows 10 Sandbox. Windows Sandbox provides a lightweight desktop environment to safely run ...
Read more >
How to use the Windows 11 Sandbox as a virtual machine
Open File Explorer to the Windows\System 32 path. Scroll down until you see the WindowsSandbox.exe file. You can then create a shortcut from...
Read more >
Windows Sandbox
Enable virtualization on the machine. ... Use the search bar on the task bar and type Turn Windows Features on or off to...
Read more >
Windows Sandbox Tutorial – How to Enable ...
Windows Sandbox is a temporary lightweight desktop environment that ... You have to make sure that you already have enabled virtualization.
Read more >
How to enable Windows Sandbox in VMware Workstation
Instead, you need to enable another option in VMware Workstation that is responsible for creating a nested virtual machine or Windows Sandbox.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found