How to make communication with VMs, using Host-Only networks

Discussion about using the VirtualBox API, Tutorials, Samples.

How to make communication with VMs, using Host-Only networks

Postby eric-wu » 27. Apr 2017, 09:23

Hello.

I'm currently using VBox API 5.0.14 in C++ via Com.
My host OS is Win 10 and my guest is a 32bit other Linux.
I'm using the Host-Only network, but i'm net sure about how to solve my problems as follows,
1)I would like to telnet my VMs to make communications, so what interface is used to make communication or how to set the port using Com API to make telnet communication.
2)How could VM communicate with VM, and what interface or function is used to make communication.
I have already read the 5th part of the API,but have no idea.

Thank you for your help.

PS : Sorry if I make some english mistake.
eric-wu
 
Posts: 16
Joined: 24. Apr 2017, 14:06

Re: How to make communication with VMs, using Host-Only networks

Postby noteirak » 27. Apr 2017, 16:14

This has nothing to do with the API directly, at least from what I'm understanding.
If you need a software in the guest OSes to do comms, that's just a regular network software, just like you would do it on regular computers.

Are you trying to get the IP of a running VM perhaps?
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5198
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

Re: How to make communication with VMs, using Host-Only networks

Postby eric-wu » 28. Apr 2017, 14:00

so how can i telnet my VM's OS?
i have no idea how to find the port to telnet the VM
directly using telnet protocol(telnet 192.168.56.1(the ip is static setting by the Host-Only network))means telnet the host OS. So we need to telnet 192.168.56.1 xxxx to login the VM's OS.
eric-wu
 
Posts: 16
Joined: 24. Apr 2017, 14:06

Re: How to make communication with VMs, using Host-Only networks

Postby noteirak » 30. Apr 2017, 15:59

I'm not sure I follow...
What information are you missing? The guest IP or the port on which the telnet server is running in the guest?
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5198
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

Re: How to make communication with VMs, using Host-Only networks

Postby Perryg » 30. Apr 2017, 16:30

First you need to understand that host-only means just that. It allows communication between the host and guest only. Next there is no need for port forwarding since the guest receives a specific IP address in the range 192.168.56.* and if using DHCP it should be 192.168.56.101 by default unless you changed it. If you want to access the guest from anywhere else other than the host you need to use a different protocol than host-only.
Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to make communication with VMs, using Host-Only networks

Postby eric-wu » 1. May 2017, 14:47

noteirak wrote:I'm not sure I follow...
What information are you missing? The guest IP or the port on which the telnet server is running in the guest?

the port
eric-wu
 
Posts: 16
Joined: 24. Apr 2017, 14:06

Re: How to make communication with VMs, using Host-Only networks

Postby noteirak » 1. May 2017, 14:55

The only thing VirtualBox can help you with here is to run a process inside the guest OS (a CLI command per example) to retrieve that info, but that's it.
VirtualBox is at the hardware level and doesn't deal with network transport protocol.

There is an API example of running a process in VirtualBox here - You'll find similar classes and methods in the C++ API so this is just for the approach.
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5198
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

Re: How to make communication with VMs, using Host-Only networks

Postby eric-wu » 2. May 2017, 04:59

thanks a lot.
eric-wu
 
Posts: 16
Joined: 24. Apr 2017, 14:06


Return to The VirtualBox API

Who is online

Users browsing this forum: No registered users and 1 guest