VirtualBox Ubuntu20.04 virtual machine network settings

Table of contents

1. Virtual machine network connection setting

2. Ubuntu network proxy settings

 3. git settings proxy

4. Some random thoughts


1. Virtual machine network connection setting

Open virtualBox and click Settings

 Click Network and select NAT network as the connection method.

 If the interface name in the above interface is not specified, return to the main page of the manager, click Management --> Click Global Settings

 Then click in sequence according to the interface serial number in the picture below, and NatNetwork will appear in the column under the activity name.

 After completing the above operations, return to the network connection mode and select the NAT network.

2. Ubuntu network proxy settings

Open the Ubuntu settings page, select Network, and set the network proxy to manual.

The content to be filled in is as shown below

 

 The IP can be viewed directly on the host. Open the cmd command prompt and enter the ipconfig command. As shown in the figure, you need to use the VirtualBox IP

 Port number Enter the proxy port number used by the host. After that, the Ubuntu virtual machine browser works normally

 3. git settings proxy

git config --global http.proxy http://192.168.56.102:7890
git config --global https.proxy https://192.168.56.102:7890

4. Some random thoughts

Regarding the virtual machine network settings, I read a lot of blogs by big guys before and set up proxies. There was no problem with the virtual machine browser accessing the Internet, but I kept getting errors during git clone, such as timeout or connection refusal. Later, I fiddled with it myself and found that git could succeed. But regarding the NAT network and network address translation types in the network connection method provided by Virtualbox, I am not sure what the difference is, because when I use the network address translation method, git still fails. 555 welcomes the comments section to give you some advice!

Guess you like

Origin blog.csdn.net/weixin_54106682/article/details/127748729