TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How Easy Would It Be to Replace Docker with VirtualBox?

4 pointsby TicklishTigerover 6 years ago
The reason I use Docker is that I can quickly run sandboxed code and have it access a local folder:<p>docker run -v $PWD:&#x2F;somedir --rm someimage somecode &#x2F;somedir<p>I wonder if that is actually a new thing Docker introduced or if a similar command line exists for VirtualBox?

2 comments

i0nutzbover 6 years ago
The advantage of running docker is that you don&#x27;t virtualize things =&gt; everything is faster (boot time, access files and so on). (assuming you&#x27;re runing on a Linux machine)<p>In Virtual Box you have this „Shared Folders” which basically acts the same (I have no idea if&#x2F;how you can do this via CLI though). But the access to that is done via SMB, so even if everything is local, you&#x27;ll have some latencies involved.
评论 #19198268 未加载
cabracaover 6 years ago
what you have to consider is, that docker does not emulate hardware and does not run a complete OS inside. that said you can definitly do something in that direction with virtualbox:<p>create an .ova file as a template for your sandbox.<p>to &quot;spin up&quot; your sandbox you have to import that image, add a shared folder and start it headless:<p><pre><code> vboxmanage import yourtemplate.ova --vsys 0 --vmname yourvmname vboxmanage sharefolder add &quot;yourvmname&quot; - name &quot;SF name&quot; -hostpath &quot;x:\path&quot; vboxmanage startvm yourvmname --type headless </code></pre> or something like that. You can find most of that stuff in Chapter 8 of the VirtualBox docs: <a href="https:&#x2F;&#x2F;www.virtualbox.org&#x2F;manual&#x2F;ch08.html" rel="nofollow">https:&#x2F;&#x2F;www.virtualbox.org&#x2F;manual&#x2F;ch08.html</a>