Virtual Machine VBox installation CentOS6.8, Intranet and Internet access tutorial, vboxcentos6.8

Source: Internet
Author: User

Virtual Machine VBox installation CentOS6.8, Intranet and Internet access tutorial, vboxcentos6.8

I. Purpose

To learn and study, we often need to install Linux systems and some software on virtual machines, and require both the Internet and the host to communicate with each other.

However, many tutorials on the Internet are cumbersome and seem unclear. This article provides guidance on installation and configuration based on successful experiences.

Note: The steps in this article may be unnecessary because you have referenced a lot of online tutorials, because you do not have time to identify and remove them one by one. Therefore, please correct and provide a dialectical reference.

Updated on March 13, June 24. I tried it again today. If you have any questions, change it ~~

Ii. Windows preparation

Host Nic

After VBox is installed, VirtualBox Host-Only Network should be in the Network connection. The settings are as follows:

Nic IP settings

The local environment is in the notebook and WiFi is used. The settings are as follows:

Nic sharing settings

3. Virtual Machine Configuration

Management> global Settings> Network

Global VBox network settings

The configuration for creating a VM is as follows:

Create a VM Nic 1 Configuration

Create virtual machine Nic 2 Configuration

Other options can be configured according to the personal environment.

Iv. CentOS6.8 Installation

There is nothing to say in this section. For convenience, I installed the desktop version, which is not required for actual use.

Ctrl + F full screen switch

Ctrl + C zoom Switch

V. CentOS6.8 Configuration

On the desktop, there are two types of networks:

CentOS Nic

Ifconfig

Edit System eth1 as shown in Figure

CentOS network settings

Now, open the Firefox browser that comes with the system and access Baidu successfully.

Eth0 accesses the internet, and eth1 is connected to the host machine.

Access 192.168 and 56.103 on the host machine through SSH client. The access is successful.

Note:

Cd/etc/sysconfig/network-scripts

Vi ifcfg-eth0

Vi ifcfg-eth1

ONBOOT must be set to yes.

Or set automatic connection on the desktop.

Service network restart

Restart service

6. Start to enter the command line

Root User

# Vi/etc/inittab

Find the following statement:

# Default runlevel. The runlevels used by RHS are:

#1-Single user mode

#2-Multiuser, without NFS (The same as 3, if you do not havenetworking)-Multi-user mode, does not support NFS

#3-Full multiuser mode-Multi-User mode

#4-unused

#5-X11-graphical interface

#6-reboot (Do NOT set initdefault to this)-Restart

Id: 5: initdefault:-The default running level is 5. You only need to change it to id: 3: initdefault :.

In text mode, you can use the following method to enable the graphic interface:

# Startx

VII. JDK settings

1. Delete OpenJDK

You can choose not to install JDK when installing the system. If you select JDK, you should uninstall the installed OpenJDK.

Java-version

Java version "1.7.0 _ 99"

OpenJDK Runtime Environment (rhel-2.6.5.1.el6-x86_64 u99-b00)

OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

Rpm-qa | grep java

Java-1.7.0-openjdk-1.7.0.99-2.6.5.1.el6.x86_64

Java-1.6.0-openjdk-1.6.0.38-1.13.10.4.el6.x86_64

Tzdata-java-2016c-1.el6.noarch

Uninstall command:

Yum-y removejava-1.6.0-openjdk-1.6.0.38-1.13.10.4.el6.x86_64

Rpm-e -- nodepsjava-1.7.0-openjdk-1.7.0.99-2.6.5.1.el6.x86_64

2. Install JDK 7 and 8

Download the tar.gz package of jdk700008from the oracle.com and upload it to the server.

Use the root user to create the directory/usr/local/javaand cut the two tar.gz files to this point.

Decompress two packages:

Tar-zxvf jdk-7u80-linux-x64.tar.gz

Tar-zxvf jdk-8u131-linux-x64.tar.gz

In this environment, JDK 8 is used as the default configuration. JDK 7 is used for Tomcat of the Dubbo console.

Configure the JDK8 environment:

Vi/etc/profile added:

# Java env

Export JAVA_HOME =/usr/local/java/jdk1.8.0 _ 131

Export JRE_HOME = $ JAVA_HOME/jre

Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar: $ JRE_HOME/lib/rt. jar

Export PATH = $ PATH: $ JAVA_HOME/bin: $ JRE_HOME/bin

Source/etc/profile

Related Article

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.