Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Regular Contributor
Posts: 94
Registered: ‎12-02-2011
My Device: non-Blackberry user
My Carrier: none

Basic question on how to ssh to simulator 2.0 beta

I've downloaded the Playbook simulator.  and have it up and runing on ubuntu.  I want to ssh into it but am perpleaex as to what the user name and password is.  Also when I go to dev mode it wants to use an ip address of (Develment address) 169.254.x.x  The virtualbox is using an ip of 192.168.

 

One other question, is there a xterm on console for the simulator ?

 

 

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Basic question on how to ssh to simulator 2.0 beta

SSH to the sim the same way you do to the tablet.

Run blackberry-connect to start the daemon and open the port. Connect as "devuser" with the private key loaded that matches the public key blackberry-connect was pointed at.

If any of that isn't clear, search the forums or google for past discussions, as there's nothing special or new about doing this with the sim.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Retired
Posts: 20
Registered: ‎10-27-2010
My Device: Bold 9800

Re: Basic question on how to ssh to simulator 2.0 beta

On the simulator, you can ignore the widget on the settings page that allows you to enter a 169.254.x.x IP. This is only used on the device for USB.
The address you use to connect to your simulator is the one that appears in the bubble when clicking on the development mode icon (developer with a gear) in the tray.
On a somewhat related note, you can connect via ssh to your simulator (or device) directly using the IDE. Once you've created a target in the Target Navigator view for your simulator (or device), a connected target implies that the blackberry-connect connection has already been established for you. From there you can right click on a target and select "Launch SSH Session".

Q-T wrote:

Also when I go to dev mode it wants to use an ip address of (Develment address) 169.254.x.x  The virtualbox is using an ip of 192.168.


 

Regular Contributor
Posts: 94
Registered: ‎12-02-2011
My Device: non-Blackberry user
My Carrier: none

Re: Basic question on how to ssh to simulator 2.0 beta

Thanks but what is blackberry-connect ? where is it. I do not have an actual playbook, I am a newbie looking at developing for Playbook. Is there a way to get an xterm on the simulator to start the ssh daemon ? First impressions of Blackberry NDK is that it seems overly complex. Will try to stay with it and see if I can over come all these lil paper cuts.

 

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Basic question on how to ssh to simulator 2.0 beta

blackberry-connect is one of many tools in the utilities folders of the SDKs, including the NDK. When you run it, the tablet or simulator will run the sshd daemon to allow connections. There is no other way to accomplish this, as you can't just run something like xterm (at least, not without doing this in the first place).

I'm sure the NDK is "overly complex", and nobody would disagree... it's still an early release and will improve over time. It's not, however, an insurmountable challenge for anyone capable of making C/C++ apps for a device like this.

There are also the WebWorks and AIR SDKs, however, if you'd like to try that route as well. The AIR SDK especially is more mature and broad than the NDK, so maybe that would be a better place to start.

All three use the blackberry-connect approach, as that's central to the architecture of the tablet and simulator as far as development support is concerned.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Regular Contributor
Posts: 94
Registered: ‎12-02-2011
My Device: non-Blackberry user
My Carrier: none

Re: Basic question on how to ssh to simulator 2.0 beta

When I run blackberry connect I just get the key to be sent and then it exits.  Here is the output

 

david@king:~/bbndk-2.0.0-beta1$ blackberry-connect  192.168.10.43
Info: Connecting to target 192.168.10.43:4455                                                                                                                           
Info: Authenticating with target 192.168.10.43:4455                                                                                                                     
Info: Encryption parameters verified                                                                                                                                    
Info: Sending ssh key to target 192.168.10.43:4455                                                                                                                      
Info: ssh key successfully transferred.                                                                                                                                 
Error: Connection refused: Unexpected command          

 

Sorry for all the trouble here.  Any advise is much appreciated

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Basic question on how to ssh to simulator 2.0 beta

Make sure you try forum searches for past threads with the key words... many of these sorts of things have been found and answered in the past.

In this case, one possibility is you have no comment at the end of the public key file, or you have a malformed comment. I don't recall specifics, but it can't contain spaces. Simplest is just something like "qt@myhost.com" (and even that exact text will probably work) so check that. I assume you correct generated a 4096-bit RSA key for this?

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Retired
Posts: 20
Registered: ‎10-27-2010
My Device: Bold 9800

Re: Basic question on how to ssh to simulator 2.0 beta

If you use the IDE and have already connected to a target, it will have already generated a compliant ssh key for you. The location can be identified by going to Window->Preferences->BlackBerry Tablet OS->Targets->Target Connection SSH Key.

 

You can pass this path (with .pub suffixed) to the -sshPublicKey option of blackberry-connect.

 

As Peter mentioned, if you aren't using the IDE you need to generate a 4096-bit RSA SSH key that has no comments other than an email address.

Regular Contributor
Posts: 94
Registered: ‎12-02-2011
My Device: non-Blackberry user
My Carrier: none

Re: Basic question on how to ssh to simulator 2.0 beta

Never could get it to work. I wiped out everythinng in .rim and started over.  Seeing how its BB tools that write and read the key files you'd think it could get the parsing right.  Wanted to port a nice QT app I have running but guess will have to wait for the finial release.

 

My advise to RIM sdk maintainers: For the simulator have the sshd enabled by default. Use static IP addresses, and make this all brain dead easy so it works first time every time.    

 

Also I like command line tools, and don't want to mess with Eclippse, the   bbndk-env.sh is all I want, please make command line tool compilation a first class citizen if it isn't already.  In my book Eclippse is just awful. 

 

To those that tried to help thanks again for your time.

Retired
Posts: 99
Registered: ‎10-03-2009
My Device: Not Specified

Re: Basic question on how to ssh to simulator 2.0 beta

I captured and expanded slightly what Peter, Elena and others described here and in related threads into

http://openbbnews.wordpress.com/2011/12/21/devuser-and-1000/