Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Link the CentOS of the virtual machine through XShell

Shulou Source: shulou.com Published: 2022-06-03 07:39:20 11月10日 Update

Win7 environment through XShell link VirtualBox CentOS; always can not be linked, because the virtual machine chose the wrong way to link to the network.

[recommended connection method: Host-only Adapter (host mode)]

Knowledge Abstract:

VBox simulates a network card dedicated to virtual machines in the host, and all virtual machines are connected to the network card. We can set up this network card to achieve Internet access and many other functions. The host mode can complete the functions of the following three network connection modes through the setting of virtual machines and network cards.

NAT

Bridged Adapter

Internal

Relationship between virtual machine and physical host: they cannot access each other by default, and they do not belong to the same IP segment. The default IP segment of host-only Nic is 192.168.56.X.

The subnet mask is 255.255.255.0, and the following virtual machines are assigned to this network segment.

The relationship between virtual machines and other physical hosts in the network: by default, they cannot access each other for the same reason as above. By setting, they can access each other.

Virtual machine-virtual machine relationship: by default, only virtual machines can access each other, all in the same network segment. The so-called HOST only says-virtual host.

First, check the settings on CentOS:

1. Before turning off fire prevention

Service iptables stop

Chkconfig iptables off

two。 Start the ssh service

Service sshd start

3. Check the IP address of CentOS: ifconfig-a

Inet addr:192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255.0

4. Then, go back to PING 192.168.56.101 under WIN7 and make sure the virtual machine responds.

C:\ Users\ yours > ping 192.168.56.101

Ping 192.168.56.101 has 32 bytes of data:

Reply from 192.168.56.101: byte = 32 time = 1ms TTL=64

Reply from 192.168.56.101: bytes = 32 time

Tags: Host Nic byte time address network link mode mode function data version physics system network segment virtual host allocation service run select Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Microsoft Linux NVidia Docker