Deployment difficulties on new ide install

I’ve been trying to setup the sailfish IDE without success on Arch Linux.

Build docker works, connection test to the emulator works. Deploying to emulator fails despite my efforts to try to change the ip as described in another thread.

ssh: connect to host 10.220.220.1 port 22: Connection timed out

My emulator is given the 172.19.0.1 address, since 172.17.0.1 is taken by docker0.

Tried to deploy to an Xperia 10 instead and the IDE is stuck with using aarch64 for it, despite my efforts to push it to use armv7hl, so not working either.

Tried to reinstall it all several times.
Can someone point me to the right direction to build and deploy the basic hello world ? Thanks in advance

2 Likes

I had the same problem, but I switched to VirtualBox and that solved it. Admittedly, using Docker would mean lower resource usage by the VMs and everything would run faster, but I didn’t look into the issue any further.

Thank you for the suggestion, I tried that twice. I don’t know if there are still problems with the build since this choice seems to break the emulator installation :slight_smile:

Error during installation process (org.merproject.emulators.emulator_latest):
Execution failed (Unexpected exit code: 1): “/usr/bin/VBoxManage storageattach SailfishOS-5.1.0.11 --storagectl SATA --port 0 --medium /home/sezuo/Laborejo/Programado/sailfish/SailfishOS/emulator/SailfishOS-5.1.0.11/sailfishos.vdi --type hdd --mtype normal”

Error during installation process (org.merproject.emulators.emulator4qtcreator_latest):
Execution failed (Unexpected exit code: 1): “/usr/bin/VBoxManage snapshot SailfishOS-5.1.0.11 take 5.1.0.11 --description Snapshot taken by the SDK Installer/Maintenance Tool”

I thought that QML looked easy enough for prototyping, I was not expecting the IDE to be the sore point ><. I should investigate that further but run out of time, so I will post an update here if I find a solution, and if not, I will find another hobby.

There is a connection test in the settings of qtcreator, iirc under emulator setttings (and build engine has one too). It should show more info on why it fails.

Both tests work without issue on the docker install.

Issue has been documented in the link I gave: the emulator IP is hard-coded in the build docker as 172.17.0.1, but that IP is not used when there already is another app there. In archlinux this is the default network from docker : docker0. Instead, the docker is given the next free address, in my case 172.19.0.1. Changing the hard-coded IP seem to have worked for some, but did not for me. (Note that the IP has to be changed both on the build docker and in the emulator).

I had to do some networking shenanigans which I have to reapply after every reboot so I saved it to a script. Can you remind me tomorrow to share it with you? I had the exact same issue.

1 Like

Okay, I remembered myself, here it is:

sudo modprobe ip_tables iptable_nat vboxdrv
docker exec sailfish-sdk-build-engine_<username> /usr/libexec/sdk-setup/dnat-emulators

Replace <username> with your own or generally check the container name. The vboxdrv might not be needed, that’s from a different issue which my laptop has.

3 Likes

Those issues where due to a failed uninstall it seems, leaving entries in the virtual box conf file (~/.config/VirtualBox/VirtualBox.xml) :slight_smile:

❯ VBoxManage list hdds
UUID: db9fa9d5-75ad-403b-9351-d0f7810975bf
Parent UUID: base
State: inaccessible
Type: normal (base)
Location: /home/[user]/SailfishOS/emulator/SailfishOS-5.1.0.11/sailfishos.vdi
Storage format: VDI
Capacity: 0 MBytes
Encryption: disabled

UUID: ec431393-20cf-4c97-b71f-9c2521237c64
Parent UUID: db9fa9d5-75ad-403b-9351-d0f7810975bf
State: inaccessible
Type: normal (differencing)
Location: /home/[user]/SailfishOS/emulator/SailfishOS-5.1.0.11/SailfishOS-5.1.0.11/Snapshots/{ec431393-20cf-4c97-b71f-9c2521237c64}.vdi
Storage format: VDI
Capacity: 0 MBytes
Encryption: disabled

This got rid of the offending lingering disks.

VBoxManage closemedium disk db9fa9d5-75ad-403b-9351-d0f7810975bf

This line alone seem to have solved my issue ? Vboxdrv was loaded for sure, don’t know about ip_tables and iptable_nat, so unsure if it’s fully related.

Unfortunately, all issues came back after a reboot, the modprobe fix does nothing this time suggesting my temporary solace was due to my thorough reinstallation of the SDKs and emulator instead.

I am able to use the armv7 target this time, but the deployment on the physical device stops with this error :

sfdk: [I] Options from environment: -c target=SailfishOS-5.1.0.11-armv7hl
sign_and_send_pubkey: signing failed for RSA “[user]@[pc]” from agent: agent refused operation
Permission denied, please try again.
Permission denied, please try again.
defaultuser@192.x.x.24: Permission denied (publickey,password).
Fatal: Failed to establish connection between the build engine and the device. Please consult the FAQ https://docs.sailfishos.org/Tools/Sailfish_SDK/FAQ/.

The key was deployed successfully, all connection tests working, and I’ve used my time for this session, so may come back to this error later.

Does Sailfish recommend a specific OS for the IDE to work ? Is the installer open source? It would help to understand what is going on.

As another data point, I’m also running the IDE and the emulator on Arch and were also getting:

ssh: connect to host 10.220.220.1 port 22: Connection timed out
Fatal: Failed to establish connection between the build engine and the device. Please consult the FAQ https://docs.sailfishos.org/Tools/Sailfish_SDK/FAQ/.

For me this was fixed by

sudo modprobe ip_tables iptable_nat

that was needed because these modules were not loaded by default, and they were required for the Docker container to set up iptables so that 10.220.220.1 inside the container was translated to the emulator IP.

Yes, this worked exactly one time for me. It seems the install can break one way or another, if the stars do not align, and force you into a complete reinstall.
What may (or may not) break the system :

  • starting the dockers in the wrong order
  • trying to build stuff when the dockers are not started (they are auto-started in this case)
  • sneezing… well this one is because I was not able to understand what’s going wrong, and 10h of installing an IDE was my limit of wasting my free coding time.

I’ve seen some comments of coders who chose to not use the IDE at all, maybe that’s the best solution.

Do you know if someone has ever published a walktrough post explaining how to not use the SDK, but a different IDE with Podman or Docker? I am literally wasting a lot of hours trying to setup a nice development environment that does not break or that is not fucking up the system with a lot of dependencies

Unfortunately not. I also haven’t found anything on using the CLI for the compile/test/run/build loop. I have no idea how some people seem to have gained magical knowledge of the system, but would love to know.

1 Like

I’m probably wrong, but this may help you: Rust Howto (Request) - #19 by rubdos