Page 1 of 1

using HIF on secondary network card to connect the host

Posted: 19. May 2008, 21:14
by tomaskCZ1
I would like to bring second interface on guest system(WinXP) just to be able to route from host (ubuntu). I would still like having on guest system card 0 NATed as the primary card for connecting the internet, so I wouldn't be depending on connection type from ubuntu (ethernet,wifi,gsm modem - I use all of them sometimes).

So the second interface on guest, new interface on ubuntu would be only for connecting from ubuntu to windows.

Any suggestions, please, how to achieve that the most simple way, if possible without any side effect to both system ? :)

I hope I was able to explain that properly.

Posted: 19. May 2008, 23:26
by Sasquatch
It's in Engrish, but I understand what you want. If I'm right, you want to have a two-way communication with the Host and Guest system, without the hassle of a bridge and the like for further network browsing. If this is the case, then all you need is one Host Interface, put an IP on it, put the Guest VM on the same range and subnet and you're done.

I assume you have the binary version from the site, so I will give the directions for that.
Type the following in a terminal with your correct username:

Code: Select all

sudo VBoxAddIF vbox0 tomaskcz1
Now add that interface to your Guest VM network options. When done, edit the /etc/network/interfaces file with root privileges and add the following:

Code: Select all

auto vbox0
iface vbox0 inet static
address 172.16.0.1
netmask 255.255.0.0
After this, run 'sudo ifup vbox0', then start the VM. The command should not give any errors. Use 'ifconfig' to see if the interface is actually running. This is all the config you need to be able to let the Guest and Host communicate with each other.

In this example, I used the 172.16.x.x range (class B private network). You are free to use any IP address you like, as long as it's a private network address. See http://en.wikipedia.org/wiki/Private_Network for more info about this in case you don't know what a private network is.

Posted: 20. May 2008, 15:23
by tomaskCZ1
Thank you for the answer, this is exactly what I need. I was able to find procedures like that in User manual, but wasn't sure which one is suitable for this case.

Unfortunately I have a version 1.5.6 compiled by guideline from 'http://www.howtoforge.com/virtualbox_ubuntu' and it doesn't appear to have VBoxAddIF etc. binaries installed.

I had to use the compilation way with changes to DevPcBios.cpp file, because I needed XPs to see the real OEM info of my Dell laptop to avoid unsucccessful activation.

So I'll probably try to extract these files from the binary version, because they seem no to get compiled and if it works then attempt to add the interface.

Posted: 20. May 2008, 16:38
by tomaskCZ1
Not so easy, as usually :) Simple copying the VBox* files and modprobing manually the tun module still brings this message :

Failed to take down the old interface in order to replace it with the new one.
The interface may still be in use, or you may not currently have sufficient
permissions to do this. You can replace the interface manually using the


So it doesn't work with compiled VirtualBox, looks confused.

Either if there is a way how to get it working on compiled VBox from sources or how to get into binary VBox my OEM information any help would be appreciated.