Windows 7上的VirtualBox端口转发不起作用 [英] VirtualBox Port Forwarding on Windows 7 not Working

查看:823
本文介绍了Windows 7上的VirtualBox端口转发不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 7上的VirtualBox端口转发不起作用

VirtualBox Port Forwarding on Windows 7 not Working

我试图通过端口转发从Windows 7主机SSH到我的VirtualBox上,但是VirtualBox不会打开该端口进行监听.我可以通过打开VirtualBox GUI并通过该终端导航来连接到它,但是我不能通过主机上的标准ssh客户端进行连接.我希望能够在主机上的ssh上为访客建立SSH.

Im trying to ssh onto my VirtualBox from my Windows 7 host via port forwarding, but VirtualBox wont open the port for listening. I can connect to it by turning on the VirtualBox GUI and navigating via that terminal, but I cannot connect via a standard ssh client from my host. I want to be able to ssh on port 2222 on my host to the guest.

这是我的设置:

Host: Window 7 SP1
Guest: Ubunto Ubuntu 12.04
VirutalBox: 4.3.26
Host Processor: Intel Core i7 920

来宾计算机被配置为NAT,并且启用了127.0.0.1的端口转发,以将主机端口2222到来宾端口22.

The guest machine is configured as a NAT and port forwarding is enabled for 127.0.0.1 for host port 2222 to guest port 22.

来宾上ifconfig的输出:

eth0    inet addr:10.0.2.15 Bcast:10.0.2.255 Mask: 255.255.255.0

来宾上ps -ef | grep sshd的输出:

root    625 1   0   12:27   ?   00:00:00    /usr/sbin/sshd -D

来宾上netstat -ant | grep 22的输出:

tcp     0   0   0.0.0.0:22  0.0.0.0:*
tcp6    0   0   :::22       :::*

但是在主机上,netstat -ant | grep 2222不显示任何内容.

But on the host, netstat -ant | grep 2222 doesnt show anything.

但是在VBox.log中,我有这个:

In the VBox.log however I have this:

00:00:03.413790 NAT: set redirect TCP host 127.0.0.1:2222 => guest 10.0.2.15:22
00:00:03.424301 supR3HardenedErrorV: supR3HardenedScreenImage/LdrLoadDll: rc=VERR_LDRVI_UNSUPPORTED_ARCH fImage=1 fProtect=0x0 fAccess=0x0 \Device\HarddiskVolume2\Windows\mfnspstd64.dll: WinVerifyTrust failed with hrc=Unknown Status 0x800B0101 on '\Device\HarddiskVolume2\Windows\mfnspstd64.dll'
00:00:03.424422 supR3HardenedErrorV: supR3HardenedMonitor_LdrLoadDll: rejecting 'C:\Windows\mfnspstd64.dll' (C:\Windows\mfnspstd64.dll): rcNt=0xc0000190
00:00:03.424476 NAT: failed to redirect TCP 127.0.0.1:2222 => 10.0.2.15:22

最后一行看起来像是可疑的,但是没有任何关于它为什么无法重定向的线索.我已经尝试了其他各种帖子和论坛中的以下所有内容,但无法让它在主机上的任何端口上监听:

The last line looks like the suspect but there's no clue as to why it fails to redirect. I've tried all of the following from various other posts and forums but cant get it to listen on any port on the host:

  • 关闭防火墙
  • 更改了端口
  • 在BIOS上启用了VT-X
  • 已禁用的Hyper-V
  • 尝试了VirtualBox的许多不同版本

任何帮助将不胜感激.在装有OS-X的Mac Book上可以正常工作.

Any help would be much appreciated. Works fine on my Mac Book with OS-X.

推荐答案

您是否在计算机设置中设置了转发?

Did you set forwarding in machine settings ?

  1. 要转发VirtualBox中的端口,请先通过选择菜单中的设置"选项来打开虚拟机的设置窗口.

  1. To forward ports in VirtualBox, first open a virtual machine’s settings window by selecting the Settings option in the menu.

在虚拟机的配置窗口中选择网络"窗格,展开高级"部分,然后单击端口转发"按钮.请注意,只有在使用NAT网络类型时此按钮才处于活动状态–仅在使用NAT时才需要转发端口.

Select the Network pane in the virtual machine’s configuration window, expand the Advanced section, and click the Port Forwarding button. Note that this button is only active if you’re using a NAT network type – you only need to forward ports if you’re using a NAT.

使用VirtualBox的端口转发规则"窗口转发端口.您无需指定任何IP地址-这两个字段是可选的.

Use VirtualBox’s Port Forwarding Rules window to forward ports. You don’t have to specify any IP addresses – those two fields are optional.

也在此处: 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆