After CentOS 7 is installed in Mac
Today, the CentOS virtual machine is installed to run java web programs.
Install see http://www.centoscn.com/image-text/setup/2016/0629/7555.html
Set networking
I am using the bridging method. By default, the ifconfig command is not installed in centos7 (which will be described later). Therefore, this command cannot be used and can be usedip addrCommand to view the ip address.
Set automatic ip address acquisition
dhclientCommand to use the Dynamic Host Configuration Protocol to dynamically configure the network parameters of the network interface (the NIC obtains the IP address using the dhcp protocol)
- Modify file
/etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=dhcp ONBOOT=yes
Set static IP address (not tried yet)
Modify file/etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR=192.168.xxx.xxxNETMASK=255.255.255.0GATEWAY=192.168.xxx.xxxONBOOT=yesBOOTPROTO=none
Set the ip address and Host ip address in one CIDR block, and restart the network service.
service network restart
You can also refer to the article setting up three methods for configuring ip addresses in CentOS 6.5 under virtual machines. After setting the ip addresses, ping each other on the physical machines and virtual machines to see if the ip addresses can be pinged.
Ifconfig command not found
Starting from RHEL/CentOS 7, minimal security does not include ifconfig, netstat, and other tools. Previously, tools are pre-installed on CentOS 5 and 6. The installation command is as follows:
Yum install net-toolsifconfig eth0 // view ip command
CentOS Virtual Machine shares files in Mac
First, clickOperation-> install Parallels ToolsBut not on CentOS./media/cdromContent, which must be manuallymkdir -p /media/cdromAnd then mount it. The mount command ismount -o exec /dev/cdrom /media/cdrom. In this way/media/cdromRun the install installation script.sudo ./installThen you can/media/psfThe corresponding shared file can be set to readable or writable.
Physical machines cannot access virtual machine Web Services
Physical machines and virtual machines can be pinged to each other, but physical machines cannot access the Web Services of virtual machines because ports caused by firewalls cannot be accessed. I simply shut down the firewall. The firewall of CentOS7 uses firewalld by default, which is different from the previous version using iptables.
Sudo systemctl stop firewalld. service // disable firewall sudo systemctl disable firewalld. service // disable startup
Common commands
Yum search XXX // find yum Software Package yum list XXX // list all installable software packages yum list installed // list all installed software packages rpm-ql tomcat // list installed tomcat location: rpm-qa | grep tomcat // yum whether to install tomcat and version: rpm-e -- nodeps XXX // Delete the installed software package shutdown-h now // shut down reboot // restart
[Reference]
Disable the firewall for installing Parallels Tools CentOS7 on CentOS