BalenaOS as docker or VM

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?

Hi there, welcome to balena :slight_smile: Both are definitely possible, here’s a tool to run balenaOS in a 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/. Let us know how it goes or if you get stuck at some point and we can help out. Have a nice day!

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?

Hi Matt

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

.\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:

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

Phil

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

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/

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

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!

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.

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, you can do this on C:\ProgramData\Docker\config\daemon.json with "storage-driver": "aufs"

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

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?

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/
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?

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:

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

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

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

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