Comments (8)
Yes, this is very possible. We’ve had this working in our embedded ansible server (Baker) for virtualbox and hyper-kit. Will create a demo Dockerfile with this working.
from slim.
Closing issue since we now support sync by default. Can revisit any problems with new issue. Thanks!
from slim.
The basic idea for virtualbox is up and running. Requires a few steps, with pointers to line in Dockerfile or init: https://github.com/ottomatica/slim-images/tree/master/alpine3.8-vbox-mount
-
Need to add
virtualbox-guest-modules-virt
to kernel layer in order to get right kernel modules. -
Need to add
virtualbox-guest-additions
to main layer. -
modprobe vboxsf mkdir -p /shared mount.vboxsf -o uid=1000,gid=1000 vbox-share-0 /shared
Now, can access shared folder (set to / of host-system by virtualbox-provider).
$ slim build alpine3.8-vbox-mount
$ slim run m0 alpine3.8-vbox-mount
...
Executing VBoxManage sharedfolder add m0 --name "vbox-share-0" --hostpath "/"
....
nanobox:~# ls /shared/Users/cjparnin/projects/slim-images/
README.md alpine3.8-kubernetes alpine3.9-runc-ansible ubuntu16.04-kubernetes
alpine3.8-datascience alpine3.8-vbox-mount docs ubuntu16.04-simple
Hyperkit, is going to be a bit more "gnarly".
from slim.
Ok, proof-of-concept for hyperkit shared folders for @blissdev:
First, build this image in the slim-images repo.
slim build slim-images/alpine3.8-9p-mount
The main difference is that you just add steps to mount the 9p network filesystem in the init script.
# 9p
mkdir -p /shared
modprobe 9pnet_virtio
mount -t 9p -o trans=virtio shared /shared
However, the real difference is how you run hyperkit (see run.sh).
a) You need to pass a unix socket that will be used for 9p protocol.
b) You need a 9p filesystem server running.
I've provided a proof of concept script that does this. It will boot up this image directly in hyperkit.
cd slim-images/alpine3.8-9p-mount/scripts/ && ./run.sh
...
nanobox:~# ls /shared/
Applications home
Library installer.failurerequests
Network net
System opt
Users private
At some point, we can migrate some of this leg work into slim.
from slim.
@chrisparnin Wow, thank you so much for putting this together! I was initially thinking that hyperkit may provide a better experience, but from your perspective what do you think is the better option? Will hyperkit be lighter weight? Any advice?
from slim.
Honestly, this is probably something that would best be answered with longer term experimentation.
My use cases tends to center around being able to quickly spin up VMs, doing some local testing for infrastructure scripts, and throwing them away. For this, VirtualBox, isn't so bad, and actually can be ready just as fast as hyperkit. Hyperkit might be better for compute heavy tasks, but it is also pretty rough around the edges when it comes to other features.
from slim.
Guess I'll have to experiment, thanks again! :)
from slim.
Slim will now automatically mount /
at /host
and cwd
(ie the directory where you run the slim run
command) at /slim
within the VM. This automounting can be disabled by passing the --nosync
option in the slim run
command.
from slim.
Related Issues (20)
- ability to pass environments variables to the docker image HOT 1
- Building behind a proxy HOT 9
- VBoxManage: error: RawFile#0 failed to create the raw output file /home/tlittle/.baker/micro1.log (VERR_FILE_NOT_FOUND) HOT 8
- Prepare image for newer alpine linux versions
- Error: ENOENT: no such file or directory HOT 5
- slim run gets stuck at "Waiting for IP address" HOT 1
- Not able to run VM on MacOS HOT 7
- Error building image HOT 6
- slim: Unable to uncompress kernel HOT 1
- qcow2 image output HOT 5
- Missing license HOT 2
- Error: ENOENT: no such file or directory ~/alpine3.8-runc-ansible/info.yml HOT 3
- How to stop a VM? HOT 2
- slim on AWS EC2 HOT 7
- Attach command HOT 3
- Add `slim start [vm-name]` command HOT 2
- Providing acpid support for KVM HOT 1
- Adding QEMU provider
- Broken `slim push` logic HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slim.