Cisco anyconnect server docker Sectoin I: Introduction. As an Iranian citizen, I always have trouble with censorship forced by our beloved government on one hand and foreign sanctions burden on another hand.
Cisco anyconnect docker linux. How to fix Docker Connection Issues when using VPN (Cisco, Today I was experiencing some issues when I tried to run docker after I have Cisco AnyConnect running I started googling about the issue and Get Cisco AnyConnect Essentials VPN License from the IT Experts at CDW. Docker and Cisco AnyConnect. Posted by 4 years ago. Docker and Cisco AnyConnect. This thread is archived. New comments cannot be posted and votes cannot be cast.
| Start docker before connecting vpn (to get local ip, eg 192.168.99.100) |
| After start, connect to VPN, then follow next steps: |
| From: https://github.com/boot2docker/boot2docker/issues/628 |
| Add port forwarding to the NAT'd adapter in VirtualBox, add: |
| docker: host=127.0.0.1 port=2367 guest ip=[blank] guest port=2376 |
| container port: 127.0.0.1, port=[the container exposed port to forward] guest ip=[blank], guest port[container port] |
| From https://www.iancollington.com/docker-and-cisco-anyconnect-vpn/ |
| In Docker Quickstart Terminal, to point to port forwarded Docker, and to turn off checking of SSL certs: |
| export DOCKER_HOST=tcp://127.0.0.1:2376 |
| alias docker='docker --tlsverify=false' |
| Alternatively, create a new docker-machine with tlsverify turned off: |
| docker-machine create -d virtualbox --engine-env DOCKER_TLS=no default |
| export DOCKER_HOST=tcp://127.0.0.1:2376 |
| docker-machine regenerate-certs |
| - now you should be able to run docker commands without adding the --tlsverify=false |
Any ideas on how to do this for my scenario ? Any help is greatly appreciated. |
Regardless of whether h/w virtualization is enabled in BIOS, you can't run Hyper-V and start a VirtualBox VM with a 64bit guest running at the same time. @mithuns search for 'windows hyper-v running VirtualBox at the same time' or similar terms and you'll find solutions. Easiest answer, use one or the other, but not both at the same time |

I have been waiting in anticipation for WSL2 (Windows Subsystem for Linux) and on May 28th when the update released for general availability I updated immediately.
At first I was super hyped. WSL2 and the Ubuntu 20.04 image just worked and ran smoothly and quickly. Combined it with the release version of Windows Terminal it was a real delight.
I also went and grabbed Docker Desktop for Windows as it now has support for WSL2 as the underlying system. And joy it just installed and worked. Now being capable of running Docker containers directly from my shell without doing some of doing it the way I did before having a Ubuntu VM running in VMware Workstation and connecting to it via docker-machine on my WSL1 Ubuntu image. A hassle to get to work and not a very smooth operation.
Having the option to just start Docker containers is amazing!
But then I had to get some actual work done and booted up VMware Workstation to boot a VM. And it failed. With a Device Guard error. I followed the guides and attempted to disable Device Guard to no avail. Then it dawned on my. WSL2 probably enables the Hyper-V role! And that is exactly what happened.
Hyper-V and Workstation (or VirtualBox for that matter) do not mix well – that is until VMware released Workstation 15.5.5 to fix this exact problem just the day after WSL2 released. Perfect timing!
Simple fix – just update Workstation to 15.5.5 and reboot and WSL2 and Workstation now coexisted fine!
I played a bit more with WSL2 in the following days but ended up hitting some wierd issues where networking would stop working in the WSL2 image. No real fixes found. Many indicate DNS issues and stuff like that. Just Google “WSL2 DNS not working” and look at the mountains of issues.
But I suspected something else because DNS not working was just a symptom – routing out of the WSL2 image was not working. Pinging IPs outside the image did not work. Not even the gateway IP. And if the default gateway is not working of course DNS is not working.
I found that restarting fixed the issue so got past it that way but today it was back. I was very interested in figuring out what happened. And then I realized the potential problem and tested the fix. I was connected to my work network via Cisco AnyConnect. I tried disconnecting from VPN and testing connectivity in WSL again – now it works. Connected to VPN again and connectivity was gone.


Okay – source found – what’s the fix? I found this thread on Github that mentions issues with other VPN providers even when not connected. Looking through the comments I found a reference to a different issue of the same problem but regarding AnyConnect specifically.
I looked through the comments and many fixes around changing DNS IP and other things but the fix that seem to do the trick was running the following two lines of Powershell in an elevated shell after connecting to VPN
Those two lines change the Interface Metric so that the WSL interface has a higher priority than the VPN connection. This inadvertently also fixed an issue that I had with local breakout when on VPN not working correctly.
Downside of the fix is that this needs to be run every time you connect to VPN. I implemented a simple Powershell function in my profile so I just have to open an elevated shell and type “Fix-WSLNet”.
That is all for now!
