1. Setting up the background
This paper intends to build a Linux system environment of its own step by step from 0, which will be the cornerstone of learning Linux, using Linux, programming in Linux environment, application and project deployment, tool experiment and a series of learning and practice. I hope it will be helpful to friends.
It is very important to prepare the Linux programming experiment environment in advance. It is recommended to have a set of Linux programming experiment environment, so that when you need to practice after learning a theoretical knowledge, you can take it to practice immediately.
So this article first to build up the environment!
2. Features of Linux system
Open (open source), multi-user, multi-task, good user interface, excellent performance and stability.
- Single user: Allows only one user to log in to a computer (operating system) at the same time.
- Single task: indicates the number of tasks that can be performed simultaneously.
- Multiple users: Multiple users are allowed to log in to a computer (operating system) at the same time.
- Multi-task: Allows users to perform multiple tasks simultaneously.
Windows belongs to the single user, multi-task; Linux is: multi-user, multi-task.
Branches: there are many branches of Linux, such as Ubuntu, Debian, CentOS (Community Enterprise Operating System), RedHat, SUSE, etc.
Third, the installation of Linux system
1. Installation method
Currently, you can install an OS on a real machine or on a VM.
- Real machine installation: Use a real computer to install, like the Windows operating system, the result of real machine installation is to replace the current Windows operating system;
- Virtual machine installation: through some special means, to simulate the installation, does not affect the current computer’s real operating system;
Vm installation is highly recommended for learning or testing.
2. Vm software
Vm software: Software that simulates a real computer environment and operates a computer system.
There are two well-known virtual machine products: VMwareWorkstation and VirtualBox from Oracle.
VMware Workstation is heavyweight and powerful. VirtualBox is lightweight and simple.
VMware Workstation is used as an example.
3. Vm installation
① Double-click to open the installation program:
Step 2 Start installation:
③ Agreed license agreement:
④ Determine whether to change the installation location of the software according to your needs:
Click next:
⑤ User experience Settings:
⑥ Shortcut creation steps:
⑦ Click the install button:
⑧ Click finish:
⑨ Check whether two virtual nics are installed in the VM software after the installation:
4. Linux version selection
Version selection: CentOS 6.5 [images are usually xxx.iso files], download address from the official website.
5. Create a VM
Using VMwareWorkstation:
① Click the “File” menu, select the “New VM” option, select “Custom” and click Next:
② Select compatibility by default and go to the next step:
③ When selecting the image file, select “Install OS later” and click Next:
4 Select the operating system to be installed.
⑤ Select the VM name and set the installation location of the VM.
6 CPU Settings:
⑦ Allocate memory:
⑧ Select network type and NAT.
NAT network: Physical hosts communicate with VMS, but other computers cannot access the network.
Bridging network: Other computers can access the Linux operating system on VMS.
⑨ Default next step, go to next step:
⑩ Click complete:
6. Install Linux operating system
Install using VMwareWorkstation:
A. Specify the system image file because no ISO image file has been specified before:
B. Run the VM.
If a similar message box (not an error box) appears after startup, check to stop the message and confirm:
If the following error occurs during startup, it indicates that CPU virtualization is not enabled on the computer. If CPU virtualization needs to be enabled, you need to restart the computer, and enter the BIOS Settings of the motherboard to enable virtualization during startup, and then save the Settings to restart the computer:
C. Select upgrade/install an existing system (by pressing ↑ or ↓) and press Enter:
D. Skip integrity check and install directly after disc is detected:
Unsupported hardware is displayed, ignore the next step:
E. Click Next:
F. Select a language to use during the installation.
G. Select keyboard type, American English:
H. Select a storage device type.
I. Initialize a blank disk and select Yes, ignore all data.
J. Set automatic nic connection, apply – Disable – Next step:
K. Set time zone (default: Asia/Shanghai) :
L. Set the password. After setting it, the next step is:
M. Use all disk space to install Linux, click Next:
N. Select the type of Linux to install:
O. Select Development – Development Tools, check the box √, and click Next:
P. Waiting for the installation of the software package:
Wait to complete, click Reboot:
Q. After rebooting, click “Forward” :
R. On the License screen, select Agree and click Forward:
S. Create a common user account (optional) and click Forward:
T. Time setting, advance after setting:
U. About kdump, then click Finish:
V. Login interface:
W. The following information is displayed after you log in to the system as user root:
X. Desktop:
7, terminal
Problem: in the current desktop system, if you need to shut down can be shut down through the “system” “shutdown”, then the later servers are command line mode, then this way will not be good, how to shut down it?
The terminal is similar to the CMD command line mode under Windows. You can input some commands that need to be executed in the terminal, and you can also shut down the terminal (note: in the future, you will rarely use shutdown commands in work, and will use restart more).
Terminal form:
Terminal components:
How do I shutdown the PC using terminal commands?
Shutdown commands in Linux include shutdown -h now (normal shutdown), HALT (close memory), and init 0.
8. Use backup operating system
There are two backup modes: snapshot and clone.
Snapshot: Also known as restore point, it is the system status (including all contents) saved when a snapshot is taken and can be recovered at any time in the future.
Note: For short-term backup, snapshots can be used when frequent backup is required. During snapshots, the virtual operating system is usually enabled.
① On the menu “VM” – “Snapshot” – “Take Snapshot”, enter related information and click “Take Snapshot”
Delete all the files in the system.
③ Use the snapshot to restore the state before the event. Go to the VM – snapshot – Snapshot manager:
The state after recovery:
Clone: is the meaning of replication, focus on long-term backup, do clone is must be closed.
Path: Shut down the VM – Right-click the VM to be cloned – Manage – Clone
Note: The information about the cloned Linux system, such as passwords and accounts, is the same as that of the cloned Linux system.
Build a complete set of Linux environment tutorial, how, enough detailed bar!!