LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   LAN between virtual machines (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/lan-between-virtual-machines-790647/)

openmind 02-21-2010 08:28 PM

LAN between virtual machines
 
hi

I have two network cards, and tree network interfaces(one of them vbox2 is virtual, added via VBoxAddIF.sh, I don't fully understand the script, I just used it and it worked a little! :D) and now I'm curious how can I set up a little LAN between Guest and Host OSs. Should I set up network via NAT or should I configure bridge. I think if NAT is easier.
I just don't know what is better.
If it's trivial matter(for me it's not), just point me into manual or direction :D

sqn 02-22-2010 03:01 AM

The bridge options means that the Vbox is on a separate lan from your host (diferent ip calss) and your host is configured as gw. If NAT it means that your vbox is in the same lan as your host (same ip class).

jvaldivia 02-22-2010 09:11 AM

If you just want the devices on both networks to communicate each others perform this 2 steps:

1 clean iptables

iptables -F
iptables -t nat -F

enable packets between interfaces:

echo 1 > /proc/sys/net/ipv4/ip_forward

Use as GW on all devices your linux box and you will have communication.

Bridge:

Same IP address on all the interfaces

NAT:

To change the IP address.

Be more specific on what you need.

scheidel21 02-22-2010 09:11 AM

sqn you have it backwards. Bridged means it is on the same LAN as the host, NAT means it is natted behind the host, where the VM can see LAN network resources but the host and any other computer on the network cannot see the VM. Host only networking means the host and the VM can see eachoter but the VM does not have any LAN or Internet access, unless you setup a gateway or proxy on the host for the VM, and then you have another option in some VM environments, including VirtualBox and that is a Internal Network option, where VMs can talk to each other but have no way to talk to the host or the LAN, unless you setup a second NIC in the VM or a VM with two NICS acting as a gateway for the other VMs.

sqn 02-22-2010 09:36 AM

scheidel21:
oh thx... i was in a hurry. Yes that right, they are backwords :)

openmind 03-04-2010 05:36 AM

I just need to set up LAN and I don't mind which method it would be, I didn't decide.<br>
when I start VM, I get this message:
Code:

Failed to initialize Host Interface Networking.
VBox status code: -3100 (VERR_HOSTIF_INIT_FAILED)

VM network is attached to host interface
Maybe I should write something in "Setup Application" and "Terminate Application" areas in VM network settings? :confused:

scheidel21 03-04-2010 08:20 AM

I don't know what that error message is, but did you try another VM attached to the same Virtual HD, it might be a corruption of the Virtual machine. Furthermore, you are confusing me, host only networking won't connect you to any network, except to the host computer, unless you assign a second NIC with a different type of networking option.

openmind 03-05-2010 05:50 PM

1 Attachment(s)
At first I receive this message
Code:

Failed to open '/dev/net/tun' for read/write
access. Please check the permissions of that node.
Either run 'chmod 0666 /dev/net/tun' or change the
group of that node and make yourself a member of that
group. Make sure that these changes are permanent,
especially if you are using udev.
VBox status code: -3100 (VERR_HOSTIF_INIT_FAILED).

then I changing owner of /dev/net/tun to user, who is starting the VM and then I receive error, mentioned earlier

Settings of my VM are looking like this
Attachment 2914
I receive the above error message from all VMs

scheidel21 03-10-2010 08:13 AM

Are you using any VPN software? a brief search finds that a similar error message occurs if the tun device or tap device trying to be used is no wexclusive to VB. Additionally did you try setting the tun device back to the original user and chmodding it to 0666? Finally if you are using udev have you made changes int he appropriate places?

openmind 03-11-2010 02:20 PM

Quote:

Originally Posted by scheidel21 (Post 3892809)
Are you using any VPN software? a brief search finds that a similar error message occurs if the tun device or tap device trying to be used is no wexclusive to VB. Additionally did you try setting the tun device back to the original user and chmodding it to 0666? Finally if you are using udev have you made changes int he appropriate places?

No, I'm not using any VPN software, as far as I know ;)

"if the tun device or tap device trying to be used is no wexclusive to VB"
I don't get this expression, can you, please, explain more? Unfortunately, I'm not English native speaker.

About udev. For long time I am looking curiously on it.You are right, it seems good time to learn finally what it is :)
Maybe you can give me advice on better free program than VirtualBox?


All times are GMT -5. The time now is 12:44 AM.