Virtual machine configuration network
The scene goes like this: export the items from the virtual machine on someone else's computer and import them into the virtual machine on my computer.
1. Start VM, File-> Open-> Select xxx.vmx to import
two。 Configure the network according to the following figure in turn
Then select the NAT mode, as shown below
After completing the above steps, start the virtual machine to verify whether it can be entered normally. If an interface similar to the following indicates success
3. Configure the network
Enter ifconfig to view the ip address, and if it appears as shown in the following figure, it is basically correct.
If not, use the following method:
Vi / etc/sysconfig/network-scripts/ifcfg-eth0
Change the DEVICE value to eth0
Delete the HWADDR line
Save exit
Rm-rf / etc/udev/rules.d/70-persistent-net.rules
Restart the virtual machine
Use ifconfig again to see if the ip is displayed properly
If it is OK, change the network connection mode to "bridging" and repeat the above steps
If the above method does not work, try the following method:
Mv / etc/sysconfig/network-scripts/ifcfg-eth0 / etc/sysconfig/network-scripts/ifcfg-eth2
Vi / etc/sysconfig/network-scripts/ifcfg-eth2
Change DEVICE= "eth0" to DEVICE= "eth2"
Save
Restart the network card, service network restart
Use ifconfig to view
4. If you want to start tomcat, go to the bin directory of tomcat
Sh startup.sh
Start the browser locally and enter http:// virtual machine ip:8080 to open the tomcat page
You should be able to see the deployed applications under tomcat7/webapps, such as dangdang
Then, the browser can enter http:// virtual machine ip:8080/dangdang to open the application page
5. Local host configuration can be done if necessary
C:\ Windows\ System32\ drivers\ etc\ HOSTS
6. If necessary, configure the database connection
To directory tomcat7/webapps/dangdang/WEB-INF/classes/config/props
Vi db.properties
Then modify the ip address, database user name and password
Restart the virtual machine after saving, then start the tomcat service, and then visit