LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-18-2016, 02:47 AM   #1
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Rep: Reputation: Disabled
How to connect my network from virtualbox?


My host os is debian8 ,virtualbox 5 was installed on it,there is a debian8 too installed on my virtualbox.
The network configuration is /etc/network/interfaces in host machine.
Code:
auto wlan0
iface wlan0 inet manual
wpa-driver nl80211
wpa-roam /etc/wpa_supplicant.conf
iface default inet static 
address 192.168.1.101
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
How to set the debian8 in my virtualbox to connect my home network?
For the debian8 in the virtualbox,
It is no use to set the /etc/network/interfaces as following.
Code:
 
auto eth0
iface lo inet loopback
iface eth0 inet static
address  10.3.94.100
network  255.255.255.0
gateway  192.168.1.1
And it is no use to set it as following too.
Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
How to set the confi file to make debian8 in the virtualbox to connect my home network?
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2016-03-18 15:46:19.jpg
Views:	32
Size:	243.1 KB
ID:	21187  

Last edited by luofeiyu; 03-18-2016 at 03:30 AM.
 
Old 03-18-2016, 05:19 AM   #2
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
Shut down debian and add a new adapter (ex. Adapter 2 tab) and choose host only adapter. Configure the adapter to use as a dhcp server. This would normally create a network starting with 192.168.x.x. Start debian and reload network interfaces. You should be able to ping debian 192.168.x.x from your host.
 
Old 03-18-2016, 06:30 AM   #3
przemo
Member
 
Registered: Feb 2016
Location: cork.ie
Distribution: Slackware-current
Posts: 162

Rep: Reputation: Disabled
why not NAT?
 
Old 03-18-2016, 06:55 PM   #4
cnamejj
Member
 
Registered: Mar 2015
Distribution: Ubuntu
Posts: 37

Rep: Reputation: Disabled
My recommendation is to make sure the network interface for the VM is set to "Bridged Adapter" in Virtualbox. And if that's already the case, then open the "advanced" options and click the button to come up with a new MAC address. You should be able to statically configure the IP or use DHCP as long as the network is in bridging mode.
 
Old 03-18-2016, 08:56 PM   #5
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Original Poster
Rep: Reputation: Disabled
I have set NAT and click cable connected ,reboot ,connect to my network.
The ip address can't be set to be static.

Last edited by luofeiyu; 03-18-2016 at 08:57 PM.
 
Old 03-18-2016, 09:02 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,409
Blog Entries: 28

Rep: Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166
If you want to connect your VM to your home network so that it can communicate with other machines in the network (including the host machine), in the VM "network" settings, choose a "bridged" adapter.

In the network settings dialog, when you select "bridged," there will be a collapsed dialog for "Advanced." When you click to expand that, you may see several choices for the "Adapter Type." Usually, VirtualBox defaults to the correct choice, but occasionally you need to try the other available choices to find the correct one.

A "host only" network creates a network within the host machine. If you have two VMs set on "host only," they can see each other, but they cannot see the host network or the big wide world. The virtual network exits only within the host.

Here's some more information: https://www.virtualbox.org/manual/ch...etworkingmodes

Last edited by frankbell; 03-18-2016 at 09:06 PM.
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] VirtualBox guest randomly fails to connect to network edmundo_ba Slackware 2 02-24-2016 01:27 PM
[SOLVED] Connect to Samba over virtualbox spwnt Linux - Server 2 12-12-2012 06:29 PM
VirtualBox RHEL 5 cannot connect to internet bjbq4d Linux - Networking 4 10-07-2011 11:48 AM
how do i get virtualbox to connect to the printer i have baronobeefdip Linux - Software 8 08-25-2010 11:02 PM
VirtualBox - connect to remote host Mig21 Linux - Software 0 03-16-2009 06:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration