Monday, December 13, 2010

VirtualBox TCP/IP Communication (Host and Guest)

I want to experiment with C# and Python's socket programming. I don't want to use 127.0.0.1 anymore in my sample program as I want to have a simulation of like two computers sending and receive data via TCP/IP.

My solution is to use a VirtualBox with another Windows OS in it.

I am struggling with this since yesterday but I was able to get it by today. Here is a video procedure.
(The video lagged a lot because my PC is too slow to record and run the virtualbox at the same time. The mouse pointer is also not visible on the video, maybe it is because of the Guest Additions on the VirtualBox).

Here are the procedures:

1. On Host and Guest: Turn off the firewall. My preliminary setting: firewall turned off and No connection to the internet.
2. On Host: Bridge a LAN connection and the VirtualBox Host-Only Network. Then assign an IP on it. (On the example, 192.168.70.4)
3. On Guest: Go to network settings, Choose a network adapter, choose "Attached to Bridge Adapter" and choose the name "MAC Bridge Miniport".
4. On Guest: Run the Virtual OS.
5. On Guest: Set the IP Address of the Ethernet Adapter. (On the example, 192.168.70.5).
6. On Host and Guest: Ping both the address to be able to confirm that there is a connectivity.

Additional test: Hyperterminal was used to test if handshaking will occur and if messages can be sent.

On Future: I will be replacing the Virtual OS with an Ubuntu and use python for socket programming.

No comments:

Post a Comment