How to do port forwarding on VMWare Player 14.1.2 (Ubuntu 18.04 guest, Windows 10 host)?

后端 未结 2 1201
没有蜡笔的小新
没有蜡笔的小新 2020-12-16 07:06

I have a VMWare Player (14.1.2 build-8497320) running a Ubuntu 18.04 guest on a Windows 10 host. The Ubuntu guest has a LAMP stack that runs a few web applications. I am usi

相关标签:
2条回答
  • 2020-12-16 07:46

    VMWare Player supports port forwarding over NAT natively:

    In the file C:\ProgramData\VMware\vmnetnat.conf put under section [incomingtcp] a line like:

    80 = 192.168.80.128:80
    

    Then restart the VMWare NAT Service :

    net stop "VMWare NAT Service"
    net start "VMWare NAT Service"
    


    Source/credits: https://hitchhikingtheweb.wordpress.com/2014/09/02/portforwarding-with-vmware-player-and-nat/

    Also: VMWare documentation of this

    0 讨论(0)
  • 2020-12-16 07:51

    You can do it using SSH Tunneling for example.
    From windows you open a tunnel from the windows port 80 to the ubuntu port 80.
    You can do it using Putty on Windows and having the ssh deamon running on ubuntu, which I guess you should already have.

    There are many tutorials on how to do this. I'll add just one link, but you can always google it and find one that suites you.

    Portforwarding with SSH (Putty)

    For the possible changes in the guest’s ip:

    If you can’t fix the ip in settings then perhaps you can edit the windows hosts file and add a host name for the current Ubuntu ip. Then build the urls using the host name. If the ip changes you change it in the hosts file.

    0 讨论(0)
提交回复
热议问题