CODESYS Virtual Control for LINUX

Hello

I downloade the codesys virtual controll for linux.
I have tride with a user with sudo rigths and root user.

I have tride to follow the online help

I have communication with the PLC and have installed the docker image
Docker_codesyscontrol_virtuallinux_4.12.0.0_amd64.tar.gz



The docker image is running


I have set the port 11740 to be forwarded.
see help page: Establishing a Connection to an Instance

But when I try to connect I can’t connect to codesys on the wago edge computer.

I ssh inn to the computer and look if there could be a fireware.

root@testEdgeEKB:~# netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:44323           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:44322           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:44321           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:11740           0.0.0.0:*               LISTEN
tcp        0      0 100.91.96.55:55019      0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:4330            0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:42821         0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:9443            0.0.0.0:*               LISTEN
tcp6       0      0 :::44323                :::*                    LISTEN
tcp6       0      0 :::44322                :::*                    LISTEN
tcp6       0      0 :::44321                :::*                    LISTEN
tcp6       0      0 ::1:25                  :::*                    LISTEN
tcp6       0      0 :::11740                :::*                    LISTEN
tcp6       0      0 :::9090                 :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 :::4330                 :::*                    LISTEN
tcp6       0      0 fd7a:115c:a1e0::b:64909 :::*                    LISTEN
tcp6       0      0 :::9443                 :::*                    LISTEN
udp        0      0 0.0.0.0:41641           0.0.0.0:*
udp6       0      0 :::41641                :::*
root@testEdgeEKB:~#
root@testEdgeEKB:~#  iptables -L -v -n --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1     255K  314M ts-input   0    --  *      *       0.0.0.0/0            0.0.0.0/0

Chain FORWARD (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1     1301 1041K DOCKER-USER  0    --  *      *       0.0.0.0/0            0.0.0.0/0
2     1301 1041K DOCKER-ISOLATION-STAGE-1  0    --  *      *       0.0.0.0/0            0.0.0.0/0
3      677  487K ACCEPT     0    --  *      docker0  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
4       13   684 DOCKER     0    --  *      docker0  0.0.0.0/0            0.0.0.0/0
5      611  553K ACCEPT     0    --  docker0 !docker0  0.0.0.0/0            0.0.0.0/0
6        0     0 ACCEPT     0    --  docker0 docker0  0.0.0.0/0            0.0.0.0/0
7        0     0 ts-forward  0    --  *      *       0.0.0.0/0            0.0.0.0/0

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination

Chain DOCKER (1 references)
num   pkts bytes target     prot opt in     out     source               destination
1        4   208 ACCEPT     6    --  !docker0 docker0  0.0.0.0/0            172.17.0.2           tcp dpt:9443
2        1    52 ACCEPT     6    --  !docker0 docker0  0.0.0.0/0            172.17.0.3           tcp dpt:11740

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
num   pkts bytes target     prot opt in     out     source               destination
1      611  553K DOCKER-ISOLATION-STAGE-2  0    --  docker0 !docker0  0.0.0.0/0            0.0.0.0/0
2     1301 1041K RETURN     0    --  *      *       0.0.0.0/0            0.0.0.0/0

Chain DOCKER-ISOLATION-STAGE-2 (1 references)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 DROP       0    --  *      docker0  0.0.0.0/0            0.0.0.0/0
2      611  553K RETURN     0    --  *      *       0.0.0.0/0            0.0.0.0/0

Chain DOCKER-USER (1 references)
num   pkts bytes target     prot opt in     out     source               destination
1     1301 1041K RETURN     0    --  *      *       0.0.0.0/0            0.0.0.0/0

Chain ts-forward (1 references)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 MARK       0    --  tailscale0 *       0.0.0.0/0            0.0.0.0/0            MARK xset 0x40000/0xff0000
2        0     0 ACCEPT     0    --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x40000/0xff0000
3        0     0 DROP       0    --  *      tailscale0  100.64.0.0/10        0.0.0.0/0
4        0     0 ACCEPT     0    --  *      tailscale0  0.0.0.0/0            0.0.0.0/0

Chain ts-input (1 references)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     0    --  lo     *       100.91.96.55         0.0.0.0/0
2        0     0 RETURN     0    --  !tailscale0 *       100.115.92.0/23      0.0.0.0/0
3        0     0 DROP       0    --  !tailscale0 *       100.64.0.0/10        0.0.0.0/0
4      862 88782 ACCEPT     0    --  tailscale0 *       0.0.0.0/0            0.0.0.0/0
5      633 37980 ACCEPT     17   --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:41641
root@testEdgeEKB:~#
root@testEdgeEKB:~# docker ps
CONTAINER ID   IMAGE                                  COMMAND                  CREATED         STATUS         PORTS                                                                        NAMES
9635b35c0eae   codesyscontrol_virtuallinux:4.12.0.0   "/opt/codesys/script…"   7 minutes ago   Up 7 minutes   443/tcp, 4840/tcp, 8080/tcp, 0.0.0.0:11740->11740/tcp, :::11740->11740/tcp   codesys
e1f829d35acf   portainer/portainer-ce:latest          "/portainer"             2 years ago     Up 23 hours    8000/tcp, 9000/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp                portainer
root@testEdgeEKB:~#
root@testEdgeEKB:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
2: X1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:30:de:47:05:d2 brd ff:ff:ff:ff:ff:ff
    altname enp1s0
3: X2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:30:de:47:05:d3 brd ff:ff:ff:ff:ff:ff
    altname enp2s0
    inet 10.20.27.207/24 brd 10.20.27.255 scope global dynamic noprefixroute X2
       valid_lft 46212sec preferred_lft 46212sec
    inet6 fe80::c63c:55b6:c370:9f77/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
4: tailscale0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1280 qdisc fq_codel state UNKNOWN group default qlen 500
    link/none
    inet 100.91.96.55/32 scope global tailscale0
       valid_lft forever preferred_lft forever
    inet6 fd7a:115c:a1e0::bd01:6037/128 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::c32b:351e:f9a0:a255/64 scope link stable-privacy
       valid_lft forever preferred_lft forever
5: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:fb:c2:c6:5b brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:fbff:fec2:c65b/64 scope link
       valid_lft forever preferred_lft forever
13: veth89efec6@if12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
    link/ether 62:b4:08:49:f0:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::60b4:8ff:fe49:f002/64 scope link
       valid_lft forever preferred_lft forever
21: vethc5894cf@if20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
    link/ether d6:de:fe:90:68:10 brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet6 fe80::d4de:feff:fe90:6810/64 scope link
       valid_lft forever preferred_lft forever
root@testEdgeEKB:~#

What can I try next? any tips on something I can try?

Espen

Have you deployed it from CODESYS, using the Deploy Control SL ?
You should install and deploy from there (no CLI docker commands are necessary)

By default the container is using host network, so you don’t need to forward any port.

Is it up and running ?

When you have solved your issue consider installing the vendorcheck, in order to use WAGO libraries on the Edge :

I’m trying to go through the entire installation of Codesys on the edge machine again. I’ve written everything step by step. However, I’m not able to establish a connection. Do you have any other tips I could try?

connecting to the plc

Install and Deploy image from codesys

add a new instance


image

Set to Autostart

start the instance
image

Runtimelog

Trying to connect.
Can’t find any device when searching

Trying with the IP adress of the wago edge computer

ssh to the edge computer is working

Hi Espen.

I tested and it works. Logged in as root when installing.

Package:

Instance (remember port setting):

The first time you log in a codesys runtime user has to be configured:


(Enter details in the next window after clicking YES.)

Online:

1 Like

try this:

1 Like

Hi @espenbo

Looks like you’re Using VPN?
Maybe the 11740 Port is not forwarded in your VPN Firewall?

I tried the Beta, and also the Releases 4.12 and 4.13 of the Virtual Control and the connection was never a Problem.

Did you tried it with a direct Connection to the Device via LAN?

You can also start the Container with network “host” like @quenorha did.
every NIC you add in the Parameter list will be linked directly into the Container and is not visible in the Host then.
At the first Start with the Virtual Control i locked myself out of the Edge Computer :smiley:

Hi,
I would recommend to add a virtual EdgeGateway Instance.
Start this and add a new Gateway in CODESYS …scan the virtual PLC by this new added Gateway.
For licensing it is mandatory to use 4.13.0.0 Version and add the license Server in the Host. (Use the CODESYS Installer to add the License Server Update command to your CODESYS Version)