[SOLVED] Host-only guest not pulling IP address

Discussions related to using VirtualBox on Linux hosts.
Post Reply
nicks_real_name
Posts: 3
Joined: 1. Aug 2015, 17:03

[SOLVED] Host-only guest not pulling IP address

Post by nicks_real_name »

I'm at my wits end here. I'm trying to run a home lab with some VMs but I can't get any of them to pull an IP address with a host-only network configuration.

I don't need the guest to be able to access the internet, just host -> guest and guest -> host.

Firstly, the bidirectional clipboard does not work at all so I'm going to paraphrase some of the guest output here.

ifconfig on guest:

Code: Select all

eth0
Link encap: Ethernet    HWadr [addr here]
inet6 addr [addr here]
..etc

lo
Link encap: Local loopback
inet addr: 126.0.0.1   Mask: 255.0.0.0
inet6 addr:   ::1/28 Scope: Host
...etc

ifconfig on host:

Code: Select all

$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:90:f5:e8:b0:e0  
          UP 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:65536  Metric:1
          RX packets:10236 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10236 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:679492 (679.4 KB)  TX bytes:679492 (679.4 KB)

vboxnet1  Link encap:Ethernet  HWaddr 0a:00:27:00:00:01  
          inet addr:192.168.57.1  Bcast:192.168.57.255  Mask:255.255.255.0
          inet6 addr: fe80::800:27ff:fe00:1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:363 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:68799 (68.7 KB)

wlan0     Link encap:Ethernet  HWaddr 24:fd:52:c0:1b:b1  
          inet addr:192.168.2.106  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::26fd:52ff:fec0:1bb1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:233843 errors:0 dropped:0 overruns:0 frame:0
          TX packets:156896 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:316670862 (316.6 MB)  TX bytes:17963320 (17.9 MB)

traceroute from host

Code: Select all

 $ traceroute 192.168.57.1
traceroute to 192.168.57.1 (192.168.57.1), 30 hops max, 60 byte packets
 1  localhost (192.168.57.1)  0.018 ms  0.003 ms  0.003 ms
No ipv4 value set:

Code: Select all

$ vboxmanage guestproperty get kali "/VirtualBox/GuestInfo/Net/0/V4/IP"
No value set!
arp -a on host:

Code: Select all

$ arp -a
easy.box (192.168.2.1) at 18:83:bf:88:21:68 [ether] on wlan0

An nmap of vboxnet1 is the same as an nmap of the host (not sure if this means anything)

Code: Select all

$ nmap 192.168.57.1

Starting Nmap 6.40  at 2015-08-01 17:13 CEST
Nmap scan report for localhost (192.168.57.1)
Host is up (0.00020s latency).
Not shown: 998 closed ports
PORT    STATE SERVICE
139/tcp open  netbios-ssn
445/tcp open  microsoft-ds

Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds
$ nmap 192.168.2.106

Starting Nmap 6.40  at 2015-08-01 17:13 CEST
Nmap scan report for localhost (192.168.2.106)
Host is up (0.000093s latency).
Not shown: 998 closed ports
PORT    STATE SERVICE
139/tcp open  netbios-ssn
445/tcp open  microsoft-ds

Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds
Other potentially relevant information:

Code: Select all

$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

$ cat /etc/hosts
127.0.0.1	localhost
127.0.1.1	gulch

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

If I can't finx this then I'm going to reinstall the operating system, this is far to frustrating and I've spent way too much time trying to fix it :/

Thanks for any help :)
Last edited by nicks_real_name on 1. Aug 2015, 18:15, edited 1 time in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Host-only guest not pulling IP address

Post by Perryg »

Are you doing all of this from the command line?

Clipboard will not work until the guest additions are installed in the guest and it requires X being installed on the guest.

It would be easier if you post the following>

1) VBoxManage list hostonlyifs ( from the host terminal )
2) From the hosts terminal type VBoxManage showvminfo <VM Name> --details and post here. Replace <VM Name> with the actual name of the VM. Use " " if the name has a space in it.
3) From the guest terminal post the results of ifconfig -a
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Host-only guest not pulling IP address

Post by Perryg »

Also from the host>

1) VBoxManage list dhcpservers ( from the hosts terminal )
nicks_real_name
Posts: 3
Joined: 1. Aug 2015, 17:03

Re: Host-only guest not pulling IP address

Post by nicks_real_name »

Thanks for the super-quick relpy!

VBoxManage list hostonlyifs

Code: Select all

 $ VBoxManage list hostonlyifs
Name:            vboxnet1
GUID:            786f6276-656e-4174-8000-0a0027000001
DHCP:            Disabled
IPAddress:       192.168.57.1
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:0800:27ff:fe00:0001
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:01
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet1


VBoxManage showvminfo <VM Name> --details

Code: Select all

$ VBoxManage showvminfo kali --details
Name:            kali
Groups:          /
Guest OS:        Debian (64-bit)
UUID:            b1c19157-1ac6-4485-9721-92d2e2f96b90
Config file:     /home/tom/VirtualBox VMs/kali/kali.vbox
Snapshot folder: /home/tom/VirtualBox VMs/kali/Snapshots
Log folder:      /home/tom/VirtualBox VMs/kali/Logs
Hardware UUID:   b1c19157-1ac6-4485-9721-92d2e2f96b90
Memory size:     768MB
Page Fusion:     off
VRAM size:       12MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  1
PAE:             off
Long Mode:       on
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          off
Time offset:     0ms
RTC:             UTC
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     off
VT-x VPID:       on
VT-x unr. exec.: on
Paravirt. Provider: Default
State:           running (since 2015-08-01T15:09:25.285000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address: 
Teleporter Password: 
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration: 
Autostart Enabled: off
Autostart Delay: 0
Default Frontend: 
Storage Controller Name (0):            IDE
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
Storage Controller Name (1):            SATA
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      1
Storage Controller Bootable (1):        on
IDE (1, 0): /home/tom/Documents/VMs-OSs/kali-linux-1.1.0a-amd64/kali-linux-1.1.0a-amd64.iso (UUID: 915f3924-2964-451e-8471-71a77426fdd8)
SATA (0, 0): /home/tom/VirtualBox VMs/kali/kali.vdi (UUID: 26409ea4-0a17-4c7c-8122-c3a0072a47a7)
NIC 1:           MAC: 080027CCEF35, Attachment: Host-only Interface 'vboxnet1', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: USB Tablet
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           enabled (Driver: PulseAudio, Controller: AC97, Codec: AD1980)
Clipboard Mode:  Bidirectional
Drag and drop Mode: disabled
Session name:    GUI/Qt
Video mode:      1024x768x32 at 0,0 enabled
VRDE:            disabled
USB:             enabled
EHCI:            enabled
XHCI:            disabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Bandwidth groups:  <none>

Shared folders:  <none>

VRDE Connection:    not active
Clients so far:     0

Video capturing:    not active
Capture screens:    0
Capture file:       /home/tom/VirtualBox VMs/kali/kali.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25

Guest:

Configured memory balloon size:      0 MB
OS type:                             Debian_64
Additions run level:                 0

Guest Facilities:

No active facilities.

VBoxManage list dhcpservers

Code: Select all

$ VBoxManage list dhcpservers
NetworkName:    boot2root
IP:             192.168.0.1
NetworkMask:    255.255.255.0
lowerIPAddress: 192.168.0.2
upperIPAddress: 192.168.0.254
Enabled:        Yes

NetworkName:    HostInterfaceNetworking-vboxnet1
IP:             0.0.0.0
NetworkMask:    0.0.0.0
lowerIPAddress: 0.0.0.0
upperIPAddress: 0.0.0.0
Enabled:        No
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Host-only guest not pulling IP address

Post by Perryg »

Your dhcp server is not setup properly. It is outside the actual IP address range. From the looks of it you are trying to *not* use the defaults but you really should. Below are what they should be.

Code: Select all

VBoxManage list hostonlyifs
Name:            vboxnet0
GUID:            786f6276-656e-4074-8000-0a0027000000
DHCP:            Disabled
IPAddress:       192.168.56.1
NetworkMask:     255.255.255.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:00
MediumType:      Ethernet
Status:          Down
VBoxNetworkName: HostInterfaceNetworking-vboxnet0

Code: Select all

VBoxManage list dhcpservers
NetworkName:    HostInterfaceNetworking-vboxnet0
IP:             192.168.56.100
NetworkMask:    255.255.255.0
lowerIPAddress: 192.168.56.101
upperIPAddress: 192.168.56.254
Enabled:        Yes
nicks_real_name
Posts: 3
Joined: 1. Aug 2015, 17:03

Re: Host-only guest not pulling IP address

Post by nicks_real_name »

AWESOME! That did the trick. Thanks so much for your help! :D
Post Reply