Store PLCnext CommunityPLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

How to create a Linux Virtual Machine

Software development kits are available for Windows as well as for Linux for PLCnext Technology.

Additionally, all controllers based on PLCnext Technology use Linux as their operating system.

Although expertise in Linux is not required for operating a PLCnext Technology controller, Linux functions can however be used on a PLCnext Technology controller.

This manual should help to ease the entry into the world of Linux and explain step-by-step how a Linux installation is set up.

All Linux-related examples for PLCnext Technology are based on this reference installation. This allows users to precisely understand and follow each step.

The reference installation and instructions serve only as a recommendation. Other Linux distributions can of course be used.

Many users in automation technology use virtual machines (VM) to emulate a wide range of different operating systems and development interfaces. For this reason, the installation of a Linux virtual machine is also explained in these instruction.

Requirements for the installation

Required software

Optional software

Linux virtual machine with VM Ware Workstation

Preparing the virtual machine

Start the VM Ware Workstation® and create a new virtual machine (VM) with advanced options.

Figure 1 Creating a new virtual machine

 

Select the following options:

  • Hardware compatibility : Workstation 12.0
  • The operating system is loaded later.
  • Linux - Ubuntu 64bit


Specify the directory as well as the name of the VM. In this example the virtual machine is called "VM-Xubuntu-CCAX-PLCnext-TEAM".

Figure 2 Specifying the VM name and the storage location
​​

The settings of the processor cores and main memories used depend on the performance of the host systems and influence the performance of the VM.
Phoenix Contact recommends using at least 2 processor cores and 2 GB RAM.
​​

Since all network settings are carried out later, select "Do not use a network connection".

Figure 3 Network Wizard


Follow the recommendations of the Wizard when selecting the I/O Controller and the disk settings.

​​

Xubuntu installation

Since the prepared virtual machine (VM) is not yet provided with an operating system, the Xubuntu Image ("xubuntu-16.04.1-desktop-amd64.iso") needs to be mounted onto the CD-Rom drive now.

Figure 4 Integrating the .ISO with the virtual drive of the VM

​​

After the VM has been started, the installation routine of Xubuntu appears immediately.

Select the desired language and start the installation with the option "Install Xubuntu".

Figure 5 Installation routine of the Linux Distribution

 

Follow the next steps and the preset recommendations until you need to create a user.
At this point, you can select any user name including password.

The following user is used in this example:

Computer name:  ccaxteam-plcnext-vm
User name:  ccax-team-user
Password:  ccax-team-pw

The user created here is automatically a user of the Sudo group and can therefore carry out commands with root rights.

Figure 6 Creating the computer name / user name and the root password


The installation is now carried out and the system is then rebooted.
In order for that to happen, the image needs to be removed from the virtual drive.

 

3.3 Setting up the network

In a virtual machine, the network settings need to be made to match the actual components used by the host system. These can vary from system to system.

The following example is based on a reference environment of Phoenix Contact and serves to show the configuration as an example.

​​

Note:
The following Section assumes in-depth knowledge of Ethernet network configuration.

 

Network configuration for a VM Ware Workstation

Depending how the the network adapters in the VMware Workstation® are set and which network the Xubuntu® VM should access,
settings need to be made in the "Virtual Network Editor" in the VM Ware Workstation.

"Edit" =>"Virtual Network Editor"

The adapters shown here are available for the VM Ware Workstation®.

Here is an example of the configuration:

Figure 7 Settings of the network adapter within VMware 12

​​

VMnet0 - external network card; this is connected with an AXC F 2152.

VMnet1 - internal network card of the notebook; this is connected to the Internet.

VMnet2 - internal WLAN network card of the notebook

​​

In order to be able to establish communication from the virtual machine and the host, two network cards need to be integrated in the hardware configuration of the VM created.

In this example, the setting is as follows:

Network Adapter - Bridged VMnet0
Network Adapter 2 - Bridged VMnet1
​​

Figure 8 Virtual Machine Settings: adding network adapters

​​

Network setup under Linux

As soon as the network adapters have been assigned in settings of the VM, they can be used and configured within the virtual machine.

Many of the necessary configuration steps need to be carried out in the terminal.

Figure 9 Terminal

​​

The network adapters currently set up can be displayed using the command "ifconfig" or "ip addr".

In the example:

lo : loopback for local host

ens37: network adapter for VMnet0

ens38: network adapter for VMnet1