Installation and network sharing configuration of Linux virtual machines

Source: Internet
Author: User
Tags file permissions

一:Linux虚拟机的安装

1: Check your computer version # #hostnamectl

2: Download the required version of the virtual machine from the teacher machine

3: Install the virtual machine
(1) Virt-manager # #进入安装页面

(2)
(3)
(4)
(5)

(6)
(7)
(8)
(9)
(10)
(11)

(12)

(13)

(14)

(15)

4: Network Configuration
1: Use graphical configuration
(1) Nm-connection-editor

(2)
(3) write the following in the virtual machine/etc/sysconfig/network file (in order to configure the global gateway)
Nerworking=yes activating networking at startup
Nozeroconf=yes It is a dynamic configuration protocol that the system can use to connect to the network.
gateway=172.25.12.250 IP Address "set global gateway" for your own true machine address

(4) Re-start Network

2: Use command configuration
(1) View firewall settings

(2) Change the value of masquerade to Yes

(3) cd/etc/sysconfig/network-scripts/

(4) LS view file

(5) Vim-ifcfg-ens3 for configuration file writing

(6) Viewing the configuration file

(7) Route-n View Gateway

注意:可能出现的问题1).使用【ping 真机ip】如果失败说明虚拟机网卡可能有问题需要更换虚拟机网卡   ![](http://i2.51cto.com/images/blog/201808/20/f9d04fafdf39d79a87b9231aa55eac00.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)     2):点击左下角Add Hardware添加新的网卡


3): Click on the bottom right corner finish to add a new network card


2: The kernel does not have routing enabled

Stop Network Records and restart

                                                二:Linux 挂载iso文件

1:mkdir/rhel7.30 # # Create a folder to act as a mount point
2:MOUNT/ISO/RHEL-SERVER-7.3-X86_64-DVD.ISO/RHE17.3/mount the image under the/iso directory on the/rhe17.3/file

3:cd/etc/yum.repos.d/access to this file
4, RM-FR * Delete all files in the directory

5, Vim Yum.repo Edit the contents of the file, the suffix can not be changed without this file will be automatically created

6. Write the following to file Save exit
[rhe17.3] Description
name=rhe17.3 Name
baseurl=file:///rhe17.3 Location
Gpgcheck=0 Skip Source Check

7. Yum Clean all clears the record

8. The Yum search JDK searches for files about the JDK

9. Yum Install java-1.6.0-openjdk.x86_64 installs this software

10. Yum install-y java-1.6.0-openjdk.x86_64 Skip Inquiry Direct Install

                                     三:Linux  yum的搭载

1. Yum Install httpd-y installation software for file sharing

2, Systemctl start httpd Open Software

3, systemctl enable httpd boot

4, Firewall-cmd--permanent--add-service=http firewall Cancel Intercept

5. mkdir-p/var/www/html/rh7.3 Create file "access to/var/www/html/directory via IP"

6. mount/iso/rhel-server-7.3-x86_64-dvd.iso/var/www/html/rh7.3 to mount the file

7, chmod 755/etc/rc.d/rc.local Modify file permissions

8. Modify the address of the/etc/yum.repo.d/file so that only local access becomes IP access


9. The virtual machine can access the mount point via IP

Installation and network sharing configuration of Linux virtual machines

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.