# Windows XP to Virtual PC port forwarding



## goodwince (Jun 17, 2008)

I have a virtual machine running Ubuntu Server 7.10, and the host operating system is Windows XP SP2. I want to connect to the virtual machine through the internet from anywhere on my network ( perhaps even from another network, but one step at a time). 

The virtual machine connects to the network through the host by Microsoft Loopback Adapter and ICS. I've tried port forwarding in the ICS settings; however, I could've done something wrong at this step. 

Any help is greatly appreciated.


----------



## thebof1993 (Jun 14, 2008)

You should have a look at this I hope it helps http://support.microsoft.com/kb/833134. I'm not exactly sure what you want but you seem to know what you want so there you go! :grin:


----------



## goodwince (Jun 17, 2008)

Ah, I could see where you could find my post slightly confusing.. I was writing the post and trying to find the solution at the same time. 

I apologize for any confusion, but the host and the guest can ping back and forth already. What I need help with is.. 

I want to be able type in the IP of my host computer in a webbrowser and it forward me to the virtual machine.

Hopefully that cleared a few things up. 

Thank you for your post though thebof1993 if I hadn't already gotten this portion working your reply would've been extrememly helpful.


----------



## thebof1993 (Jun 14, 2008)

Ok, no problems so do you want to be able to use the actual machine virtually or just access the file system!


----------



## lazareth1 (Jan 10, 2005)

Do you have a router? If yes, then you can set it up so that it'll foward any requests from the outside to the IP address of the virtual machine. Other than that, I don't think there's any other way to do it. Apart from a proxy etc.


----------



## goodwince (Jun 17, 2008)

Ok. I see what you guys are saying and I'm sorry if I'm being confusing. I have my virtual machine on the network through my host pc using ICS. 

Think of the virtual machine as a completely separate "real" computer, the host having two networking cards and one of the networking cards uses ICS to share its connection with the virtual machine. 

I want to be able to access the website on my virtual machine from anywhere on my network. I thought that if on my host I set it up to forward any incoming port 80 connections to the virtual machine's IP you might be able to see the website on my virtual machine.

Hope I am making some sort of sense?


----------



## johnwill (Sep 26, 2002)

Try losing ICS and changing the the configuration of the network for the virtual machine to a shared NIC.


----------



## lazareth1 (Jan 10, 2005)

I agree with john will but even if you did do what he suggested, You would still need some sort of forwarding to access the virtual machine on port 80. 

If theres no forwarding, the traffic doesn't know where to go. SO you don't have a router then?


----------



## goodwince (Jun 17, 2008)

Alright guys. The method I was using made it possible to access the website locally perhaps if I work on the port forwarding from shared nic, may be what I need. I will give it a try and let you know.

Thanks


----------



## lazareth1 (Jan 10, 2005)

Ok. After looking on google, I found that linux and MAC OS has built in ways to do port forwarding. I don't think Windows has such a thing but click the link below and get the software which will allow you to do what you need. 

http://www.quantumg.net/portforward.php


----------



## goodwince (Jun 17, 2008)

Hi guys, 

I did come up with a solution. I was unable to get it working using Microsoft Virtual PC [epic fail] so I switched to VMware Server. It actually had the port forwarding built in which made it SO much simpler. 

However, I am truly curious if I had two computers, computer '1' is sharing its connection with computer '2' and computer '1' somehow forwards all incoming connections on port 80 to computer '2.' How would I accomplish such a feat.? Not necessarily using ICS, but some other method would work also.

Thank you guys for all of your help. I wouldn't even care to try and get it working with Microsoft Virtual PC since it is working in VMware Server, but I have given it to others to "play" with already. So I would like to keep them going on the same path.


----------



## lazareth1 (Jan 10, 2005)

Have you read my last post? That would solve the problem If you did have to real computers.


----------



## goodwince (Jun 17, 2008)

Ah, sorry. Sunday I didn't work on any projects and on Saturday the Virtual PC was not one of them. Weekend jumbled my thoughts and I was excited to get it working at all. I did try the link you sent me and I found the program pretty freaking sweet. Its very simple program for what I need to be done. I got the GUI one up and running, inserted the port-forwarding, it said it was getting a incoming connection then it said unable to connect. 

Any ideas lazareth?


----------



## af3 (Jun 18, 2008)

Be sure that you are not using the NAT setting in the virtual machine's network settings.


----------



## goodwince (Jun 17, 2008)

Thanks af3 I appreciate the heads up. But I tried it using both NAT and ICS, however still no such luck.. although the comments on the page lazareth1 sent said that others were having trouble with it also.


----------



## af3 (Jun 18, 2008)

It would make sense that the NAT method did not work, because if the host has:
192.168.2.2

The VM would have something like
192.168.100.2

ICS would work if you forwarded the ports of the host machine... I think, but if MSVPC does not support listening then I suppose it is not possible. In theory ICS should work...


----------



## goodwince (Jun 17, 2008)

Hmm.. perhaps you're correct about the MS VPC not accepting the listening, but it just doesn't make sense because I connect to the VPC using my browser if I type in the IP of the Virtual Machine. It just doesn't forward properly. 

Portforward sees the incoming connection but is unable to push it through to the VPC. Hmm.. I wish I had an extra network card to test this application..


----------



## af3 (Jun 18, 2008)

What is the IP of the virtual pc, and what is the host machine's internal/local IP? I believe they are communicating through a software based network adapter.

What mode is the virtual pc's networking in?


----------



## goodwince (Jun 17, 2008)

My virtual pc is using Microsoft Loopback Adapter to connect to the host machine. Its IP is a local IP 192.168.0.9, my host computer has its original IP address. It wasn't given another one to specifically associate it with the virtual machine. The Default Gateway for the virtual machine is 192.168.0.1


----------



## af3 (Jun 18, 2008)

Does the host IP have the same subnet as the virtual? Does the virtual have the same IP as the host? If not, the only way to forward ports through the host would be to do it in the network settings, but if it is not implimented by the software you are out of luck.

Are you using MSVPC 2004 or 2007?


----------



## goodwince (Jun 17, 2008)

MSVPC 2004 for starters.. 

The host IP is static and uses a completely different gateway than the VPC. There subnets are actually different. My host's is 255.255.240.0 while VPC is 255.255.255.0.

Rigging it up so that my host computer could connect to my virtual pc through browser would open it up to the ability of port forwarding. From what I read on ICS I understood that it works similarly to the way a router shares out the connection to computers on the network.. I guess perhaps not?


----------



## af3 (Jun 18, 2008)

I would have to find a solution for this later tonight. I have MSVPC 2007. They seem to have ironed out quite a few issues from the 2004 release. There simply MUST be a way to do this. I have always wanted to run a DMZ'd VM just to see what IPs would exploit an exposed PC.


----------



## lazareth1 (Jan 10, 2005)

Lol. its not working because the VPC is on another network from the host. ICS doesnt replace a router and it won't do any routing. You can get this working by putting the VPC on the same network as the host.


----------



## af3 (Jun 18, 2008)

If you select a device and not NAT, shouldn't it start working?


----------



## goodwince (Jun 17, 2008)

I decided to just stick with VMware server.. it seems to play nicer with different OS's anyways. But af3 I tried it with NAT and still no such luck. Perhaps the new VPC would run much better.


----------



## af3 (Jun 18, 2008)

Perhaps Microsoft had never encompassed the need for port forwarding or even DMZ'ing a Virtual PC.

NAT would by definition, not work without port forwarding.

I guess it would not truely be a Virtual PC if it could accept connection from non-virtual PCs but then one could argue against that point. Who knows what they were thinking...


----------



## bassemtotti (Jan 16, 2009)

hello,, i want to ask how can i know my windows pc port ?? thx


----------



## af3 (Jun 18, 2008)

Couldn't tell ya bassemtotti. It could be anywhere from 1 to 65535 depending on what service you are asking about. Windows File Sharing port is 445 if that is what you mean.


----------



## bassemtotti (Jan 16, 2009)

thx much but what do u mean by it depends on what server u asking about ??


----------



## bassemtotti (Jan 16, 2009)

sryy i meant service as u were writing


----------



## lazareth1 (Jan 10, 2005)

bassemtotti said:


> hello,, i want to ask how can i know my windows pc port ?? thx


What do you mean by 'windows PC port' ? What are you trying to do?


----------



## bassemtotti (Jan 16, 2009)

ok well well it's a programm on my iphone mobile wants from me to write the ip address and windows pc port of my computer,,that's it


----------



## lazareth1 (Jan 10, 2005)

Wats the program called? What does it do?


----------



## bassemtotti (Jan 16, 2009)

it called remotpad and it makes the iphone mouse to the pc


----------



## jsliw (Feb 18, 2009)

If you are using vmware workstation,go to Manage Virtual Networks,choose the NAT tab,edit the vmnetHost,choose port forwarding,add the incoming TCP or UDP,fill in your host port which want to forward to your virtual machine and also virtual machine IP and port,restart services.


----------

