目标
环境:WINDOWS+VirtualBox虚拟机(Debian)。
debian运行一个WEB服务器,端口是9001。
试图从WINDOWS浏览器中,访问这个WEB服务器。
设置
网络,连接方式改为桥接网卡。如图:
查看虚拟机IP
quantum6@debian:~$ ifconfigenp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet 192.168.1.103 netmask 255.255.255.0 broadcast 192.168.1.255inet6 fe80::a00:27ff:fe0a:f82b prefixlen 64 scopeid 0x20<link>ether 08:00:27:0a:f8:2b txqueuelen 1000 (Ethernet)RX packets 3472 bytes 4084577 (3.8 MiB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 2645 bytes 933777 (911.8 KiB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536inet 127.0.0.1 netmask 255.0.0.0inet6 ::1 prefixlen 128 scopeid 0x10<host>loop txqueuelen 1000 (Local Loopback)RX packets 12 bytes 636 (636.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 12 bytes 636 (636.0 B)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
访问
http://192.168.1.103:9001/p/test3
如果觉得《主机通过网络访问虚拟机VirtualBox的WEB服务器》对你有帮助,请点赞、收藏,并留下你的观点哦!