![端口转发 虚拟机](https://img-blog.csdnimg.cn/img_convert/1f5b68dc01b07865dc2add3576981f84.png)
端口转发 虚拟机
![image image](https://img-blog.csdnimg.cn/img_convert/232ead28282249764d7caeb2133d1967.png)
VirtualBox and VMware both create virtual machines with the NAT network type by default. If you want to run server software inside a virtual machine, you’ll need to change its network type or forward ports through the virtual NAT.
默认情况下,VirtualBox和VMware都使用NAT网络类型创建虚拟机。 如果要在虚拟机中运行服务器软件,则需要更改其网络类型或通过虚拟NAT转发端口。
Virtual machines don’t normally need to be reachable from outside the virtual machine, so the default is fine for most people. It actually provides some security, as it isolates the virtual machine from incoming connections.
通常不需要从虚拟机外部访问虚拟机,因此对于大多数人而言,默认设置是合适的。 它实际上提供了一定的安全性,因为它将虚拟机与传入的连接隔离开来。
选择桥接网络 (Selecting Bridged Networking)
With the NAT network type, your host operating system performs network address translation. The virtual machine shares your host computer’s IP address and won’t receive any incoming traffic. You can use bridged networking mode instead — in bridged mode, the virtual machine will appear as a separate device on your network and have its own IP address.
使用NAT网络类型,您的主机操作系统将执行网络地址转换。 虚拟机共享您的主机的IP地址,并且不会收到任何传入流量。 您可以改用桥接网络模式-在桥接模式下,虚拟机将在网络上显示为单独的设备,并具有自己的IP地址。
To change a virtual machine’s network type in VirtualBox, right-click a virtual machine and select Settings. If you can’t click Settings, you’ll need to power off the virtual machine before maki