当前位置:首页 > 虚拟机 > 正文

xshell怎么连接虚拟机(为什么要用shell连虚拟机)

How does xshell connect to a virtual machine

To use the above win software to connect to a virtual machine, you must install certain software on the virtual machine. After installation, set it up You can connect in just a few moments. The specific connection methods are introduced below.

Virtual machine settings

Open the virtual machine on win, open the system and click the black terminal icon on the system, as shown in Figure 2.

Enter the command in Figure 1 in the terminal, and then enter the letter y after entering it correctly.

Then enter the command: [ifconfig] to get the IP address of a virtual machine starting with inet. Remember this address, and then enter the command [who] to get the name of the currently logged in user. a, remember it the same.

win physical machine settings

Download the software in Figure 1 and click on it.

Click next and click yes on the menu.

Enter a name and click next. Continue to click this next.

Click next and click finish.

After the software is installed, open it, click New on the software, and enter the IP address of the virtual machine on the host in Figure 3.

Click this link and click Accept to save.

Enter the username on the virtual machine and click OK. Enter the password and click OK. It is the login password of the current user of the virtual machine.

At this time, you will see that the virtual machine is connected. Entering this [ls] will list the files in the current directory on the virtual machine.

How to connect the local xshell to the virtual machine
Method/steps
1 Open the virtual machine and set the Linux virtual machine to host-only mode.
2 Edit the Linux network card configuration file /etc/sysconfig/network-scripts/ifcfg-eth0 (redhat6 and 7 version configuration files are different, take 6 as an example)
3 Configure an ip for the virtual machine ( IP does not have fixed requirements) (note restarting the network card service: servicenetworkrestart)
1 Open the network configuration of the real machine
2 Find the connection of vmnet1, right-click - Properties
3 Double-click the version agreement 4 (tcp/ipv4)
4Set a static IP address, which must be in the same network segment as the virtual machine’s IP address
1Open the xshell client
2File in the upper right corner - Create new
3 Fill in the IP address of the Linux virtual machine in the host column, and fill in the others as required
4 File-Open-select the session we created in the upper right corner. Click Connect.
1 Wait for the dialog box to pop up. Fill in the user name created in the Linux virtual machine (you can choose to save the user name for easy use next time) and click OK
2 Enter in the password field You choose the user's password (you can also choose to save it)
3 Click OK and wait for the connection.
5
You can also connect through the command: ssh (the IP address of the virtual machine to be connected)

How to use xshell to connect to a virtual machine in virtualbox
/Steps
1 Open the virtual machine and set the linux virtual machine to host-only mode
2 Edit the linux network card configuration file /etc/sysconfig /network-scripts/ifcfg-eth0 (6 examples of redhat67 version configuration files)
3 Virtual machine configuration ip (ip is a fixed requirement) (note to restart the network card service: servicenetworkrestart)
1 Get real Machine network configuration
2 Right-click the vmnet1 connection - Properties
3 Double-click version protocol 4 (tcp/ipv4)
4 Set a static IP address and the virtual machine IP address must be in the same network segment

1. Open the xshell client
2. File in the right corner - New
3. Fill in the IP address of the Linux virtual machine in the host column and fill it in as required
4. File in the right corner - Open - Select Create and click Connection
1 Wait for the user name in the pop-up box to fill in the Linux virtual machine to create a user (choose to save the user name and use it) and click OK
2 Enter the selected user password in the password field (same as choosing to save)
/>3 Click OK and wait for the connection
5
Connect via command: ssh (to connect to the virtual machine IP address)