To connect a Docker container in a virtual machine in a Windows host

Source: Internet
Author: User

1. Simple topology diagram

If the Pingdocker container is ping different at this time because there is no route to the 192.168.1.0/24 network on the host, the host has the opportunity to send the data destined for the 192.168.1.0/24 network to the default route so that the container cannot be reached.

2. Workaround:

1. First of all ensure that the virtual machine can be connected to the Docker container, ping test is smooth

2. Turn off the firewall in the virtual: Systemctl stop Firewalld.service

3. Open the Host (Windows) cmd where you added the route to the 192.168.1.0/24 network.

Packets leading to the 192.168.1.0/24 network are forwarded by 172.20.1.12来

192.168. 1.0 255.255. 255.0 172.20. 1.12

To view the routes added:

  

You can test connectivity by pinging at this point:

  

You can now connect to the Docker container via the SSH client:

  

    

To connect a Docker container in a virtual machine in a Windows host

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.