Page 1 of 2

virtual appliance tied to one nic type

Posted: 31. May 2012, 07:03
by bhomass
I just created a virtual appliance for the first time. It was a Ubuntu guest on my development computer (Windows 8 host). I was expecting that this VA can be released to be used in anybody else's computer as a guest. When I tried running it on my laptop (also windows 8), I was surprised to find that it complains not finding the exact nic I had on the development system (a Realtek RTL8168B). The network was configured for Bridged mode.

What I am looking to do is to release this VA to be imported into all kinds of host env with no restrictiona. Is that even possible? or do I need to know exactly which host systems it it going to and configure specifically for them? in fact having to set up the development computer to have the exact same env just to create that virtual appliance?

Re: virtual appliance tied to one nic type

Posted: 31. May 2012, 09:22
by BillG
If you want to use bridged mode then it is not possible. Bridged mode has to link to the actual physical device which is in the physical host machine. It would be possible with NAT (since the vm then does not see the network device directly).

The OS installed in the OS sets up to use the devices it can see. The OS in the vm does not worry about most of the hardware in the host because it cannot see it. Linking to actual physical devices (such as using bridged networking) prevents moving the vm seamlessly between hosts.

Re: virtual appliance tied to one nic type

Posted: 31. May 2012, 19:16
by bhomass
so, how does NAT work. The person importing the VM will have to set up NAT in order to access server inside it? That means having admin privilege? is it possible to provide limited access right, so NAT configuration can still be done?

Re: virtual appliance tied to one nic type

Posted: 1. Jun 2012, 07:28
by BillG
NAT allows the guest to share the host machine's network connection (whatever that is). The vm knows nothing about the physical network (just as a client machine behind a NAT router knows nothing about the network beyond the NAT device).

Re: virtual appliance tied to one nic type

Posted: 2. Jun 2012, 00:28
by bhomass
thanks for the input.

I got this working using host-only mode. The virtual appliance has a fixed ip of 192.168.56.xxx. I picked this subnet because I can see on the host that there is a host-only adapter which uses this subnet.

The only concern I have is when this appliance to passed to a completely different env, would the host recognize its ip and automatically choose a 192.168.56.x subnet?

Re: virtual appliance tied to one nic type

Posted: 2. Jun 2012, 02:39
by BillG
With host only the client is set to get its network config automatically and gets it from DHCP on the host, so nothing is pre-configured in the guest.

Re: virtual appliance tied to one nic type

Posted: 7. Jun 2012, 13:00
by adrianh
Hi, I'm having similar problems with this. I've gone through the documentation here and still am having difficulty.

So as I see it, NAT allows for access to the outside from the guest to the host's network, but not the other way around. And host-only mode is a virtual network which is inaccessible to the outside. So is there some mechanism to jump on the local network automagicly? Or is a bridge the only way?

Thanks,


A

Re: virtual appliance tied to one nic type

Posted: 7. Jun 2012, 13:03
by mpack
"Bridged" is the only way for a VM to appear to be an equal participant on the same physical network as the host. To a router it looks like two different PCs (two MAC addresses) are sharing one cable. With NAT the router only ever sees one PC, i.e. the host PC, that's because the host spoofs addresses on outgoing packets, and redirects incoming packets provided an incoming packet was expected (NAT VMs can't receive unsolicited msgs, so can't be servers). Of course with "Host Only" or "Internal" networking modes there is no direct connection to the physical world at all.

Re: virtual appliance tied to one nic type

Posted: 7. Jun 2012, 13:37
by adrianh
So is there any way to make it so that the guest can receive unsolicited messages without having a bridge? There must be something. :(

Thanks,


A

Re: virtual appliance tied to one nic type

Posted: 7. Jun 2012, 14:21
by mpack
As I said in my previous answer, you must use bridged. What other solution could there be?

Re: virtual appliance tied to one nic type

Posted: 7. Jun 2012, 14:54
by adrianh
Having some process on the host machine that will open ports as the guest opens them thus allowing the guest to be accessible to the outside without being tide to the host's hardware. This can potentially lead to conflicts between the host and guest machines using the same port, but it could be acceptable under certain circumstances.

A

Re: virtual appliance tied to one nic type

Posted: 7. Jun 2012, 15:29
by adrianh
Are the network adapters at least enumerable so that the setup can be automated? Or is there a way of getting the names of the adapters so that vboxmanaged can be used?

Thanks,


A

Re: virtual appliance tied to one nic type

Posted: 7. Jun 2012, 16:10
by mpack
adrianh wrote:Having some process on the host machine that will open ports as the guest opens them thus allowing the guest to be accessible to the outside without being tide to the host's hardware.
If the host creates the connection then the outside world would see the host, not the guest - and you are describing NAT. If the outside world sees the guest then you are describing bridged. You may however want to read this thread, which suggests a different approach to the problem (not automated, but only setup once).

Re: virtual appliance tied to one nic type

Posted: 7. Jun 2012, 17:15
by adrianh
Meh... Still not really what I'm looking for. Perhaps some sort of port forwarder that is automated.


A

Re: virtual appliance tied to one nic type

Posted: 8. Jun 2012, 09:01
by BillG
What do you have against bridged mode? I would think it was the obvious solution to your problem.

The whole purpose of bridged mode it to make the vm behave just like any other machine on the LAN. It has its own IP address and has a direct connection to other machines on the LAN (and the gateway).

You could probably use some form of port forwarding but that depends on knowing the IP address of the vm. How would the host translate a client's name to an IP address? With bridged networking you have nomal access by name.