Replace some of the software tools integrated in the Linux minimal image with more complete equivalents

Hi,

I want to change the SSH server (dropbear I think) by a more complete version (openssh ?) because Visual Studio can’t connect to my board via SSH so I can’t attach to a particular process (a C# Core program) to debug it.

Otherwise, is it possible to change busybox by GNU coreutils ?

Thanks.

Hi @embeddedmz, how are you?

Toradex Reference Minimal Image loads the package-group-basic.bb from OpenEmbedded. You can find here the reference file for this package: packagegroup-basic.bb\packagegroups\recipes-core\meta-oe - meta-openembedded - Collection of OpenEmbedded layers. On line 16, they state the ssh package used and tell you how to change it to OpenSSH. Could you please give it a try?

Do you get any error log from the connection attempt on Visual Studio?

Best regards,

Hi @gclaudino.tx I’m fine thanks.

With dropbear, we get “Unknown error: 0x80004005” on Visual Studio c# - Visual Studio remote debugging (ssh) on linux OS (buildroot)? - Stack Overflow whereas with OpenSSH, we get “SSH key exchange validation failed” (translated from french).

Hi @embeddedmz,

Thanks for the update. Just as a sanity check that it’s not a problem with our image, are you able to connect through SSH from outside VS Studio?

Is this the whole log that you get when you try to connect through ssh? If there is more information you can send it to us even if it’s in french. I’ll also try to check with our team what has been done in TorizonCore to connect the modules to Visual Studio to see if there is any other configuration trick. I’ll come back to you soon.

Best regards,

I can connect to the SoM with MobaXterm.

I thought maybe it was the way SSH connections are handled that was causing the problem with Visual Studio 2019 so I disabled and stopped the systemd socket related to sshd (sshd.socket) and created a SSHD service but the daemon fails to launch (/usr/sbin/sshd fails at startup with error 255).

[Unit]
Description=OpenBSD Secure Shell server
Wants=sshdgenkeys.service
After=sshdgenkeys.service

[Service]
Environment="SSHD_OPTS="
EnvironmentFile=-/etc/default/ssh
ExecStart=/usr/sbin/sshd -i $SSHD_OPTS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=notify

[Install]
WantedBy=multi-user.target

Hi @embeddedmz,

After discussing with the team it seems that this problem seems to be related to the Visual Studio configuration and not to the module as you’ve been able to properly generate an image with OpenSSH, right?

Can you please share with us the exact steps that you followed trying to connect to your module on VisualStudio with SSH?

In addition, we’ve found a few links that may give you a hint on what should be done:

If you run ssh -Q key on your module you can see the key types available and maybe you could connect with a key also.

We have on our side, for instance, the VisualStudio extension for TorizonCore projects that is able to connect to the modules through SSH and our extension automatizes the steps to do so.

Now, I have the error message Unhandled operation : 0x800004005 so it’s not related to dropbear.

If you run ssh -Q key on your module you can see the key types available and maybe you could connect with a key also.

With the Toradex Linux minimal image that uses OpenSSH, I don’t have the command ‘ssh’

Can you please share with us the exact steps that you followed trying to connect to your module on VisualStudio with SSH?

In Visual Studio : Debug → Attach to a process → Set the connection type to SSH and in the target field enter the SoM address (e.g. root@192.168.0.101). For the first connection, a dialog box will show up so we can enter the password, then we should see the list of the SoM’s processes.

Since the Linux minimal image has a minimalistic “ps” command which accepts no argument, I think the problem comes from there : VS runs a “ps” with several arguments (e.g. aux) to get the process list but the ps returns an error.

That’s why I would like to know if it is possible to change the programs provided by BusyBox by more complete equivalents (ps, cp, etc…).

Hi @embeddedmz,

You can always add any package that you want to your custom image with Yocto, like you’ve done before for ppp. BSP 5 is based on Yocto Dunfell so if you need any package that is not available by default on the layers that you get when you do a repo sync, you can look for specific packages for this version of the Yocto Project here: https://layers.openembedded.org/layerindex/branch/dunfell/layers/

Did you consider, however, using TorizonCore for your project? Its extension may help you set this up. You can also check this page: Build TorizonCore from Source With Yocto Project/OpenEmbedded | Toradex Developer Center and see how the packages and which packages are added to the yocto image.

Best regards,

We can’t use Torizon, since we will be using an i.MX6 Toradex SoM that can’t run Torizon (probably because there’s not enough RAM memory on it).

The problem is not that I am missing a program, but that I would like to replace some programs (like dropbear by openssh, that I learned to do) like ps for example or cp and I don’t know how to tell Yocto/OpenEmbdeed to use for example GNU coreutils instead of busybox. At the moment, I’d like to replace “ps” with a more complete alternative (same command but a more complete software) so I think Visual Studio will be able to attach itself to my process. I hope that you can help me.

Hi @embeddedmz,

Thanks for updating. As your post tags the Apalis iMX6 I think that there may be a misconception as every Apalis iMX6 module supports TorizonCore. NXP/Freescale i.MX 6 Arm based Computer on Module - Apalis iMX6

If you wish, we can try to arrange a short call with you to discuss how to change Yocto packages and talk about your goal to understand how we can support you better.

Is the mail that you use in the community the best one to reach you?

Best regards,

1 Like

Yes, you can contact me by mail.

Thanks.