# BalenaOS as docker or VM

**URL:** <https://forums.balena.io/t/balenaos-as-docker-or-vm/113572>\
**Category:** balenaOS\
**Created:** [May 14, 2020, 7:20am UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572 "2020-05-14T07:20:38Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![thais](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@thais](https://forums.balena.io/u/thais)\
**Post date:** [May 14, 2020, 7:20am UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/1 "2020-05-14T07:20:38Z")

</div>

For demo and testing purposes I want to have a BalenaOS and the apps on top public available.  
Is BalenaOS as docker version available or is there a chance to host BalenaOS and the apps as VM in Azure?

---

<div class="post-metadata">

**Author:** ![sradevski](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sradevski/32/1609_2.png) [@sradevski](https://forums.balena.io/u/sradevski)\
**Post date:** [May 14, 2020, 7:37am UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/2 "2020-05-14T07:37:18Z")

</div>

Hi there, welcome to balena 🙂 Both are definitely possible, here’s a tool to run balenaOS in a container: [https://github.com/balena-os/balenaos-in-container](https://github.com/balena-os/balenaos-in-container), and here is a blogpost (although quite dated) for running it in VirtualBox: [https://www.balena.io/blog/no-hardware-use-virtualbox/](https://www.balena.io/blog/no-hardware-use-virtualbox/). Let us know how it goes or if you get stuck at some point and we can help out. Have a nice day!

---

<div class="post-metadata">

**Author:** ![thais](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@thais](https://forums.balena.io/u/thais)\
**Post date:** [May 14, 2020, 9:51am UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/4 "2020-05-14T09:51:36Z")

</div>

Thanks for you answer!  
I tried docker on windows and received the following error:  
INFO: Creating balena-boot-balenadocker docker volume…  
INFO: Creating balena-state-balenadocker docker volume…  
INFO: Creating balena-data-balenadocker docker volume…  
INFO: Running balenaOS as container balena-container-balenadocker …  
Failed to find module ‘autofs4’  
Configuration file /etc/systemd/system.conf.d/watchdog.conf is marked executable. Please remove executable permission bits. Proceeding anyway.  
Failed to create symlink /sys/fs/cgroup/net\_prio: File exists  
Failed to create symlink /sys/fs/cgroup/net\_cls: File exists  
Failed to create symlink /sys/fs/cgroup/cpu: File exists  
Failed to create symlink /sys/fs/cgroup/cpuacct: File exists

```
Welcome to balenaOS 2.46.0+rev1!

```

Maybe someone else has the same problem?

---

<div class="post-metadata">

**Author:** ![phil-d-wilson](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/phil-d-wilson/32/3730_2.png) [@phil-d-wilson](https://forums.balena.io/u/phil-d-wilson)\
**Post date:** [May 14, 2020, 10:46am UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/5 "2020-05-14T10:46:05Z")

</div>

Hi Matt

I just tried this myself on Windows, and it worked OK. This is the command I ran:

```auto
.\balenaos-in-container.ps1 -image balenalib/intel-nuc-alpine -id test -c config.json -detach

```

It seems that the image you are trying to run needs `aufs` installed on your system, as per step 3 in the instructions here:

> **[balena-os/balenaos-in-container](https://github.com/balena-os/balenaos-in-container)**
>
> Run balenaOS as a docker container. Contribute to balena-os/balenaos-in-container development by creating an account on GitHub.

Can you let me know the command you ran, with all the arguments, on your system?

Phil

---

<div class="post-metadata">

**Author:** ![thais](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@thais](https://forums.balena.io/u/thais)\
**Post date:** [May 14, 2020, 2:10pm UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/7 "2020-05-14T14:10:02Z")

</div>

That was my command:  
.\balenaos-in-container.ps1 -image resin/resinos:2.46.0\_rev1.dev-intel-nuc -id balenadocker -c “$PWD\config.json”

---

<div class="post-metadata">

**Author:** ![ab77](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ab77/32/2870_2.png) [@ab77](https://forums.balena.io/u/ab77)\
**Post date:** [May 14, 2020, 4:13pm UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/8 "2020-05-14T16:13:29Z")

</div>

Hi there, can you please check what version of Docker you have installed and if you have an older version, upgrade as per [https://docs.docker.com/docker-for-windows/install/](https://docs.docker.com/docker-for-windows/install/)

---

<div class="post-metadata">

**Author:** ![thais](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@thais](https://forums.balena.io/u/thais)\
**Post date:** [May 15, 2020, 9:04am UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/10 "2020-05-15T09:04:14Z")

</div>

Updating did not help. On my mac it was successful. Guess ok for the moment

---

<div class="post-metadata">

**Author:** ![odyslam](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/odyslam/32/1684_2.png) [@odyslam](https://forums.balena.io/u/odyslam)\
**Post date:** [May 15, 2020, 9:22am UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/13 "2020-05-15T09:22:30Z")

</div>

Hi Thais,

Could you please provide us with a version for you Windows OS and docker that you use? Since High verified that it works as expected on Windows, we should investigate why the `aufs` storage driver is not supported on your system.

Thanks!

---

<div class="post-metadata">

**Author:** ![thais](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@thais](https://forums.balena.io/u/thais)\
**Post date:** [May 15, 2020, 2:45pm UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/15 "2020-05-15T14:45:56Z")

</div>

Latest Win 10 and docker version 19.03.8  
Here an abstract from docker info:  
…  
Storage Driver: overlay2  
Backing Filesystem:   
Supports d\_type: true  
Native Overlay Diff: true

Nevertheless, my idea was to run balenaOS as docker with my application services on top. As I found out I cannot reach the frontend service in that docker network.

---

<div class="post-metadata">

**Author:** ![alexgg](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@alexgg](https://forums.balena.io/u/alexgg)\
**Post date:** [May 15, 2020, 3:53pm UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/16 "2020-05-15T15:53:38Z")

</div>

Hi, thanks for that information. We will compare with our working version and come back to you.  
In the meantime, could you try configuring docker with aufs storage support? According to [https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/configure-docker-daemon#configure-docker-with-a-configuration-file](https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/configure-docker-daemon#configure-docker-with-a-configuration-file), you can do this on `C:\ProgramData\Docker\config\daemon.json` with `"storage-driver": "aufs"`

---

<div class="post-metadata">

**Author:** ![Faltus](https://avatars.discourse-cdn.com/v4/letter/f/c89c15/32.png) [@Faltus](https://forums.balena.io/u/Faltus)\
**Post date:** [May 15, 2020, 4:09pm UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/18 "2020-05-15T16:09:24Z")

</div>

> Nevertheless, my idea was to run balenaOS as docker with my application services on top. As I found out I cannot reach the frontend service in that docker network.

Good point is that possible, struggling with the same problem. I also want to call a frontend service running on BalenaOS docker version

---

<div class="post-metadata">

**Author:** ![alexgg](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@alexgg](https://forums.balena.io/u/alexgg)\
**Post date:** [May 15, 2020, 5:46pm UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/19 "2020-05-15T17:46:44Z")

</div>

Hi, our working setup is also on Windows 10 and the same version of docker, running on WSL2. Could you please paste the whole output of `docker info`?

---

<div class="post-metadata">

**Author:** ![thais](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@thais](https://forums.balena.io/u/thais)\
**Post date:** [May 15, 2020, 6:10pm UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/21 "2020-05-15T18:10:45Z")

</div>

docker info:

Client:  
Debug Mode: false

Server:  
Containers: 29  
Running: 0  
Paused: 0  
Stopped: 29  
Images: 522  
Server Version: 19.03.8  
Storage Driver: overlay2  
Backing Filesystem:   
Supports d\_type: true  
Native Overlay Diff: true  
Logging Driver: json-file  
Cgroup Driver: cgroupfs  
Plugins:  
Volume: local  
Network: bridge host ipvlan macvlan null overlay  
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog  
Swarm: inactive  
Runtimes: runc  
Default Runtime: runc  
Init Binary: docker-init  
containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429  
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd  
init version: fec3683  
Security Options:  
seccomp  
Profile: default  
Kernel Version: 4.19.76-linuxkit  
Operating System: Docker Desktop  
OSType: linux  
Architecture: x86\_64  
CPUs: 4  
Total Memory: 7.992GiB  
Name: docker-desktop  
ID: UJKO:B7V6:DXDZ:UAJG:QLVK:EUV7:ZPYU:SAYI:AS3F:GPBO:PLGL:W6N4  
Docker Root Dir: /var/lib/docker  
Debug Mode: true  
File Descriptors: 40  
Goroutines: 54  
System Time: 2020-05-15T14:42:30.747915731Z  
EventsListeners: 4  
Registry: [https://index.docker.io/v1/](https://index.docker.io/v1/)  
Labels:  
Experimental: false  
Insecure Registries:  
127.0.0.0/8  
Live Restore Enabled: false  
Product License: Community Engine

* * *

Same result after I added the daemon.json

Do I need to run this scipt balenaos-in-container.ps1 with admin privileges?

---

<div class="post-metadata">

**Author:** ![phil-d-wilson](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/phil-d-wilson/32/3730_2.png) [@phil-d-wilson](https://forums.balena.io/u/phil-d-wilson)\
**Post date:** [May 15, 2020, 7:25pm UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/22 "2020-05-15T19:25:03Z")

</div>

Hey,

I’ve run the same image as you, and it’s working fine on Windows 10, with the same version of docker. I’ve gone through our docker info outputs, and the only difference is this:

Mine: `Kernel Version: 4.19.84-microsoft-standard`  
Yours: `Kernel Version: 4.19.76-linuxkit`

I’m running docker with WSL2 integration, the instructions to turn that on are here:

> **[Docker Desktop WSL 2 backend](https://docs.docker.com/docker-for-windows/wsl/)**
>
> Windows Subsystem for Linux (WSL) 2 introduces a significant architectural change as it is a full Linux kernel built by Microsoft, allowing Linux containers to run natively without emulation. With...

And no, I didn’t run the command in an Administrator prompt.

I think it’s worth you trying to install the WSL2 integration and having another go. Let me know how you get on.  
Phil

---

<div class="post-metadata">

**Author:** ![jgentes](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jgentes/32/1595_2.png) [@jgentes](https://forums.balena.io/u/jgentes)\
**Post date:** [May 18, 2020, 1:37pm UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/24 "2020-05-18T13:37:02Z")

</div>

For VM support, I recently posted an updated article that includes VMware and some Windows specific instructions here: [How to create VMware or VirtualBox virtual machine from Balena app image](https://forums.balena.io/t/how-to-create-vmware-or-virtualbox-virtual-machine-from-balena-app-image/95385)

---

<div class="post-metadata">

**Author:** ![thais](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@thais](https://forums.balena.io/u/thais)\
**Post date:** [May 18, 2020, 5:01pm UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/25 "2020-05-18T17:01:40Z")

</div>

Thank you all for the great support! Wsl2 was disabled. Now it is working!

---

<div class="post-metadata">

**Author:** ![jviotti](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jviotti/32/220_2.png) [@jviotti](https://forums.balena.io/u/jviotti)\
**Post date:** [May 18, 2020, 5:15pm UTC](https://forums.balena.io/t/balenaos-as-docker-or-vm/113572/26 "2020-05-18T17:15:55Z")

</div>

Thanks for taking the time to write that excellent post, and glad to hear its working fine!
