是否可以使用 Visual Studio 远程调试 VirtualBox?
我在 Sun 的开源 VirtualBox 上运行我们的应用程序的不同版本,是否可以远程调试该应用程序带有 Visual Studio 的主机操作系统?问题是,在 Visual Studio 中,当我想要连接到远程计算机时,我必须输入计算机名称或 IP,并且无法从主机对我从虚拟机中获取的 IP 执行 ping 操作。
我主要对调试本机代码感兴趣(这样我就可以在没有身份验证的情况下运行),但如果也有一种调试托管代码的方法,请告诉我。
我应该注意的是,主机操作系统是 Vista,来宾操作系统是 XP。
感谢马克,我让一切正常工作,我将记下我必须采取的所有步骤以供将来参考:
I'm running different versions of our application on Sun's open source VirtualBox, is it possible to remote debug the app from the host OS with Visual Studio? The problem is that in Visual Studio when I want to attach to a remote machine I have to enter either a computer name or IP and the IP I get from within the virtual box isn't pingable from the host machine.
I'm primarily interested in debugging native code (so I can run with no authentication) but if there's a way to debug managed code too please let me know.
I should note that the host OS is Vista and the guest is XP.
Thanks to Mark I got things working, I'll note all the steps I had to take for future reference:
- Change the VM network from
NAT
toBridged Adapter
(have to power off the VM first) In the guest OS change the default security setting to
Classic - local users authenticate as themselves
as described here:Control Panel -> Administrative Tools -> Local Security Policy
Local Policies -> Security Options
- Change
Network access: Sharing and security model for local accounts
to Classic - local users authenticate as themselves
Reboot guest OS
- Disabled the firewall on the guest OS
- If
msvsmon
can't do it by itself firewall.cpl
- If
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您的来宾设置有适用于 netowking 适配器的 NAT。进入访客设置,选择网络,如果网络类型是 NAT,则将其切换为桥接。 NAT 产生不公开的地址范围;而桥接将为来宾操作系统提供与主机位于同一子网上的 IP。
It sounds like your guest setting have NAT for the netowking adapter. Go into the guest setting, choose networking and if the type of network is NAT switch it to Bridged. NAT produces an address range that is not public; whereas, bridged will give the guest OS an IP on the same subnet as the host.