解决了!好棒!
该问题已被作者解决...
总体而言,端口转发对我来说是有用的。
目前我想添加一个端口,80 到 8080,主机到客户端,但我无法在我的主机上使用端口 80。
例如
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort, Value: 22
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort, Value: 2222
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol, Value: TCP
有效,我可以通过 ssh 登录 www.mydomain.tld:2222。bam!
尝试 80 至 8080
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/nginx/GuestPort, Value: 8080
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/nginx/HostPort, Value: 80
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/nginx/Protocol, Value: TCP
不起作用,netstat 也没有显示 host-linux 上 80 端口的任何监听情况。
我不知道如何调试,跟踪日志给我:
00:00:00.373 Changing the VM state from 'CREATING' to 'CREATED'.
00:00:00.374 Changing the VM state from 'CREATED' to 'POWERING_ON'.
00:00:00.374 NAT: set redirect TCP host port 2222 => guest port 22 @ 10.0.2.15
00:00:00.374 NAT: set redirect TCP host port 80 => guest port 8080 @ 10.0.2.15
00:00:00.374 NAT: failed to redirect TCP 80 => 8080
00:00:00.375 Changing the VM state from 'POWERING_ON' to 'RUNNING'.