Wsl2 VPN: Shell for UNKNOWN_VIRTUAL_ENVIRONMENT already activated - pipenv

I'm using wsl2 and I connect to my companies vpn using cisco client.
As wsl2 has known network issues with vpn cisco client, I installed wls vpn kit.
It works fine when I start my terminal after the vpn connection and I start the vpn kit.
Now I am running into problems with my pipenv.
When I execute pipenv shell, I got the following error:
Shell for UNKNOWN_VIRTUAL_ENVIRONMENT already activated.
No action taken to avoid nested environments.
When I do not activate the vpn kit, I can start my venv via pipenv.
So the problem must be related to wsl-vpn-kit.
Is there a way to start a pipenv shell while running the vpn kit?

Related

How to emulate screen on Windows VM in GCP for Electron app screenshare test?

Setup:
test framework around latest WebdriverIO v.7
Jenkins on GCP: master - Ubuntu, slave - Windows Server 2022 VM.
connection between Jenkins master and slave is done with GCP jenkins plugin, so Windows slave is being created for test and then dies.
app under test: Electron v14.2.1 based app.
Test - "User can start screenshare"
User start a call.
User select an available screen and start a screenshare.
Problem:
Electron library can not detect available screen for capturing and sreensharing, because there is no RDP connection opened in test session.
In test logs no sources (screen) found:
2022-08-01 07:40:20:409 -00:00 | info | main-api-handler: - open-screen-picker-window - Properties: {
"cmd": "open-screen-picker-window",
"id": 1,
"sources": []
}
Questions:
How can the screen be emulated?
Where the RDP should be established? Should it?
Are there other way than RDP to provide the screen for the Electron app?
The problem was solved by my colleague:
"So the root cause of this issue is that the SSH server which Jenkins uses to configure the node runs as a service, and that means it has problems interacting with desktop apps. Unfortunately, Windows' own SSH server only runs as a service. More explanations here: Starting GUI programs via OpenSSH on Windows?
To resolve this, I installed a separate SSH server (OpenSSH from MSYS2). The machine image is configured to autologin on boot, and sshd is started on logon as the currently logged in user. This gives it access to the desktop, and screenshare tests now seem to work better"

Docker containers not accessible while connected on VPN

I am using docker 19.03.5 in my ubuntu 18.04. Usually, I can access all the containers. Everything is ok but the real problem arises when I connect my machine to a VPN client(Cisco anyconnect). I can not access any containers while as soon as I connected to the VPN. Is there any way so that I can access docker containers even connected to a VPN?
I have faced this problem and tried all possible solutions available in Internet, but nothing worked. It looks like Cisco Anyconnect vpn takes an exclusive control over the routing of the system and any changes made are not showing any effect.
The following worked for me. Instead of Cisco Anyconnect, use OpenConnect VPN. Both uses same protocol. To download:
sudo apt install openconnect network-manager-openconnect network-manager-openconnect-gnome
Reboot your PC and then go to VPN Settings -> Multi-protocol VPN client (open connect) and provide the settings as per your organisation requirement.
That's because the VPN is configured to use full-tunelling. The network administrator should configure a split-tunnelling profile.
Full tuneling:
[PC] ---> [VPN] ---> { all networks
Split Tunneling:
[PC] ------> [VPN] ---> [Configured networks]
\-----> [Internet / other networks]
Another thing you can try is editing the routes.
You can add a route pointing to your container IP and specifying the good network adapter, then you have to set a higher priority on this route than on the default gateway of the VPN.
This issue is not related to Docker daemon / container settings. VPN server configuration is to blame (disabled split-include or prohibited local network access).
Because of that you have limited options how to resolve this:
Ask VPN server administrator to allow split-include (mikrotik terminology)
Check anyconnect client settings for something like "route all traffic thru VPN" and disable it
Create custom static routing on your machine to access specific IP range (servers behind VPN server) thru interface created by anyconect client

unable to connect google coral using OTG port

When I'm running google coral using serial port I'm able to run demo apps but when I'm trying to run
google coral using data port (type c cable) I'm unable to connect with a dev board
rahul#ubuntu:~$ mdt shell
Waiting for a device...
Connecting to wishful-yarn at 192.168.101.2
Key not present on wishful-yarn -- pushing
It looks like you're trying to connect to a device that isn't connected
to your workstation via USB and doesn't have the SSH key this MDT generated.
To connect with MDT shell you will need to first connect to your device
ONLY via USB.
The problem is caused by the PyPI package mendel-development-tool itself. This error is raised by the 'NonLocalDeviceError' exception as can be seen in line 83 of command.py in the code of the package. Whenever the IP of the device does not start with 192.168.100, this exception is raised by sshclient.py (in line 86). This worked for the last Release of Mendel Linux (chef), since the IP address of the usbnet connection was 192.168.100.2. In my case the new Release of Mendel (day), which came lately in November 2019 had the IP 192.168.101.2. To check the IP check the output of
mdt devices
If you installed the package using pip3 as user, like it is recommended by the documentation (pip3 install --user mendel-development-tool), this can be fixed by a quick local patch:
Open the file in your favourite text editor
vim $HOME/.local/lib/python3.6/site-packages/mdt/sshclient.py +86
Replace line 86, which is
if not self.address.startswith('192.168.100'):
raise NonLocalDeviceError()
by the following code
if not self.address.startswith('192.168.10'):
raise NonLocalDeviceError()
Most likely the authors might update the PyPI package to this solution, since the master branch of command.py already has the proposed code. Once the package has been updated you just have to update it on your host.
pip3 install --upgrade mendel-development-tool
The issue is google coral dev is connecting to WIFI also.
First you need to delete the wifi in google coral using nmtui --> edit connection --> delete.
Then connect your host computer to google coral dev board through USB C OTG data cable.
Through serial console to devboard, delete the contents of the /home/mendel/.ssh/authorized_keys
reset the mdt service in google coral devboard using mdt-keymaster
sudo service mdt-keymaster restart
Delete the mdt key in your host computer through rm ~/.config/mdt/keys/mdt.key
Correct the IP issue in NonLocalDeviceError as above
Then try mdt shell
if nothing working, reflash the coral board by using below procedure
Connect your dev board via serial cable and login [Ist terminal].
Once login hit sudo reboot-bootloader to put devboard in fastboot mode.
Open 2nd terminal and perform below steps to flash mendel linux
cd $HOME/Downloads
curl -O https://dl.google.com/coral/mendel/enterprise/mendel-enterprise-chef-13.zip
unzip mendel-enterprise-chef-13
cd mendel-enterprise-chef-13
bash flash.sh
Once Flashing the board complete shutdown google coral sudo shutdown now
Connect devboard again, then follow the previous steps 1-5 again.

How to get a Cordova app running on the device to connect to Node JS server

I have a nodeJS server running on my local machine and a Cordova app (hybrid). I am able to connect and run the app using the iOS simulator, however, it does not connect to the nodeJS server on my local machine when the app is installed on my iPhone.
Can you give some hints on how to resolve this issue
Thanks
If you are on the same local network, you can run ipconfig (if on windows) or ifconfig (if on unix) to find out your local machine IP address on the local network.
For example your address may be 192.168.0.2 and your node app runs on port 8080, in this instance you can use 192.168.0.2:8080 to access your server.
An easier and better way would be to use something like ngrok to create a tunnel to your local machine accessible from the internet.

How to get networked test app to run under Jenkins user

I have a build running under Jenkins (Windows 7) that builds a C++ application. I wrote a small test app in python that runs the application after it is built and tests its networking capabilities. The problem is that the python script fails with
socket.error: [Errno 10061] No connection could be made because the target machine actively refused it
The test app works fine if I run it locally (it's only connecting on localhost 127.0.0.1) but it always fails when run under Jenkins.
I thought it was the firewall preventing the connection, but I discovered that the firewall has been turned off on the build machine.
I also have the Jenkins service logging in with an account that has admin access. I don't know where else to look.
Is it possible to run an app that accesses the local network during a Jenkins build?
Update:
As it turns out, my issue has nothing to do with networking, as far as I can tell. The C++ app tries to setup some DirectX9 services and is blocked from doing so under the user privileges provided by Jenkins. As a result, it quits before it even gets to setting up the networking. Now I have a different problem to solve.

Resources