• ARTICLES
SEARCH

How-To Geek

Allow Access to a VMware Virtual Machine(NAT) From Another Computer

If you are running a virtual machine on your computer, you may want to access that virtual machine from another computer. Let’s use an example: Say you have an Ubuntu virtual machine with Apache running on port 80, and you want to show other people on your network to access the website you are hosting.

We’re going to assume that the virtual machine is using NAT, and has been assigned an IP address of 192.168.23.128.

First open the Manage Virtual Networks start menu item:

Click on the NAT tab, and then click on Edit. You will see the NAT Settings dialog:

Click the Port Forwarding button, and you will see this dialog:

Now we are finally on a screen we can actually use. We’re going to use port 8080 on the host machine. We enter the ip address for the ubuntu virtual machine, and port 80. These ports could be any ports.

We should be able to test this out by going to http://localhost:8080 on our host pc. We can give out the url to our host machine by replacing localhost with the host computer IP address.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 12/7/06

Comments (41)

  1. Scrooge

    Nice, thank you!

  2. JC

    It works for me in the loopback interface in local machine only.

    If my IP address is X.X.X.X I can access

    http://localhost:8080

    but no:

    http://X.X.X.X:8080

    Any idea?

  3. Dani

    I have the same problem
    http://localhost:8080 works but http://x.x.x.x:8080 don’t work from other machines.

  4. JC

    Well, I’d forgot to route the external network in the virtual machine.

    Now it works. Sorry.

  5. Dani

    Please, can you give some indication of how do you do it?
    Do you refer to the vmware NAT configuration or is necessary some other configuration?

    Thanks in advance.

  6. JC

    No. I don’t refer to the nat configuration in vmware

    My guest system was a SCO Unix. I needed to add the routes (by using the route command) to my guest could see the externeal network.

    Example: route add -network external_net -netmask external_mask nat_device_router

    Hope it helps you.

  7. Dani

    I have it working now… but I can’t tell why it don’t work before (:
    Thanks for the answer!!

  8. tyliong

    Thank you very much. your little tutorial has helped me so much.

  9. jonw

    Good tutorial. Is there a way to access a webserver or ssh server running on a virtual machine from the internet (outside the local network)? I’d really love to see an indepth article about this.

  10. GK

    I follow the above example and update the NAT thru vmcfg. However, when I try http://localhost:8080 on the host pc. It does not work. What did I miss ?

  11. Nima

    You should config firewall on ur host machine to open ports that NATed to the guest VM.

  12. shopank

    it’s very cool tips here which you mentioned here which i honestly say even i was not available in vmware forum. ok i did all this configuration step by step but still i cant access the webserver in my host browser!!?
    in both , host & guest, the fire wall is off & maped the port for forwarding as mentioned above, & restart the vmware & still not working?(the vmware is in NAT connection mode)
    i wish someone can help me bcz it’s being one week that i struggling with this problem :)

  13. shopank

    anybody there plz help me!!

  14. sudhakar Mani

    I am able to access the Linux VM Guest from the host machine.But I couldn’t access this from any other machines on the LAN.

    For Example : My virtual machine Ip is 192.168.79.32(NAT)

    I could access this from my host machine : http://192.168.79.32:8005

    But if I try the same from another machine on the lan I couldn’t.Even I couldn’t ping 192.168.79.32 from LAN.

  15. Rehan Yousuf

    Sudhakar,

    I do not know what other machine OS you are using, but on windows hosts file located in DriveLetter-Windows-system32-drivers-etc. add this line
    Xxx.Xxx.Xxx.Xxx VMmachinename
    Change xxx to vm guest ip address and VMmachine name.

    -Rehan

  16. Felix

    Hi

    I setup up my port forwarding in vmware from host port 8080 to vm port 80 but like the others on this forum I could only connect to the guest vm using http://localhost:8080 and not 10.64.9.12:8080 on local host or over the network. I have my firewall turned off also.

    Is there anything else that might block this? It seems my vmware is setup correctly but there is something else I am not doing.

    Errol

  17. Anil

    Hi All the localhost ip on the machine itself is 127.0.0.1 its the loopback address. if you are trying to use ip for localhost you should use 127.0.0.1 or change this setting at DriveLetter-Windows-system32-drivers-etc as Rehan said and user host machine’s hostname.

    Hope this helps.

  18. vaish

    i have got a virtual machine on a windowsserver 2003 platform…through vm editor i have done the port mapping with local host .but now iam not getting the webpage on local host it self by typing http:\\localhost:8080…help me out…

  19. tyler

    ok so got every thing set up like you said but it dos not work i a using 6.0 vmware help me if you can

  20. kometa

    Great article! Finally can make my sites visible from the internet as well. Thanks.

  21. Benjamin

    Nice tutorial. Let’s try it again minus assumptions and with more details.

  22. blognusa

    Why not just switch networking to bridged mode… you can rdp into the machine too, if you enable it.

    This configuration is easier imo, because your picking up an ip from your home router, and not the virtual switch

    Think “Bridged” networking !

    Why double NAT when you dont have to, (unless you go static).

  23. Tom

    Let´s say that I have virtual machine with Linux OS (I am not sure that apache is in this system) with vmware and I need to access from windows server 2003. what I need to do? could you help me?

  24. Michael

    Hi there:

    I am only using VMWare player and I could find menu for “Manage Virtual Networks”.

    Do I need to install other VMWare component besides VMWare Player?

    thanks,

    Michael

  25. AUSSIE

    great mate Thanks

  26. Guest

    @blognusa
    You can’t use bridged mode for wireless cards.

  27. Mr.Sarcasm

    Hi All,

    I am using windows 7 64 bit and I have installed Ubuntu 10.10 in VMWare(latest version). I am able to ping it from the same Laptop….But when I try pinging it from another PC (With windows 7 32 bit) in the same Lan Network, I couldnt get connected….Please help me ….. :-(….(I use homegroup to get the both systems connected)

  28. Clockman

    Great, thanks man! Now tell me how to do it on VMWare Player …

  29. KichwaKibovu

    I have two machines connected back to back(using static IPS). I have installed VMware 2.0 on one of them and used Bridged network. I can ping the the host and the other computer from the guest. The problem is i cannot ping/access the geust machine from the other computer. Please help

  30. KichwaKibovu

    Ok, cracked it. i disabled the damn firewall on the Guest PC

  31. Duy

    Hi,

    I have a strange problem but cannot find out why it is:

    My office has one server called kserver1 (host), another virtual machine called kpoint(guest) using Microsoft Virtual PC installed on it.

    From another computer within the same network, I can ping kpoint(guest) but not the host.

    What problem is this?
    Please help,
    DH

  32. Jay

    After successfully getting this to work it was entirely WAY TOO SLOW (3-10sec /req), so I did a google and found someone on VMware community with same problem

    http://communities.vmware.com/thread/148224

    His solution: NetworkActiv AUTAPF @ http://www.tucows.com/preview/330100

    Program is self explanatory and super quick, my localhost is pointing to vmware, however the UI program looks like it was designed in vb6 it will run as a service once setup no need to tinker with. Would be interested if anyone knew a better application but it does the job for me

  33. Rafo

    Thanks for the post. It was very useful for me. I was trying to enable remote desktop from my network to my Virtual Machine (Windows XP), using NAT.

    First I edited my Virtual Network to NAT my 3389 TCP port (Remote Desktop) on my Virtual Machine to a random TCP port (I used 5454, could be anyone).

    Then, from any desktop from my network, I used the Remote Desktop Conection to XXX.XXX.XXX.XXX:5454 (where XXX.XXX.XXX.XXX is my Physical Host IP and 5454 is the NAT’ed port).

    I hope this can help someone.

  34. Steve said...

    On vmplayer
    SHUT DOWN = POWER OFF the VM
    edit virtual machine properties
    Network Adapter – Change NAT to Bridged.
    Click ok
    Restart VM

  35. nev

    @steve

    hi. if i do that, can i already access my web server in the vm? i think my host and vm does not have static ip, is that ok? btw, my host is win xp and my vm is win 7.

    thank you.

  36. nev

    ^ can i already access the vm web server from the host, is what i meant.

    tia.

  37. Dr. Dhulipala

    Hi All,

    you can access a virtual machine using third party software. for example, if u r running windows OS, you can access that using virtual desktop software, which is inbuilt on all windows. If, you want to access the UNIX or LINUX machine u can use putty to connect using ip of OS. you will not see and GUI desktop in putty. Again if u want GUI of UNIX machine use VNC server to connect.

    Thats it,

    Bye

  38. hemanta

    Dear All,
    i create a VM in which i installed win2003 server. i want to make it as DHCP server, through which other computer in my lab can get the ip address from the DHCP server. can you sugest how to do it.

  39. Conrad

    Same thing happened to my Windows 7 host, which runs VMware Player 3.1.4 which in turn runs Ubuntu 11.04.

    In Ubuntu, I can access my web application at 192.168.110.120:8088
    (In Windows 7, requests to port 8099 are configured by vmnetcfg.exe to be IP-forwarded to http://192.168.110.120:8088)
    In Windows 7, I can access 172.22.69.101:8099

    But from another Windows box on the local area network, I could not access 172.22.69.101:8099

    Thanks be to God and everyone here, eventually I figured out that this was caused by the firewall setting of my Windows 7 box.

    Once I’ve changed the setting of Inbound Connections from Block(default) to Allow, I can access 172.22.69.101:8099 from anywhere on the local area network.
    (The Inbound Connection setting sits at Start->Control Panel->System and Security->Windows Firewall->Advanced settings->Windows Firewall Properties->Inbound connections)

    Hope it helps.

    ——————————–
    sudhakar Mani wrote:

    I am able to access the Linux VM Guest from the host machine.But I couldn’t access this from any other machines on the LAN.

    For Example : My virtual machine Ip is 192.168.79.32(NAT)

    I could access this from my host machine : 192.168.79.32:8005

    But if I try the same from another machine on the lan I couldn’t.Even I couldn’t ping 192.168.79.32 from LAN.

  40. Karthik

    Hi,

    I want to access my virtual machine in the lab using my laptop through internet .Is there a way to do si?.If yes please tell me the procedure to do.

    Thanks in advance,
    Karthik

  41. Drow

    I am using a thinclient boxes running from a host machine. I need to time control all the thinclient systems from the host PC. To achieve this, I need another PC that will house the server version of the timer while this host PC will house the client version of the same timer. Rather than purchase another PC, I opted to run Vmware machine; this Vmware machine, I intend to use as Host PC for all the thinclients housing the client timer software, while the host OS will bow become the second and house the server timer software. Both will run Windows XP. I need help in configuring the Vmware to allow remote desktop sessions from the thinclient stations. Also the sever timer on the host OS will connect and control the client timer running in the Vmware box that is now the host PC for the thinclients. Please help me with this info a step by step (pictorial guide really appreciated) on making this happen. Many thanks.

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!