[KPUG] Oddities with VM setup

Gryphon Shafer gryphon at gryphonshafer.com
Mon Sep 17 08:17:46 PDT 2012


Greetings Jon,

Basically, two things need to be configured for networking to function 
properly: First, the VM settings (from the GUI) need to be set 
correctly. Second, the settings inside Debian instance need to be set. 
For the VM settings, start by considering the total number of interfaces 
the host system has. My laptop, as an example, has two: wired and 
wireless. I've elected to set the wired as eth0 and wireless on eth1. 
Use bridged network adapter when setting up these sorts of adapters. 
Then there should be 1 additional adapter called a host-only adapter. 
For my laptop, that's set to eth2. Also, you may want to check the 
host-only VM settings under File, Preferences..., Network. DHCP should 
be disabled, and the IPv4 address should be 192.168.56.1 with a subnet 
mask of 255.255.255.0.

Inside your virtual Debian instance, check your /etc/network/interfaces 
to be sure these align with the adapters you set in the VM environment. 
Then check your interface current running configuration with "ifconfig". 
(You don't need to be root to run this command provided ifconfig is in 
your path. Otherwise, do a "whereis ifconfig" to locate the executable, 
then run that. Or become root, or use "sudo ifconfig".) This will tell 
you all your current configurations for your interfaces. If the list is 
too long, you can "ifconfig eth0" to get just the first interface. If 
the interface is down or not configured, it won't display. You can take 
an interface up or down with "ifup eth0" and "ifdown eth0" (which will 
have to be run as root or under sudo).

If after doing all this you're unable to ping out to 192.168.56.1 (from 
your virtual instance on 192.168.56.2 through your host-only adapter, 
which in my case is eth2), try ifdown-ing all but your host-only 
adapter. To ping out to Google from your virtual Debian instance, you'll 
need to use one of your bridged adapters. With all of them down except 
your host-only, if you ifup one of your active bridged adapters, you 
should be able to ping out to Google.

Gryphon


On 9/17/2012 12:10 AM, Griffin Kelton wrote:
>
> It sounds like you have something wrong with your VM setup. Corrupted 
> install? Preferences issue? I'm not sure what the trouble is. Sorry I 
> couldn't help.
>
> On Sep 17, 2012 3:05 AM, "Jon" <halfbrown at gmail.com 
> <mailto:halfbrown at gmail.com>> wrote:
>
>     Griffin,
>
>     See the attached for what my Network options looks like. My
>     Adapter(s) 2-4 are grayed out and unclickable, so I can't add
>     anything else.
>
>     Jon
>
>     From: Griffin Kelton <griffin.kelton at gmail.com
>     <mailto:griffin.kelton at gmail.com>>
>     Reply-To: Kitsap Perl Users Group <kpug-pm at pm.org
>     <mailto:kpug-pm at pm.org>>
>     Date: Sunday, September 16, 2012 11:53 PM
>     To: Kitsap Perl Users Group <kpug-pm at pm.org <mailto:kpug-pm at pm.org>>
>     Subject: Re: [KPUG] Oddities with VM setup
>
>     Jon,
>
>     You need to somehow enable eth1 to be your host-only adapter.
>     Otherwise, like you said, the connection will by default timeout
>     because 192.168.56.2 won't be online. Just to clarify, this is
>     what my disabled network adapters look like:
>     http://cl.ly/image/3S3a170H1u3C. This is what they look like when
>     enabled: http://cl.ly/image/1y1f0G3N2I3X. Are you saying that when
>     they are disabled, you are unable to select the "Enable Network
>     Adapter" check box?
>
>     In regards to your ssh client, I used Terminal as well. =)
>
>     Griffin Kelton
>     (919)306.1135 <tel:%28919%29306.1135>
>     www.griffinkelton.com <http://www.griffinkelton.com>
>
>     Please consider the environment before printing this email.
>
>
>     On Mon, Sep 17, 2012 at 2:34 AM, Jon <halfbrown at gmail.com
>     <mailto:halfbrown at gmail.com>> wrote:
>
>         Lady (Ladies?) & Gentlemen,
>
>         I've run into an odd snag on the VM install for my lovely
>         MacBook Pro, so I thought I'd post to the group to see if
>         anyone has any help because my Google-Fu is sending me around
>         in circles.
>
>         I got all the way to Section E, "Establish a non-console/SSH
>         connection to the local host-only address" and finally hit
>         said snag. I cracked open SSH, typed in:
>
>         ssh --p 22 --v jon at 192.168.56.2 <mailto:jon at 192.168.56.2>
>
>         And received the following error:
>
>         ssh: connect to host 192.168.56.2 port 22: Connection timed out
>
>         This got me thinking. Dangerous, yes, but thinking nonetheless. :)
>
>         During Section D, "Debian setup", I ran into a previous snag.
>         Several times I kept getting a problem wherein I would receive
>         the error message:
>
>         Failed to bring up eth1.
>
>         Oddly enough the way I (accidentally) got around that was
>         through a bug I typed into /etc/network/interfaces detailing
>         the auto eth1 and then face eth2 (et c). Nothing alerted me to
>         this until later on in the process when I began debugging my
>         "odd snag" I initially mentioned. Anyhoo...  I figured
>         something had to be right since I did all of the apt updates
>         between Section D and Section E, so obviously I had networking
>         out to the inter-tubes. Admittedly, while I'm pretty good with
>         code, hardware has been a mystery to me since circa 1996. And
>         even then, not so much.
>
>         So I've been mucking around Google trying to see what's up,
>         heading to virtualbox.org <http://virtualbox.org> to do the
>         same, and all that jazz. But I'm stumped and was hoping
>         someone could at least point me in the right direction.
>
>         As such, I have a few ideas for where things could have gone
>         wrong, and I thought I'd share.
>
>           * When working on the VirtualBlox Manager, under Network, I
>             only have one option, and that's for Adapter 1. I selected
>             Bridged Adapter, the Name is en0: Wi-Fi (Airport), which
>             was the default, and the only other options I have are for
>             Promiscuous Mode (scandalous!), the Mac Address, and a
>             checkbox for "Cable connected". Pretty sure I didn't touch
>             any of those, so I'm feeling good about those. However, in
>             the VM setup instructions under B.5.d.ii, I couldn't set a
>             virtual adapter because I have no option/availability to
>             do so. All of the non-used Adapters listed (2-4) are
>             grayed out and cannot be selected. I presume that's by
>             design via the  VirtualBox software or my hardware, so I
>             just skipped it.
>           * Section D.3, that's where I'm guessing the real issue is.
>             AFAICT I only have 1 Adapter (see my notes above RE:
>             B.5.d.ii), and I keep getting a "hey you can't run 2 auto
>             loads of eth0" error if I don't use eth1, so my thinking
>             is/was I'd have a /etc/network/interfaces file that looks
>             like this:
>
>         auto lo
>         iface lo inet loopback
>
>         auto eth0
>         allow-hotplug eth0
>         iface eth0 inet dhcp
>
>         auto eth1
>         iface eth1 inet static
>         address 192.168.56.2
>         gateway 192.168.56.1
>         netmask 255.255.255.0
>         network 192.168.56.0
>         broadcast 192.168.56.255
>
>         Yes, that's actually what's in my /etc/network/interfaces file
>         right now. It's that last section I'm really wondering about,
>         and hoping that someone can verify yes/no on if I did that
>         correctly. Yes, I did the restart, yes I tried the ifdown's,
>         etc. Mostly I keep getting messages saying it doesn't
>         recognize eth1.
>
>         I'm guessing that since I had apt/etc. working already, once I
>         get past this issue the rest will be a breeze. That's what I'm
>         hoping for, at least.
>
>         Oh! And one more thing... Section E starts off with "Establish
>         a non-console/SSH connection to the local host-only address".
>         Well, the console is my favorite SSH client. :) Is there some
>         funky issue where if I'm attempting to SSH (and assuming this
>         whole time that I should be SSHing via the VM CLI), that
>         that is the problem? Or at least a problem?
>
>         Jon
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/kpug-pm/attachments/20120917/2f056060/attachment-0001.html>


More information about the KPUG-PM mailing list