LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-17-2011, 11:59 PM   #1
greendragons
LQ Newbie
 
Registered: Nov 2011
Distribution: Ubuntu 11.04
Posts: 8

Rep: Reputation: Disabled
Question Network Connection to Virtual Machine?


Hello,
I am running Ubuntu 11.04 and running Slackware on virtual box, i am unable to connect Slackware to Ubuntu..
Code:
root@darkstar:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:17:7f:3d  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:34 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1940 (1.8 KiB)  TX bytes:1940 (1.8 KiB)

root@darkstar:~# ping 10.116.28.219
connect: Network is unreachable
while on Ubuntu vmboxnet0 is up.....
how to setup connection between my ubuntu machine and my virtual machine....


Thnx!!
 
Old 11-18-2011, 01:31 AM   #2
davemguru
Member
 
Registered: Apr 2006
Location: London
Distribution: Pclos,Debian,Puppy,Fedora
Posts: 87

Rep: Reputation: 42
Quote:
Originally Posted by greendragons View Post
Hello,
I am running Ubuntu 11.04 and running Slackware on virtual box, i am unable to connect Slackware to Ubuntu..
Code:
root@darkstar:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:17:7f:3d  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:34 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1940 (1.8 KiB)  TX bytes:1940 (1.8 KiB)

root@darkstar:~# ping 10.116.28.219
connect: Network is unreachable
while on Ubuntu vmboxnet0 is up.....
how to setup connection between my ubuntu machine and my virtual machine....


Thnx!!
Your 'ifconfig' doesn't show any IP address assigned to eth0 inside your virtual machine.
So, in the VirtualBox Manager Gui - for the slackware VM - look at the settings for NETWORK.
You will have 4 adapters.

On the tab for adapter 1;
1) is it enabled?
2) Under "Attaached to" what type of network have you got? NAT/Bridged/Internal etc. ?
3) Click the Advanced button - is "Cable Connected" checked?
4) The "Adapter type" could be your problem - if the one that is selected is not supported "out of the box" by slackware.

What sort of "virtual networking" do you want? In other words - what do you want the Ubuntu host to be able to do (if anything) with the slackware VM? Maybe you don't want the slackware VM to be able to "get into" or "see" anything in the Ubuntu host?
OR
Maybe you want the slackware VM to see ONLY the Ubuntu host and not get out to the outside world? There are all sorts of combinations.
The default suits a lot of situations and that is NAT.
https://www.virtualbox.org/manual/ch06.html Chapter 6 of the virtualBox manual discusses the many networking options.

There is also a log of what was setup at runtime on the VM --> right click on the name of the VM in the VirtualBox Manager Gui - you should see the choice of "Show Log". The window that opens will have a log "tab" for each execution/run of the VM. The most recent run being the current tab. You could save the log and post it here. It may help.
Dave
 
1 members found this post helpful.
Old 11-18-2011, 01:48 AM   #3
Randymanme
Member
 
Registered: Jul 2009
Location: Columbus, OH, USA
Distribution: Ubuntu 12.04; Knoppix 7
Posts: 121

Rep: Reputation: 16
Hi,

I had the same problem when I installed Mint 12 in Virtualbox with Mint 11 hosting. Here's what I did to solve that problem. Power off your guest and select settings (you can't change settings with the virtual machine running or saved in the machine state). Under Network, Adapter 1, check "Enable Network Adapter." It was set to "NAT" by default (and didn't work). Under "Attached To," I changed it to "Bridged Adapter." This bridged my guest's (Mint 12) network interface to the host's (Mint 11) internet connection. That fixed it.

Last edited by Randymanme; 11-18-2011 at 02:10 AM. Reason: Correct grammer
 
Old 11-18-2011, 02:28 AM   #4
greendragons
LQ Newbie
 
Registered: Nov 2011
Distribution: Ubuntu 11.04
Posts: 8

Original Poster
Rep: Reputation: Disabled
When machine is powerd off then in tab 1 it shows enabled and NAT is selected....
but whn machine boots up that enabled check is no more there....
Im using default NAT
And adpater is Intel Pro 1000MT....

---------- Post added 11-18-11 at 02:29 AM ----------

Quote:
Originally Posted by Randymanme View Post
Hi,

I had the same problem when I installed Mint 12 in Virtualbox with Mint 11 hosting. Here's what I did to solve that problem. Power off your guest and select settings (you can't change settings with the virtual machine running or saved in the machine state). Under Network, Adapter 1, check "Enable Network Adapter." It was set to "NAT" by default (and didn't work). Under "Attached To," I changed it to "Bridged Adapter." This bridged my guest's (Mint 12) network interface to the host's (Mint 11) internet connection. That fixed it.
I tried that but it wasn't woring either....
 
Old 11-18-2011, 03:28 AM   #5
greendragons
LQ Newbie
 
Registered: Nov 2011
Distribution: Ubuntu 11.04
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by davemguru View Post

What sort of "virtual networking" do you want? In other words - what do you want the Ubuntu host to be able to do (if anything) with the slackware VM? Maybe you don't want the slackware VM to be able to "get into" or "see" anything in the Ubuntu host?
OR
Maybe you want the slackware VM to see ONLY the Ubuntu host and not get out to the outside world? There are all sorts of combinations.

Dave
I want to setup server on host and test it from guest... for learning purpose...
how to configure it to connect to host... the blue screen at the bottom shows that it is connected to the host...but i can't ping... i tried to configure using netconfig but i couldn't succeed...
 
Old 11-19-2011, 07:31 AM   #6
davemguru
Member
 
Registered: Apr 2006
Location: London
Distribution: Pclos,Debian,Puppy,Fedora
Posts: 87

Rep: Reputation: 42
Quote:
Originally Posted by greendragons View Post
I want to setup server on host and test it from guest... for learning purpose...
how to configure it to connect to host... the blue screen at the bottom shows that it is connected to the host...but i can't ping... i tried to configure using netconfig but i couldn't succeed...
OK - couple of things.
Because you want to test a host application from your guest. Then NAT will not be the ideal solution. Vbox has something perfectly suited to what you want. BTW did you read the chapter 6?.

First - CHANGE YOUR NETWORK ADAPTER TYPE from "Intel Pro 1000MT" to something a lot simpler - I suggest PCnet-PCI II (Am79C970A) BECAUSE - (and it's only a guess) slackware may not support the more advance gigabit adapter. Start with the "lowest common denominator first" is a good adage. The Am79C970A is much older - and therefore more likely to be supported by older distros. From Chapter 6 ---
Quote:
The PCNet FAST III is the default because it is supported by nearly all operating systems out of the box, as well as the GNU GRUB boot manager. As an exception, the Intel PRO/1000 family adapters are chosen for some guest operating system types that no longer ship with drivers for the PCNet card, such as Windows Vista
Second - LEAVE IT AT NAT - boot the system (and I mean boot/Start - don't restore a SAVE) and then just run a web browser... any web browser. If you can "see the outside world" - browse a page or two - then the adapter is working.

You know you can RIGHT click the little blue screen icon at the bottom of your VM encompassing window - the one for networks - and then you can change SOME things - while your VM is running - like you can connect/disconnect the cable. Just like you can in real life.

There is a "mini dhcp server" built in to the VM when you run it with NAT (it is turned off for bridged networking -- coz it assumes you will either use a static IP or you have a DHCP server somewhere on your REAL network. AGAIN - from chapter 6
Quote:
The virtual machine receives its network address and configuration on the private network from a DHCP server integrated into VirtualBox. The IP address thus assigned to the virtual machine is usually on a completely different network than the host. As more than one card of a virtual machine can be set up to use NAT, the first card is connected to the private network 10.0.2.0, the second card to the network 10.0.3.0 and so on.
The virtual dhcp server and DEFAULT GATEWAY is 10.0.2.2
Your VM machine's address will be 10.0.2.x - where x >3
(address 10.0.2.3 is reserved for a virtual tftp server - in case you wanted to network/PXE boot your os)

The address of your host from inside the VM will be 10.0.2.2
So, if you had a webserver running on your host at port 80 then to access it from within your VM you would use http://10.0.2.2:80.

When your VM is running with NAT it is insulated from the outside world and from your host. This is why it is the default (and safest). You can "get to it" by using the "port mapping" facility. BUT NOT WITH A STANDARD PING.
However, as suggested by other contributers - you may want to use BRIDGED rather than NAT for reasons outlined in chapter 6 of the virtualbox manual.

Some people would setup a new/development server - e.g. sql server or web server in a VM and test that way. One could even setup a "suite of machines" clients and servers in a group of VM's - all of which can "see each other" in their own private network.
I STRONGLY urge you to read chapter 6 of the virtualbox manual.

Dave


If I have helped - can you "click my rep" and indicate that I have done so.
 
1 members found this post helpful.
Old 11-19-2011, 12:03 PM   #7
greendragons
LQ Newbie
 
Registered: Nov 2011
Distribution: Ubuntu 11.04
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by davemguru View Post
OK - couple of things.
First - CHANGE YOUR NETWORK ADAPTER TYPE from "Intel Pro 1000MT" to something a lot simpler - I suggest PCnet-PCI II (Am79C970A) BECAUSE - (and it's only a guess) slackware may not support the more advance gigabit adapter. Start with the "lowest common denominator first" is a good adage. The Am79C970A is much older - and therefore more likely to be supported by older distros. From Chapter 6 ---

Thnx alot... i was able to connect guest to host.. i used PCnet III adapter...the whole problem was coz of adapter only...
now i can set up server on host and test on guest...
 
  


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] linux virtual machine does not get network d4v3 Linux - Networking 2 06-07-2011 04:47 PM
how to see network speed of virtual linux machine? pinga123 Linux - Newbie 10 05-10-2011 02:41 AM
[SOLVED] Improving network speed to/from a virtual machine taylorkh Linux - Virtualization and Cloud 4 05-21-2010 04:36 PM
Fresh Ubuntu Instrall - Virtual machine, strange connection problems. Cellophane Linux - Networking 4 08-13-2009 04:16 AM
How to run virtual Machine and Internet connection sharing on Fed8 Linuxllent Fedora 6 02-12-2008 04:27 AM


All times are GMT -5. The time now is 11:21 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration