VirtualBox install CentOS7 and network configuration

table of Contents

1. Environmental description

Two, VirtualBox configuration steps

Three, CentOS system installation

Fourth, the installation is complete

Five, ssh to access CentOS


 


1. Environmental description

1、VirtualBox:6.1.4 r136177 (Qt5.6.2)

2 、 CentOS : 7

Two, VirtualBox configuration steps

1. After installing VirtualBox, click New on the first interface;

2. Customize the naming and choose the system type Linux, and the version can choose RedHat;

3. Click Next to configure the memory, and select to create a virtual hard disk, click Create, select VDI for the virtual hard disk file type, click the dynamic allocation of the physical hard disk here, the file location is default, here modify the path disk, and finally click create;

 

3. After the creation is complete, return to the main interface. After clicking Start, it will automatically pop up to select the startup disk. Here, select the locally downloaded iso file for the mirror file, and then click Start;

Three, CentOS system installation

1. After startup, click on the screen to select Install CentOS 7. If you switch the interface where the mouse is located, click CTRL on the right.

2. The installation interface pops up, first select the language, here select English, and then click Continue;

3. The installation interface slides down to the bottom and clicks NETWORK & HOST NAME to configure the network. On the next interface, click the switch on the upper right side to automatically configure the network, and then click DONE;

4. Go back to the installation interface and click Begin Installation. If it is still gray, click Installation Destination and then click Done;

5. In this interface, you can configure ROOT and ordinary users. Here, only ROOT users are configured. After setting the password, click Done. The default user name is root.

After that, wait for the installation to complete and click reboot.

Fourth, the installation is complete

Five, ssh to access CentOS

1. Select the network in the settings, click Advanced -> Port Forwarding

Add configuration ssh at this interface point

Centos server test:

#ssh localhost 

Windows test:

$ ssh -p 8022 [email protected]

2. If you want to assign an IP address to a virtual machine, you need to configure the following on the basis of 1 (only the Host-Only network can not access the external network)

Configure Host-Only Network

After restarting, you can find the IP address is 192.168.56.101

[root@10 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:c3:b8:d1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.56.101/24 brd 192.168.56.255 scope global noprefixroute dynamic enp0s3
       valid_lft 512sec preferred_lft 512sec
    inet6 fe80::7cca:2880:2321:b63e/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:44:44:59 brd ff:ff:ff:ff:ff:ff
    inet 10.0.3.15/24 brd 10.0.3.255 scope global noprefixroute dynamic enp0s8
       valid_lft 86041sec preferred_lft 86041sec
    inet6 fe80::755f:f1ce:55e4:f16b/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

The Windows terminal can be directly remote: $ ssh 192.168.56.101

$ ssh [email protected]
The authenticity of host '192.168.56.101 (192.168.56.101)' can't be established.
ECDSA key fingerprint is SHA256:an6dBJKJUrJLFLeATtI1znV7fNE0/YrBXTRrP9939dU.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.56.101' (ECDSA) to the list of known hosts.
[email protected]'s password:
Last login: Tue Mar 17 15:25:13 2020
[root@10 ~]#

 

Guess you like

Origin blog.csdn.net/xlyrh/article/details/104924101