Skip to content

Setting up a VM

Ricardo Padilha edited this page Mar 29, 2016 · 5 revisions

Tip: Instead of a full VM it is possible to cross-compile software for the Drobo using a Docker container. There are several versions of the container, including the basic compiler toolchain, a python cross-compiler, or a golang cross-compiler.

The easiest way to port apps to the DroboFS or Drobo5N is to have a virtual machine configured just for the purpose of cross-compiling. This avoids messing up the configuration of your own machine, and prevents undesired upgrades (which could break dependencies).

For this tutorial, we will use VirtualBox. Any other virtualization software can be used just as well.

The operating system chosen for the VM is Ubuntu 14.04.2 LTS 32-bit. The choice of 32-bit is necessary for the official toolchains to work.

Creating the VM

Tip: There is an official VirtualBox appliance available for cross-compiling. You can download the official ready-to-use VM here (866 MB) and skip the rest of these steps. Username is drobo, password is drobo.

The amount of resources given to the VM depends on your goal. The following recommendations aim to arebe minimal, and may not accomodate the compilation of very large applications.

  • RAM: 512 MB
  • Video Memory: 8 MB
  • Storage: 4 GB
  • Network: 2 adapters: one "NAT" (eth0), one "Host-only adapter" (eth1)

The first interface (eth0) gives the VM internet access. The second interface (eth1) gives an easy way to connect to the VM from the outside.

Perform an straight full disk install from the Minimal CD image, and make sure that the OpenSSH server is installed. Chose eth0 as the "primary network interface". Once the install is finished, remove the install CD image from the VM, and reboot.

Instead of a full disk install, it is possible to download a pre-installed image of Ubuntu from here. In that case, do not forget to sudo apt-get update; sudo apt-get upgrade before proceeding.

Log in using the VM console, edit /etc/network/interfaces, and add these two lines at the end:

auto eth1
iface eth1 inet dhcp

Save the file, and bring eth1 up: sudo ifup eth1

If everything went ok, the output of ifconfig should look like this:

$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 08:00:27:65:01:36  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe65:136/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14249 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3402 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:11899619 (11.8 MB)  TX bytes:186585 (186.5 KB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:c9:9c:0f  
          inet addr:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fec9:9c0f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11963 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6340 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1788542 (1.7 MB)  TX bytes:1633872 (1.6 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Notice that the IP address of eth1 is 192.168.56.101. From this point on, you can use a normal terminal/ssh client instead of the VirtualBox console. The main reason to do so is that the VirtualBox console does not allow copy and pasting. To access the VM via SSH, type in a Terminal window on your host machine:

ssh <username>@<ip.address.of.eth1>

Configuring the VM

The following packages are required, if they have not yet been installed:

sudo apt-get install autoconf autogen build-essential libtool pkg-config cmake bison flex cvs bzr git subversion

The following folder need to be created as well:

sudo mkdir -p /mnt/DroboFS/Shares/DroboApps
sudo chmod 777 /mnt/DroboFS/Shares/DroboApps
mkdir -p ~/bin ~/build ~/xtools/toolchain

The next step is to install the toolchain for the device(s) of your choice. You might also want to update git to the latest version.