This project is read-only.

Virtual Machine connection

Jun 8, 2009 at 9:32 AM

Hi,

in order to test my application I need to use a connection to a virtual machine created with the VMware software.

Is it possible to connect to this virtual machine created in the same PC as the Windows XP application from which I want to create the connection?

I have tried to create a VPN connection as explained in Youtube, but it hasn´t worked. Also, I need a synchronous connection to the address

192.168.44.5 which is the one used by the virtual machine.

Furthermore, I would like to ask if it is possible to connect to a existing LAN (I mean, to another computer in a network, not a virtual machine).

Thanks.

Jun 8, 2009 at 2:49 PM

"Is it possible to connect to this virtual machine created in the same PC as the Windows XP application from which I want to create the connection?"

Yes. When I was doing my initial testing I was connecting to a VPN server hosted by a virtual machine. You need to make sure you have the virtual server configured correctly, otherwise you may not be able to connect to it from your host machine. I can't help you in that regard.

"I have tried to create a VPN connection as explained in Youtube, but it hasn´t worked."

You may want to create a VPN entry manually. The CreateVpnEntry method on RasEntry is a very basic connection that does not do anything but a standard PPTP or L2TP connection. I would suggest creating the entry through Network Connections that works and has been tested, then use the RasPhoneBook class to look at the entry in code. You can look at which settings you need. Once you've done that, create the RasEntry manually, set the properties on the RasEntry, and then add it to the RasPhoneBook to programmatically create the connection.

 "Also, I need a synchronous connection to the address 192.168.44.5 which is the one used by the virtual machine."

You just need to use the RasDialer Dial method, rather than DialAsync to dial the connection synchronously. That component uses the event-based asynchronous pattern as described http://msdn.microsoft.com/en-us/library/wewwczdw.aspx

"Furthermore, I would like to ask if it is possible to connect to a existing LAN (I mean, to another computer in a network, not a virtual machine)."

I don't see why not, you just need to change the PhoneNumber on the entry you're trying to connect with.