Ubuntu is installed in the virtual machine, the virtual machine cannot be connected to the Internet, and the host and the virtual machine file transfer

Reprinted from: https://blog.csdn.net/zxg201207120227/article/details/78306392

Note: ! ! ! The virtual machine cannot access the Internet: If the virtual machine has just been installed, the host is connected to a wireless network, but the virtual machine cannot access the Internet, remember to directly change to bridge mode and uncheck the duplicate network connection .
Pictured:
As shown
Painful attempt (can be skipped): This problem bothered me for one afternoon and one night, looking for various blogs. I also heard from the teaching assistant that virtual machines are more likely to encounter various network problems, and suggested that I install dual systems. But I have tried several times, the computer does not know why, it can only boot the dual system from the U disk; if it is partitioned separately, it will freeze when restarting after the installation is successful, and then every time the boot is turned on, the screen will be black, and the dual system cannot be entered normally. It didn't work out all night. ——-Remember a painful lesson that the Ubuntu virtual machine cannot connect to the Internet.

Now on to the topic:

Requirements: Establish a linux environment for learning and development.

Environment: windows64

软件:Vmware Workstion 10,ubuntu-15.10-desktop-amd64.iso

content:

1. System installation

1. First, we download VMWare 10 from the Internet, and then install it, as shown in Figure-1.

Figure-1 Virtual machine software interface

2. Then click to create a new virtual machine, as shown in Figure-2.


Figure-2 Installation Wizard

3. If you select Typical, the system installation will be performed according to the default configuration. Select Custom here, click Next, and the compatible products and version restrictions of the virtual machine version will be displayed. Just follow the default. Generally, the software is backward compatible. , version high and basic functions of previous versions are available, as shown in Figure-3.

image 3

4. Click Next, we will jump to the interface of installing the guest operating system. There are three methods. One is to install the CD-ROM. If you put a system disk in the CD-ROM, then this option will allow you to choose. Otherwise, you cannot select. The second method is to directly select the files of the installation system, but if you follow this method, you will be asked to fill in the username and password of the Linux system after this operation, as shown in Figure-4.

Figure 4

Do you feel that if you fill in the account password of the system now, you will have to fill it in again when the system is installed? You can try this question yourself. I chose to install this operating system later, as shown in Figure-5.

Figure 5

5. Next, we select the corresponding information for the operating system installed by ourselves according to the linux we installed. Because I want to install Ubuntu, I chose as shown in Figure-6.

Image 6

6. After that, you will be asked to fill in the name of the virtual machine and the location where the virtual machine is stored. This is to gossip. It is best to fill in the location of the virtual machine in a general folder, because the virtual machine will generate a lot of files. It is very messy to put two systems together, and after installing multiple systems, there may be file name conflicts in a folder, and deletion will delete all the contents under the folder, etc. My general folder is VMSystem, and then a folder is created under this folder to save the system to be installed. It is best to write the version of the system behind the folder, because you may install multiple Linux or other systems of the same type, so you can distinguish them, as shown in Figure-7.

Figure-7

7. The next step is to select the number of processors, which should be selected according to your own computer. If your real physical machine has multiple processors, you can fill in the corresponding number of processors. The basic installation is the default, and the system will automatically Match, as shown in Figure-8.

Figure-8

8. Then there is the choice of memory, select according to the default, and the interface will prompt. As shown in Figure-9.

Figure-9

9. Then select the network type, according to the default type, as shown in Figure-10.

Figure-10

10. In the next two steps, you follow the default and choose according to your actual disk type. I will omit it here, so we jump to the step of selecting the disk, because it is a new virtual machine we created and does not need a real disk. The physical storage address, so follow the default, as shown in Figure-11.

Figure-11

11. Next, jump to disk size allocation. The default 20G is enough for your development and use. Fill in according to your needs and split the virtual disk into multiple files. It may be more efficient to search for disk partitions and create more file index, so I chose to store as a single file, as shown in Figure-12.

Figure-12

12. Next, you will be confirmed whether to create the disk file you just filled in, OK. As shown in Figure-13.

Figure-13

13. At this time, the interface shows some information we just filled in, because the system file of the virtual machine has not been specified before, so now we need to specify it, click Customize Hardware, then click the new CD/DVD on the left column, and select "Use ISO" on the right Image file", and then find the operating system you want to install (of course you have to download the ISO image file in advance), as shown in Figure-14.

Figure-14

14. Click OK, we have filled in the information in the virtual machine, and the next step is to install the system, as shown in Figure-15.

Figure-15

15. Click to start this virtual machine for system installation, as shown in Figure-16.

Figure-16

16. The next step is to determine the fool-like installation all the way, there is no need to choose anything, unless you want to do the linux disk mount settings, memory swap size settings, non-virtual machine installation tutorials can be found at: http://www.linuxidc .com/Linux/2014-10/108430p2.htm , otherwise just follow the prompts.


17. At this point, we have installed the system and restarted it, as shown in Figure-17.


Figure-17

Second, linux networking

If your computer is plugged into a network cable, you can now enjoy the fun of networking in the installed Ubuntu, but if your computer is connected to the wireless network, you cannot access the Internet at this time, as shown in Figure-18. But don't worry, just set it up, you have to be familiar with the network configuration, otherwise you will have some difficulties here, but don't worry, I will explain my steps to you in detail.

Figure-18

1. First, we open the setting interface of the virtual machine. We choose the bridging method for the network adapter, directly connect to the physical network, and do not use the NAT mode to share the host IP address to access the Internet, as shown in Figure-19.

Figure-19

2. At this time, you can't access the Internet either. We click on the menu Edit -> Virtual Network Editor of the virtual machine. If there is a type of bridge mode in it, then we will install the options in Figure-20. If there is no one Type of bridge mode, we need to add a network type.

Figure-20

3. We have to look at the ip configuration of this machine, enter ipconfig, the configuration information of my machine is shown in Figure-21. The IP address is 192.168.1.10, the subnet mask: 255.255.255.0, and the default gateway: 192.168.1.1.

Figure-21

4. Now perform network settings in linux, and the setting information is shown in Figure-22. The IP address must not conflict with other local area networks. The subnet mask and default gateway can be filled in the same as the local IP. The DNS server is a domain name resolution server. Originally, the network does not recognize special characters. Network access is performed in the form of ip address, but ip is difficult to remember, so aliases are used instead, and the function of the domain name server is to resolve these aliases into ip for communication. For example, if a DNS server is not set, you cannot ping www.baidu.com  , But you can ping 202.108.22.5,. The DNS server I set is the gateway of the router, so I first access 192.168.1.1 when I go online, and then the router helps me to resolve the domain name. For the latter, you can search the domain name server address on Baidu, and just fill in one on the Internet, for example: 8.8.8.8

Figure-22

3. File transfer between local machine and virtual machine

Method 1: Use the terminal to enter the command to install
Enter the command: apt-get install open-vm-tools-desktop fuse
Ps: The newly installed system needs to execute the following command apt-get update; apt-get update is to synchronize /etc/apt/sources .list and an index of the sources listed in /etc/apt/sources.list.d to get the latest
packages. apt-get upgrade performs an update on the system. The apt-get update command fails with many errors, Not Found[IP:****], indicating that the file address in the /etc/apt/sources.list file may be out of date,
so you need to update the sources.list, or make a replacement.
Method 2: Use the tools that come with the VMWare virtual machine and
click to install vmware Tools in the menu of the virtual machine; at this time, the contents of the media CD will be automatically opened in linux, and only the .tar.gz file is useful, and the execution is as shown in Figure-23 command for the picture shown.


Figure-23

After decompressing the gz file, the vmware-tools-distrib folder will be decompressed, enter this folder and execute the command: sudo ./vmware-install.pl, and then press the enter key all the way to OK. As shown in Figure-24. Why copy to another
directory for decompression? Because the home VMWare tool is in the form of a CD, it is hung in the media directory and cannot be decompressed in the media directory.


Figure-24

        </div>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325699298&siteId=291194637
Recommended