Programming cover.png

Setup ctrlX AUTOMATION Development Environment using VirtualBox

CodeShepherd
Community Moderator
Please see the latest instruction always in the SDK:
...\com.boschrexroth.sdk.control-x.x.x\public\site\setup_windows_virtualbox_ubuntu.html


Overview

This guide shows how to use an Ubuntu Desktop running in a virtual machine using the ORACLE VM VirtualBox on a Windows 10 host system as an development environment to develop ctrlX AUTOMATION Apps. It allows you to experience a native linux development environment an to e.g. use Visual Studio Code as your IDE. This setup gives you a seamless development environment for Linux applications when you don't have the possibility to setup a native Linux Operating System on your PC (e.g. if you are in a Windows based corporate network).

Prerequisites
  • You need to have admin rights on your Windows system to be able to install the software.
  • Windows 10 with all updates.

Install ORACLE VM VirtualBox (others, eg. VM Ware, are possible as well)

Note: As Bosch Employee install VirtualBox via the IT Workplace Toolkit

Setup Virtual Machine and install Distribution (Ubuntu 18.04)

Once installed you need to setup a new virtual machine to host your Ubuntu Desktop guest system. For the installation of the Ubuntu Operating System, you need to download an iso-Image. It is recommended to use Ubuntu Desktop 18.04 LTS from here: https://releases.ubuntu.com/18.04.4/

Get your virtualization ready

Create a virtual machine running the Ubuntu, recommendation:

  • min 8 Gb Ram
  • min 15 Gb Disk, VDI Type
  • all processors
  • insert Ubuntu *.iso into virtual CD Drive
  • Map free Internet connection via network settings (Adapter 1, Bridged Adapter)
  • Map real/virtual control via network settings (Adapter 2, Bridged Adapter)
  • Start machine and follow installation instructions
  • Install Virtual Box GuestAdditions
  • Configure IP Address to connect to your control


 

Setup Corporate Proxy for an Internet connection to your VM (Optional)

If you are in a corporate environment which uses a http-Proxy, then you may want to set the proxy configuration to be able to download software from within your distribution. For this you want to run a proxy on your Windows environment and redirect the distribution to this proxy running on localhost. If you are directly connected to a router or the Internet, then this step can be skipped. A recommended proxy program to be used on your Windows host system is https://github.com/genotrance/px.

To set the environment variable in the distribution use:

  • sudo nano /etc/environment

Add the following variables:

You need to set this configuration also for wget.

  • sudo nano /etc/wgetrc

Search for the http proxy settings and make sure you configure:

Note: It could be necessary to add an firewall exception on your host system for the px-proxy!

Setup Packages

You might want to update your distribution and install essential packages for development.

sudo apt update
sudo apt upgrade
sudo apt install ssh zip unzip git curl cifs-utils apt-transport-https ca-certificates openssh-client

The following packages are needed for software development of ctrlX AUTOMATION apps.

sudo apt install crossbuild-essential-arm64 cmake snapcraft gcc gdb

Dependencies for Crossbuild (Multiarch)

Multiarch lets you install library packages from multiple architectures on the same machine. This is useful in various ways, but the most common is installing 64 and 32-bit software on the same machine and having dependencies correctly resolved automatically. In our way we use multiple architectures. In general you can have libraries of more than one architecture installed together and applications from one architecture or another installed as alternatives. Additional information can be found here Multiarch.

Be sure that apt can connect to the Internet.

Run the commands below as root user:

sudo dpkg --add-architecture arm64
sudo sh -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ bionic main restricted universe" >> /etc/apt/sources.list.d/multiarch-libs.list'
sudo sh -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates main restricted universe" >> /etc/apt/sources.list.d/multiarch-libs.list'
sudo apt-get clean
sudo apt-get update

After apt-get update you might get some warnings like: Failed to fetch http://de.archive.ubuntu.com/ubuntu/dists/bionic/universe/binary-arm64/Packages. To avoid it add the vendor with the host architecture [arch=i386,amd64] to your sources list /etc/apt/sources.list.

For example: deb [arch=i386,amd64] http://de.archive.ubuntu.com/ubuntu/ bionic main restricted

Now it is possible to download packages for other architectures. For building the examples you need to install additional libraries

sudo apt-get install libsystemd-dev:arm64
sudo apt-get install libsystemd-dev:amd64
sudo apt-get install libssl-dev:amd64
sudo apt-get install libssl-dev:arm64
 
Install Visual Studio Code

Install Visual Studio Code on your windows environment as described here: https://code.visualstudio.com/ Or use the integrated software downloader of Ubuntu.

 
Setup VSCodeSetup VSCode
Install the SDK

Copy the complete contents of this SDK into your Ubuntu Desktop system. It is recommended to copy the SDK to the home directory of your user.

 

Related links

Must Read

5 Comments
Lilith
Member

Thanks for the updated documentation.

Is it possible to give some more details regarding how the proxy needs to be set in case of a corporate network? for instance what settings are the absolute necessity (in the px app) to be able to get the communication between the Ubuntu virtual machine and the windows host.

Is the 10.0.2.2 always the address for the Windows host

Thanks in advance

CodeShepherd
Community Moderator

Instruction updated to the lates version.

CodeShepherd
Community Moderator

The settings you see in this documentation are for the linux system to get access to the px-proxy. The ip and port are given by the proxy itself.

The further settings of the proxy are very network specific and depending on your local IP infrastructure. So it is not possible to tell a standard solution here.

st_ctrlX_user
Established Member

I tried to change the  Multiarch.. file regarding your entry:To avoid it add the vendor with the host architecture [arch=i386,amd64] to your sources list /etc/apt/sources.list.

It's just a read-only file. How to change this ?

Another question: You wrote: Run the commands as root user. When installing the linux system on the VirtualBox I just put one user (as you boschrexroth) then this is the root user, or ?

Regards, Stefan

CodeShepherd
Community Moderator

In Linux a user that is working on the system is a standard user that can be changed to a  "super user" or "root user".

To use super user rights you write "sudo" infront of your commands. When your user is in the super user list the rights will be granted.

To switch to root user rights you write "sudo su" "sudo -s" as a single command. When your user is in the root user list the user will be changed.

Also to change the /etc/apt/sources.list list, like mentioned in the instruction, you have to be a root user to get write access.

Trending

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist