LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 02-21-2010, 07:28 PM   #1
openmind
Member
 
Registered: Feb 2010
Distribution: Debian
Posts: 32

Rep: Reputation: 16
Lightbulb 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! ) 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
 
Old 02-22-2010, 02:01 AM   #2
sqn
Member
 
Registered: Apr 2002
Distribution: Ubuntu, Arch, freeBSD, Slackware
Posts: 210

Rep: Reputation: 30
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).
 
Old 02-22-2010, 08:11 AM   #3
jvaldivia
Member
 
Registered: Sep 2007
Distribution: Debian Lenny
Posts: 61
Blog Entries: 2

Rep: Reputation: 19
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.
 
Old 02-22-2010, 08:11 AM   #4
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian PPC/i386/AMD64 6/7, Vista, XP , WIN7, Server 03/08
Posts: 1,284

Rep: Reputation: 91
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.
 
1 members found this post helpful.
Old 02-22-2010, 08:36 AM   #5
sqn
Member
 
Registered: Apr 2002
Distribution: Ubuntu, Arch, freeBSD, Slackware
Posts: 210

Rep: Reputation: 30
Cool

scheidel21:
oh thx... i was in a hurry. Yes that right, they are backwords
 
Old 03-04-2010, 04:36 AM   #6
openmind
Member
 
Registered: Feb 2010
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: 16
Cool

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?
 
Old 03-04-2010, 07:20 AM   #7
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian PPC/i386/AMD64 6/7, Vista, XP , WIN7, Server 03/08
Posts: 1,284

Rep: Reputation: 91
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.
 
Old 03-05-2010, 04:50 PM   #8
openmind
Member
 
Registered: Feb 2010
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: 16
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
VM_settings.png
I receive the above error message from all VMs
 
Old 03-10-2010, 07:13 AM   #9
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian PPC/i386/AMD64 6/7, Vista, XP , WIN7, Server 03/08
Posts: 1,284

Rep: Reputation: 91
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?
 
Old 03-11-2010, 01:20 PM   #10
openmind
Member
 
Registered: Feb 2010
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by scheidel21 View Post
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?
 
  


Reply

Tags
nat, virtualbox


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Machines Ramurd Slackware 17 09-10-2009 10:12 PM
Connect two virtual linux machines via virtual USB or serial WebBeing Linux - General 4 07-22-2008 07:26 AM
virtual machines fazliddin Linux - Newbie 3 04-15-2008 01:22 AM
Virtual Machines Berticus Linux - Newbie 8 10-18-2005 12:38 AM
Virtual Machines ZoZo Linux - General 2 09-23-2002 12:01 AM


All times are GMT -5. The time now is 03:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration