Cannot connect cyber ops workstation vm to internet - virtual-machine

My stuff include:
mac os with Mojave OS,
vmware Fusion 11,
cyberops workstation as virtual machine.
After installing cyberops vm using vmware fusion 11, I tried to connect the vm to the internet but it doesn't work. I am using wifi on my mac to connect the internet ant it works fine. please help

Try the following:
Open the terminal and type in
$ sudo systemctl start dhcpcd#ens33.service
$ sudo systemctl enable dhcpcd#ens33.service
where ens33 stands for the name of your NIC (you can find the name using the ip address command. If the name is different in your setup you have to change it in the command to yours)

Related

VS Code Remote SSH

I installed the Microsoft Remote - SSH extension and I am unable to SSH to an Ubuntu computer. I can SSH to the computer via putty no problem so I know it can do it. After selecting the extension in the bottom left corner, I select Connect to host and enter username#10.1.2.5. I'm then prompted to choose Linux, Windows or macOS and after I select Linux I receive the following error:
An SSH installation couldn't be found.
It doesn't matter what OS I select, they all give the same error. Below is the SSH client and server installed on the computer.
openssh-client/focal-updates,now 1:8.2p1-4ubuntu0.4 amd64 [installed,automatic]
openssh-server/focal-updates,now 1:8.2p1-4ubuntu0.4 amd64 [installed]
What am I missing?

EtherCAT with SOEM on WSL Ubuntu 18

Has anyone ever tried connecting to an EtherCAT device via SOEM in WSL linux?
While TwinCAT successfully connects to my Maxon EPOS4 and moves a DC motor on my laptop under Windows 10 using RT-Ethernet Intermediate Driver, SOEM slaveinfo returns no slaves found on eth0 under WSL.
Ps. I use an ethernet to usb-c LAN adaptor with my laptop, automatic IP address, Ubuntu 18.04 on WSL 2 with Hyper-V installed, and tested turning off my windows firewall too. I have not used SOEM under windows yet due to compile issues. Initially, I had no socket found on eth0 issue, but it solved after installing hyper-V and upgrading my WSL current installation of Ubuntu-18.04 to WSL 2.
I have the same issue under WSL Ubuntu 20, when the firewall is deactivated, if I disable all TwinCAT services and uninstall the TwinCAT items from the Ethernet Properties window!
Here is what I do and the outputs:
$ sudo setcap cap_net_raw+ep /opt/ros/melodic/bin/slaveinfo
$ sudo /opt/ros/melodic/bin/slaveinfo
SOEM (Simple Open EtherCAT Master)
Slaveinfo
Usage: slaveinfo ifname [options]
ifname = eth0 for example
Options :
-sdo : print SDO info
-map : print mapping
Available adapters
Description : lo, Device to use for wpcap: lo
Description : bond0, Device to use for wpcap: bond0
Description : dummy0, Device to use for wpcap: dummy0
Description : eth0, Device to use for wpcap: eth0
Description : sit0, Device to use for wpcap: sit0
End program
$ sudo /opt/ros/melodic/bin/slaveinfo eth0
SOEM (Simple Open EtherCAT Master)
Slaveinfo
Starting slaveinfo
ec_init on eth0 succeeded.
No slaves found!
End slaveinfo, close socket
End program
Can you elaborate on your Ethernet controllers? Do you have the one USB-C adapter setup with TwinCAT and the RT-Ethernet driver? If so, I would expect that SOEM running in Ubuntu under WSL does not have access to this controller.
I would test on a system without TwinCAT installed, or rollback the TwinCAT RT-Ethernet driver installation so that the Ethernet controller is available to Windows and presumably WSL. Or can you have an additional adapter that isn't available to TwinCAT?
For me on windows eth0 would not work for epos4. I had to write getmac in a console and copy the line
\Device\Tcpip_{------- copy this part ------}.
Then in my code i would write
init_comm("\\Device\\NPF_{--- your copied part ---}");

Docker for Windows with existing hyper-v virtual machine

I have the following setup:
A Windows 10 Pro Laptop ("Win10Laptop") that has a Windows 10 Pro VM ("Win10VM") running on Hyper-V. I have created an nginx container by running the following command on the host machine:
docker run -d -p 80:80 --name webserver nginx
While the container is running I can access http://localhost from Win10Laptop and this works fine. My question is what do I need to configure to access nginx from Win10VM? Win10VM has only one network adaptor which is configured to use the "External" Vswitch connected to my Wifi interface.
Let me know if you need any more details. I've tried all sorts and can't figure it out!
Thanks,
Michael
You need to connect to the IP the VM has acquired on the External switch. Run ipconfig inside the VM to see what IP it has, then open http://<vm-ip> from your host.

how to assign static ipaddress (fixed ipaddress) in vmware workstation

Iam using vmware workstation12. I have a 2 vm and I installed Ubuntu in it.
The ip address changes automatically in the ubuntu.Last week the IPADDRESS in the first vm was 192.168.56.1 and in the second vm was 192.168.56.2.
But today I got changed to 192.168.56.3 and 192.168.56.4.
Because of this change I need to change lot of thing in my hadoop setup like ssh and name node configuration and lot of things.
Please help me to assign fixed ipaddress to vm.
This article would help: https://communities.vmware.com/message/1888335
So, basically, it tells you how to configure the DHCP service for VMWare to mapping IP address with MAC address of the guest VM, therefore the guest VM will always been assigned with the IP address you've specified.
It is like adding this section to the end of vmnetdhcp.conf file (On the host Windows machine. For other OS, such as VM Fuse on macOS or VMWare on Linux or ESXi, the file name/path could be varial, but the setting are expect to be similar):
host Win81x86A {
hardware ethernet 00:0C:29:56:4F:A9;
fixed-address 192.168.213.10;
}
In addition to this, which the article didn't introduce, there's other steps if it doesn't take effect (On Windows):
Make sure you've configured the right configuration file. On Windows, Config the configuration file:
%%ALLUSERDATA%%\Vmware\vmnetdhcp.conf
Stop the "VMware DHCP Service" and "VMware NAT Service".
Clean up the ".leases" file:C:\ProgramData\Vmware\vmnetdhcp.leases
Restart the "VMware DHCP Service" and "VMware NAT Service"
Start VMWare and run the VM. Or, if already running, issue a DHCP renew command (Linux: sudo dhclient -rv; sudo dhclient -v)
It should be working now.

How can I connect to a Google Compute Engine virtual server with a GUI?

I am testing a Google Compute Engine, and I created a VM with Ubuntu OS. When I connect to it, by clicking this Connect SSH button, it opens a console window.
Is that the connection you get?
How do I open a real screen with a GUI on it? I don't want the console.
Much better solution from Google themselves:
https://medium.com/google-cloud/linux-gui-on-the-google-cloud-platform-800719ab27c5
You need to forward the X11 session from the VM to your local machine. This has been covered in the Unix and Linux stack site before:
https://unix.stackexchange.com/questions/12755/how-to-forward-x-over-ssh-from-ubuntu-machine
Since you are connecting to a server that is expected to run compute tasks there may well be no X11 server installed on it. You may need to install X11 and similar. You can do that by following the instructions here:
https://help.ubuntu.com/community/ServerGUI
Since I have needed to do this recently, I am going to briefly write up the required changes here:
Configure the Server
$ sudo vim /etc/ssh/sshd_config
Ensure that X11Forwarding yes is present. Restart the ssh daemon if you change the settings:
$ sudo /etc/init.d/sshd restart
Configure the Client
$ vim ~/.ssh/config
Ensure that ForwardX11 yes is present for the host. For example:
Host example.com
ForwardX11 yes
Forwarding X11
$ ssh -X -C example.com
...
$ gedit example.txt
Trusted X11 Forwarding
http://dailypackage.fedorabook.com/index.php?/archives/48-Wednesday-Why-Trusted-and-Untrusted-X11-Forwarding-with-SSH.html
You may wish to enable trusted forwarding if applications have trouble with untrusted forwarding.
You can enable this permanently by using ForwardX11Trusted yes in the ~/.ssh/config file.
You can enable this for a single connection by using the -Y argument in place of the -X argument.
These instructions are for setting up Ubuntu 16.04 LTS with LXDE (I use SSH port forwarding instead of opening port 5901 in the VM instance firewall)
1. Build a new Ubuntu VM instance using the GCP Console
2. connect to your instance using google cloud shell
gcloud compute --project "project_name" ssh --zone "project_zone" "instance_name"
3. install the necessary packages
sudo apt update && sudo apt upgrade
sudo apt-get install xorg lxde vnc4server
4. setup vncserver (you will be asked to provide a password for the vncserver)
vncserver
sudo echo "lxpanel & /usr/bin/lxsession -s LXDE &" >> ~/.vnc/xstartup
6. Reboot your instance (this returns you to the Google cloud shell prompt)
sudo reboot
7. Use the google cloud shell download file facility to download the auto-generated private key stored at $HOME/.ssh/google_compute_engine and save it in your local machine*****
cloudshell download-files $HOME/.ssh/google_compute_engine
8. From your local machine SSH to your VM instance (forwarding port 5901) using your private key (downloaded at step 7)
ssh -L 5901:localhost:5901 -i "google_compute_engine" username#instance_external_ip -v -4
9. Run the vncserver in your VM instance
vncserver -geometry 1280x800
10. In your local machine's Remote Desktop Client (e.g. Remmina) set Server to localhost:5901 and Protocol to VNC
Note 1: to check if the vncserver is working ok use:
netstat -na | grep '[:.]5901'
tail -f /home/user_id/.vnc/instance-1:1.log
Note 2: to restart the vncserver use:
sudo vncserver -kill :1 && vncserver
***** When first connected via the Google cloud shell the public and private keys are auto-generated and stored in the cloud shell instance at $HOME/.ssh/
ls $HOME/.ssh/
google_compute_engine google_compute_engine.pub google_compute_known_hosts
The public key should be added to the home/*user_id*/.ssh/authorized_keys
in the VM instance (this is done automatically when you first SHH to the VM instance from the google cloud shell, i.e. in step 2)
you can confirm this in the instance metadata
Chrome Remote Desktop allows you to remotely access applications with a graphical user interface from a local computer or mobile device. For this approach, you don't need to open firewall ports, and you use your Google Account for authentication and authorization.
Check out this google tutorial to use it with Compute Engine : https://cloud.google.com/solutions/chrome-desktop-remote-on-compute-engine