• 请不要在回答技术问题时复制粘贴 AI 生成的内容
ifane
V2EX  ›  程序员

mac 如何访问局域网 win 中的 Hyper-V 虚拟机呢?

  •  
  •   ifane · May 11, 2019 · 2839 views
    This topic created in 2647 days ago, the information mentioned may be changed or developed.

    楼主入了 MBP,但手上的 XPS 也想利用起来,故有了把 XPS 当虚拟平台来用的想法,用 Hyper-V 创建多个虚拟机,Mac 连上去。

    • 楼主在 XPS 上用 Hyper-V 创建了 Centos 虚拟机(采用外部交换机),虚拟机内ip addr得到地址为192.168.199.218。宿主机(外部交换机)IP 地址为:192.168.199.143
    • 在 Win 上通过ssh [email protected]可成功访问虚拟机。
    • 在 Win 上通过netsh interface portproxy add v4tov4 listenport=7022 listenaddress=127.0.0.1 connectport=22 connectaddress=192.168.199.218 添加宿主机与虚拟机 端口映射 7022->22。
    • 在 Win 上防火墙内入站规则中,添加开放端口为所有。
    • 在 MBP 上通过ssh [email protected]:7022ssh [email protected]均无法访问虚拟机。

    大家有啥好办法么?

    2 replies    2019-05-11 15:55:05 +08:00
    CitizenR
        1
    CitizenR  
       May 11, 2019 via iPhone
    建议改 hyper-v 交换机连接模式为桥接。看你给的地址,可能就是桥接模式,试试 ssh 直接连 centos 的地址。
    tomhuang
        2
    tomhuang  
       May 11, 2019
    印象中 hyper 都是虚拟交换机,只是外部 内部和专用的区别。记得将虚拟交换机设置为外部。然后在 mac 上直接 ssh 虚拟机的 ip 地址,注意虚拟机的防火墙策略。
    与 win 的防火墙无关
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5763 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 02:03 · PVG 10:03 · LAX 19:03 · JFK 22:03
    ♥ Do have faith in what you're doing.