Using BalenaOS in local-mode

Hello,

I would like to give a try to BalenaOS on my Raspberry Pi 4.
Balena sounds a great and good way to run containerized applications on such devices.

I wonder how to run BalenaOS standalone, without using any cloud, directly from my own laptop.
I understand that I have to use Balena CLI in “local-mode”.

The documentation talk about using a “standalone” image, but the download page only provide production or development ones.

Is there anywhere another image ? Do I have to configure the development image or the Balena CLI ?

Any help appreciated !
Regards

Hi there! You can use the standalone/unmanaged balenaOS. More info here: https://www.balena.io/docs/reference/OS/overview/2.x/#standalone-balenaos.
Cheers!

Hi, thanks for your response,
But where can I find the URL to download standalone image ?
The documentation you point send me to https://balena.io/os but no way to download it, there is only production or development variants.

Hey there. The production and development variants found on https://balena.io/os are unmanaged BalenaOS variants.

Ok, I have tried with the development image found on https://balena.io/os

I follow this getting started guide: https://www.balena.io/os/docs/raspberrypi4-64/getting-started/

First step is to download, configure and flash dev image: ok it’s done, I boot rpi, balena scan find my device.

Then I use the balena CLI:
balena ssh mydevice.local

And balena is asking me to login
(same for balena push)

Don’t understand why I need to login to cloud in order to access an unmanaged device ?
I miss something ?

Hi

Can you please run balena --version and tell what’s the output? If it’s older than 11.0.0, can you please update balena-cli?

We had such issue in the past and we fixed it since 11.0.0. See this changelog https://github.com/balena-io/balena-cli/blob/master/CHANGELOG.md#1100---2019-06-04

About the “unmanaged” variant, we have a piece of old documentation to update: since last year, images downloaded from balena.io/os are unconfigured which is what that doc is calling “unmanaged”, so we don’t have a specific unmanaged variant any more, both prod and dev variant are unmanaged until you configure them (or if you downloaded them from the dashboard: in that case, they are already configured)

We’ll update the docs to make this clearer. Thanks for pointing that out!

Best regards

federico

Hi

I’ve double checked it and indeed, on a freshly flashed raspberrypi3, unconfigured, I’m able to balena ssh balena.local without being logged in to the balenacloud, using latest balena-cli, 11.21.0

Best regards

federico

Hi,

I’m not behind my laptop right now to check the version,
But I installed balena CLI yesterday with the latest MacOS package available https://github.com/balena-io/balena-cli/releases
It should be v11.21.0, I will check later.

Regards,
Emeric.

Hum, I have configured it (in order to set wifi settings):

$ sudo balena local configure ~/Downloads/balena.img

Perhaps this operation is turning the device to a “managed state”, and thus login is required ?

local configure will only configure things like wifi connections and advanced settings relating to the OS only. Configure in the above context means to join a backend, but that’s not what we want to do. As it happens, I wrote the SSH code, and it certainly shouldn’t be required that you login first. Please do let us know the version of CLI you are using, and you can check you are using the expected one with which balena.

My bad,

I was using the device name without the .local, thinking it was the name of the host on the LAN.

$ sudo balena local configure ~/Downloads/balena.img
Password:
? Network SSID ***
? Network Key ***
? Do you want to set advanced settings? Yes
? Device Hostname cpmpi-01
? Do you want to enable persistent logging? No 

$ ping cpmpi-01
PING cpmpi-01.lan (192.168.1.125): 56 data bytes
64 bytes from 192.168.1.125: icmp_seq=0 ttl=64 time=3.742 ms

$ balena ssh cpmpi-01
You have to log in to continue
...

$ balena ssh cpmpi-01.local
Last login: Fri Jan 10 17:16:53 2020 from ...
root@cpmpi-01:~#

Don’t know where this .local came from.
I have configured the image with device name cpmpi-01, and the default extension for my LAN is .lan

Ah, yes, you do need the ‘.local’ appended. Our documentation located here [https://www.balena.io/docs/learn/develop/local-mode/#scan-the-network-and-find-your-device] does include the information about ‘.local’, but I will have a look at making that explanation more clear. Glad to hear it is working now though!