Linux Installation - VMware + RedHat

Keywords: C Back-end server

1 install VMware virtual machine

  • The default installation is OK. If you change the installation location, remember to use the VMware installation directory after the changed location

2. Install RedHat red hat system

2.1 virtual machine settings:

  • Create a new virtual machine
  • Custom (Advanced)
  • Select virtual machine hardware compatibility - select the corresponding version of the virtual machine
  • Installer CD image file (iso) -- browse for the system image file you choose to download -- install the operating system later
  • Client operating system (Linux) - Version (select according to the downloaded system version, such as Red Hat Enterprise Linux 8 64 bit)
  • Named virtual machine - location (selected on demand)
  • Processor configuration - default or adjust as needed
  • Memory of the virtual machine -- default or adjust as needed
  • Network type - bridge mode
  • I/O controller type - default
  • Disk type - default
  • Create a new virtual disk
  • Disk capacity - default or adjusted according to demand - splits the disk into multiple files
  • Specify disk file - default
  • complete

2.2 start virtual machine

  • install-enter
  • English / Simplified Chinese
  • Language support - Simplified Chinese
  • Time - Shanghai
  • Software - Server with GUI
  • Disk partition - Custom - Done - partition - Done
  • Network - ON
  • Security policy - 3.2.1
  • Setting - root password, new user
  • reboot
  • accept

3 cannot updata read only repo

  • redhat is not registered. Non subscribers cannot use yum

3.1 delete the built-in yum package

rpm -qa|grep yum|xargs rpm -e --nodeps

3.2 download centos version and replace it with yum package

3.2.1 view the system version and find the corresponding yum package

cat /etc/redhat-release

from yum package download address Get available addresses

3.2.2 wget Download

wget http://mirrors.163.com/centos/8/BaseOS/x86_64/os/Packages/yum-4.7.0-4.el8.noarch.rpm
wget http://mirrors.163.com/centos/8/BaseOS/x86_64/os/Packages/yum-utils-4.0.21-3.el8.noarch.rpm
wget http://mirrors.163.com/centos/8/BaseOS/x86_64/os/Packages/python3-urllib3-1.24.2-5.el8.noarch.rpm

The mirrors.163.com address here may not be available, but 404 may appear,
You need to get the latest address again from the yum package download address

  • Possible problem wget: unable to resolve host address
cd /etc  #Go to the etc directory
vim resolv.conf  #Open the resolv.conf file
sudo chmod a+w resolv.conf  #Modify file permissions
vim resolv.conf  #Reopen the resolv.conf file

#Add DNS address
nameserver 8.8.8.8  
nameserver 8.8.8.4

3.2.3 installation package

rpm -ivh --force --nodeps yum-4.7.0-4.el8.noarch.rpm
rpm -ivh --force --nodeps yum-utils-4.0.21-3.el8.noarch.rpm
rpm -ivh --force --nodeps python3-urllib3-1.24.2-5.el8.noarch.rpm

3.2.4 configuring network sources

  • Create repo.d directory
cd /etc/yum
mkdir repo.d
  • Download the Alibaba cloud yum source file to the / etc/yum/repo.d directory
wget -O /etc/yum.repos.d/redhat.repo http://mirrors.aliyun.com/repo/Centos-8.repo

3.2.5 clear cache and rebuild database

yum clean all
yum makecache
yum repolist

4 install gcc

  • Directly use the following two lines of commands to install online
yum -y install gcc gcc-c++ autoconf pcre pcre-devel make automake
yum -y install wget httpd-tools vim

#View gcc version
gcc --version

5 shared folders for virtual machines and hosts

5.1 virtual machine

  • Virtual machine settings - Options
  • Shared folders - always enabled - add
  • Virtual machine settings - hardware - CD/DVD - use linux.iso image file (VMware installation directory: \ VMware\VMware Workstation\linux.iso)

5.2 linux system

5.2.1 uninstall the pre installed open VM tools package of the system (otherwise, the text cannot be copied and pasted between the virtual machine and the host may occur)

  • Check whether open VM tools is pre installed
yum list installed | grep open-vm-*
  • Uninstall the pre installed package
yum remove open-vm-tools
  • Restart the virtual machine system
reboot

5.2.2 installing VMware Tools

  • linux system - Files folder - CD: VMware Tools - VMware tools.gz
  • copy -- unzip (right click to unzip or use the command) -- enter the path / VMware Tools / VMware Tools District -- open the terminal
#Decompression command
tar xzvf VMwareTools-The version number here is consistent with the package name.tar.gz
#Installation command
sudo ./vmware-install.pl 

#setup script
yes
.........
Enter directly - default input yes
.........
The file /usr/bin/vmware-hgfsclient that this program was about to install 
already exists.  Overwrite? [no] yes  #Enter yes

The file /usr/bin/vmhgfs-fuse that this program was about to install already 
exists.  Overwrite? [no] yes  #Enter yes

Do you want to enable Guest Authentication (vgauth)? Enabling vgauth is needed
if you want to enable Common Agent (caf). [yes] no

Enjoy,

Restart the virtual machine system

reboot

Posted by peDey on Mon, 29 Nov 2021 06:06:50 -0800