How to prepare for the VM virtual machine environment

08-01-2023

The editor in this article will introduce how to prepare the VM virtual machine environment in detail. The content is detailed, the steps are clear, and the details are handled properly. I hope this article on how to prepare the VM virtual machine environment can help you solve your doubts. Slow down, let's learn new knowledge together.

This tutorial uses CentOS7 version for Linux.

After the Linux system installation of the virtual machine is completed, configuring the VM virtual machine network requires configuring the VM virtual machine, the win10 operating system network and the Linux network in the VM.

  1. Configure VM Virtual Machine Network

  • Select Edit in VM -- --Virtual network editor----select VMnet8----there are change settings in the lower right corner, as shown in the figure below:

PHP zero foundation to employment live video class: enter learning

  • Enter and change the settings as shown in the figure below, you need to set the IP network segment and gateway

  • < /ul>

    • After the setting is complete, click OK, apply, etc.

    2. VM network adapter network configuration in win10 system

    • Find the network adapter VM8, right-click properties, double-click IPV4, enter Network setting interface:

    3. Linux network configuration in VM

    • Switch to root user

      [zx@hadoop100 ~]$ su root

    • Input: [root@hadoop100 zx]# vim /etc/sysconfig/network-scripts/ifcfg-ens33, enter the following editor:

    Modify the above configuration, save and exit, as follows:

    The value of BOOTPROTO has been modified above to be static;

    The value of ONBOOT has been modified to be yes, which is used to activate the network card, otherwise the IP will not be displayed;

    >

    And add the following command:

    The above 3 steps can complete the network configuration. Under normal circumstances, we need to configure the host name to facilitate subsequent development. The steps are as follows :

    4. Configure the host name

    • Enter the command: [root@hadoop100 zx]# vim /etc/hostname can modify the host name

    5. Host IP mapping

    We will do clustering later, in order to modify the IP later, we need to do host mapping for the current template server

    • Enter the command: [root@hadoop100 zx]# vim /etc/hosts, enter the editor, add hosts in the editor

    7. Network test

    • Use the command to restart: reboot

    • Test: ping www.baidu.com, if the following information appears, the network configuration is successful:

    < p>

    8. Install epel-release software

    • Extra Packages for Enterprise Linux is to provide additional software packages for the Red Hat operating system, suitable for RHEL, CentOS, and Scientific Linux. It is equivalent to a software repository, and most rpm packages cannot be found in the official repository.

    • Installation command: [root@hadoop100 zx]# yum install -y epel-release

    Prompt : If the Linux installation is the minimum system version, the following tools need to be installed; if the Linux desktop standard version is installed, the following operations need to be performed:

    (1) Install the net-tool toolkit Collection, including ifconfig and other commands

    Installation command: [root@hadoop100 zx]# yum install -y net-tools

    (2)Install vim editor installation command: [root@ hadoop100 zx]# yum install -y vim

    9. Turn off the firewall

    • Single turn off the firewall command: [root@hadoop100 zx]# systemctl stop firewalld< /p>

    • Turn on and off the firewall: [root@hadoop100 zx]# systemctl disable firewalld.service

    10. Create zx user

    • [root@hadoop100 zx]# useradd zx #username

      p>
    • [root@hadoop100 zx]# passwd 000000 #Password

    11. Add permissions for zx users to facilitate later use of zx Users add sudo to use root authority

    • Command: [root@hadoop100 zx]# vim /etc/sudoers enter the editor

    • Insert the command zx ALL=(ALL) NOPASSWD:ALL

    • :wq! on the next line of %wheel ALL=(ALL) ALL to force saving because this is a read-only file

    • Test: Enter the opt directory and delete the rh file in this directory. If you use the command rm -rf rh/, you will be prompted for insufficient permissions; if you use sudo rm -rf rh / will do.

    12. Directory preparation and permission operation Enter the opt directory, create module and software directories under the opt directory, and all software will be installed in this directory in the future.

    13. Uninstall the original JDK

    • First query the JDK through [zx@hadoop100 opt]$ rpm -qa | grep -i java, you can know that there are jdk1.7 and jdk1.8 versions

    Description:

    • < p>rpm -qa: query all rpm packages installed

    • grep -i: ignore case

    • xargs -n1: Indicates that only one parameter is passed at a time

    • rpm -e –nodeps: Force uninstall software

    14. Restart the virtual machine

    [root@hadoop100 opt]# reboot

    undefined

    Read here, this article on how to prepare the VM virtual machine environment has been introduced, If you want to master the knowledge points of this article, you need to practice it yourself before you can understand it. If you want to know more aboutFor articles related to the content, welcome to pay attention to the Yisu cloud industry information channel.

Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us