Local control of your BBB should always be supplemented with the ability to control it remotely. There are a variety of reasons you may want to do this. For example, you may want to operate the device from one location while you are in another location.
The primary and most typical reason for remote access, however, is to run the board headlessly. This means running it without a display, keyboard, or mouse. Headless control is, in fact, the way I operate the board about 99 percent of the time. I rarely even use an external monitor with the BBB since it requires fewer pieces of hardware and reduces headache.
There are two basic recipe types for remote usage:
Using SSH (secure shell) on a desktop PC or other client will give you control over your BBB across a network. Here is the recipe.
On your BBB:
~$ sudo ifconfig
etho0
, look for inet addr: xxx.xxx.xxx.xxx
.On your PC/Mac/Linux box:
~$ ssh-keygen -R <your_ip_address>
/Users/username/.ssh/known_hosts updated. Original contents retained as /Users/ username/.ssh/known_hosts.old username@hrh:~$
username@devicename:~$ ssh debian@<your_ip_address>
The authenticity of host '<your_ip_address> (<your_ip_address>)' can't be established. RSA key fingerprint is 97:b4:04:f5:24:f3:75:f9:90:3c:cc:ff:78:36:f3:d9. Are you sure you want to continue connecting (yes/no)?
yes
(no quotes, all lowercase).Warning: Permanently added '<your_ip_address>' (RSA) to the list of known hosts. debian@<your_ip_address>'s password:
temppwd
).debian@beaglebone:~$
Congratulations! You've now gained control over your BBB using the command line from another box.
So, are you still not entirely comfortable with the command line and want access to some of the GUI-based tools? Or, do you need to test and control using an actual GUI? Or, perhaps, is your app not running properly from only the command line? Then, it's time for VNC.
Virtual Network Computing (VNC) allows remote access to a device that's running an X session or windows/GUI-based system from a remote device or client machine. With the current Debian distribution, running VNC is easier than ever as the BBB arrives preloaded with the relevant package, the TightVNC server. On your client box, you need to install a remote viewer.
For your client box, download and install one of the following remote viewer applications:
Once again, we're cooking up a recipe from a Mac perspective, so VNC Viewer it will be.
As noted, the BBB now comes with the remote server installed, so the only new installation required is the one for your client box. For this, perform the following steps:
$ vncserver
New 'X' desktop is beaglebone:1
You will now be logged in to your BBB, be able to see the desktop, and have full control over the device using the mouse on your client box.
ifconfig | grep inet
sudo nmap -sn -PE 192.168.1.0/24
(with the IP address of the host machine and then /xxx
from the end range shown in Step 1).18.191.234.62