Installation of VMware tools and Ubuntu networking

Preface

This document will demonstrate the installation of VMware Tool and networking in NAT mode.
The document is divided into the following three parts:

  1. 1. Why should you install VMware Tool?
  2. 2. VMware Tool installation steps
  3. 3. Access the Internet in Ubuntu

text

1. Why should you install VMware Tools?

  1. File sharing between the host and the virtual machine can be realized, and free drag and drop is supported.
  2. The mouse can move freely between the virtual machine and the host
  3. Copied content can be pasted directly.

2. VMware Tools installation steps

  1. Directly click Install VMware Tools in the virtual machine in the upper left corner .
    Insert image description here

  2. After performing the previous step, this pop-up window will pop up, click Yes .
    Insert image description here

  3. After waiting for a while, a page like this will pop up in the virtual machine. We copy the VMwareTools-10.3.22-15902021.tar.gz inside to the desktop (if it does not appear, you can eject the cd in the document and execute it again. steps above).
    Insert image description here

  4. We use CTRL+ALT+T to open the terminal.
    Insert image description here
    Use command

sudo passwd

to set the root user's password. First enter the virtual machine user password, and then enter the set root user password twice.
Insert image description here
Let’s modify the username and use

su root

Command to enter root mode, enter the password you just set, and you can enter the root user. Then we use

gedit /etc/hostname

Modify the hostname
Insert image description here
and use

reboot

The command can be used to restart the computer (the operation of changing the host name requires restarting the computer to take effect).
Add a command

hostname k
bash

k is the name of the host name we want to change.
Insert image description here

The host name can be modified temporarily (it will become invalid after restarting).

  1. We enter the desktop folder, check whether there are copied files, and then decompress it.
    The commands used are:
cd 桌面
ls
tar -zxvf VMwareTools-10.3.22-15902021.tar.gz

Insert image description here

  1. After correct decompression, it should be as shown in the figure below. Use the ls command to view the file, enter the decompressed file, then use ls to view the file, and use
./vmware-install.pl

To install
Insert image description here

After installing the command, we will first be asked to choose, as shown below, enter y, and then press Enter.
Notice. Don't press Enter directly here.
Insert image description here
Then it will also ask us some content, and just press Enter for the rest. Until the following picture appears, VMware Tools is successfully installed.
Insert image description here

  1. This is the same as changing the user name. It will take effect only after restarting, so let’s review the command again.
reboot

At this time our VMware Tools can be used.
Insert image description here
At this point we can turn off the free stretch button, and you can see that the desktop still covers the entire page, which means that VMware Tools can be used normally.

  1. We delete the two files remaining after the installation of the desktop and use the command
rm -rf 文件名

This command can delete even the contents of the folder.
So don’t delete the desktop folder directly to save trouble, otherwise you will see a bunch of folders on the desktop next time you turn on the computer.

3. Access the Internet in Ubuntu

Accessing the Internet is an essential issue. For the NAT mode we set up at the beginning, we can operate it directly on the host. NAT mode is also enough for us to use. It is worth noting that NAT mode uses a virtual switch to share the network between the virtual machine and the host, so they are not on the same network segment. I will publish the differences between the three network modes later.
Steps:

1. Select the network we are using in the host 's network adapter . Right-click -> Properties -> Sharing, check Allow other network users to connect through this computer's Internet connection , and then select a private network connection in the network connections below . Be sure to choose VMware Network Adapter VMnet8 , which is a NAT mode connection.
Insert image description here

  1. At this time, we enter in the browser of the virtual machine
www.baidu.com

You can open the Baidu page. At
Insert image description here
this point, this document ends.

Guess you like

Origin blog.csdn.net/weixin_62846577/article/details/131360426