[Solved] No Network at boot, only Network after resetting guest interface

Discussions about using Linux guests in VirtualBox.
CTimms
Posts: 11
Joined: 16. Oct 2017, 04:55

[Solved] No Network at boot, only Network after resetting guest interface

Post by CTimms »

Hello friends,

I'm running a headless Ubuntu 16.04 Host with a headless Ubuntu 16.04 Virtual Machine Guest. Both machines are configured with Static IPs in bridged mode. However, the guest machine after boot never has an active network. In order for it's IP address to be ping'd I have to RDP from my Windows 10 machine separate machine to the guest VM and run "Sudo /etc/init.d/networking restart". I absolutely need the Guest machine to have internet access at boot.

Code: Select all

Host Machine
/etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp5s0
iface enp5s0 inet static
address 192.168.1.202
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-search cloudspace.local
dns-nameservers 8.8.8.8 8.8.4.4

Code: Select all

Guest Machine - Virtual Machine
/etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback

# Network Interface - Bridged
auto enp0s9
iface enp0s9 inet static
address 192.168.1.210
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
I'm not terribly proficient in Linux, so If I need to provide more details, please let me know.

Thanks!
Last edited by socratis on 20. Oct 2017, 05:13, edited 2 times in total.
Reason: Marked as [Solved].
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: No Network at boot, only Network after resetting guest interface

Post by Perryg »

AFAIK this would be a guest issue and not a VBox issue. I would look at the various log files of the guest and see if it shows any issues since all you need to do is restart the guests network for it to work.
CTimms
Posts: 11
Joined: 16. Oct 2017, 04:55

Re: No Network at boot, only Network after resetting guest interface

Post by CTimms »

It just seems odd that this would not be a virtualbox issue. The guest install is brand new, and during the install it detected the network interface. Honestly I think I misconfigured something on the virtualbox side as this is my first time using virtualbox and my first ever virtual machine. This is a home project and I took all the directions strictly from online sources. I could rebuild a new VM to see if the problem is replicated...
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: No Network at boot, only Network after resetting guest interface

Post by socratis »

CTimms wrote: I could rebuild a new VM to see if the problem is replicated
I was about to suggest that, with one small difference from your original setup. Try it without changing anything in the guest, i.e. try it with the DHCP option enabled. See if you get an IP from your router. Then if everything is working, go for the static IP option.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: No Network at boot, only Network after resetting guest interface

Post by Perryg »

VirtualBox provides the adapter to the guest and that is just about it. Since you say you can achieve success by restarting the network stack on the guest I believe you will find something there but you know best what you need.
CTimms
Posts: 11
Joined: 16. Oct 2017, 04:55

Re: No Network at boot, only Network after resetting guest interface

Post by CTimms »

Setup a new VM and had the exact same results. I am posting the info for the virtual box settings... I think maybe I mis-configured something on the adapter side.
The only thing I changed was on this 2nd VM I set Nicpromisc1 to deny instead of allow-all. But it didnt change the behavior at all.

Code: Select all

Name:   fgvm
Groups:   /
Guest OS:    Ubuntu (32-bit)
UUID:    19e1f653-67ff-48b2-8ccf-f3d2b683512c
Config file:     /home/corey/VirtualBoxVMs/fgvm/fgvm.vbox
Snapshot folder: /home/corey/VirtualBoxVMs/fgvm/Snapshots

Log folder:      /home/corey/VirtualBox VMs/fgvm/Logs
Hardware UUID:   19e1f653-67ff-48b2-8ccf-f3d2b683512c
Memory size:     2048MB
Page Fusion:     off
VRAM size:       12MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  1
PAE:             on
Long Mode:       off
Triple Fault Reset: off
APIC:            on
X2APIC:          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
BIOS APIC mode:  APIC
Time offset:     0ms
RTC:             local time
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     off
VT-x VPID:       on
VT-x unr. exec.: on
Paravirt. Provider: Default
Effective Paravirt. Provider: KVM
State:           powered off (since 2017-10-16T21:52:20.000000000)
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):            SATA Controller
Storage Controller Type (0):            Intel Ahci
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  30
Storage Controller Port Count (0):      30
Storage Controller Bootable (0):        on
SATA Controller (0, 0): /home/corey/virtual_drives/fgvmOS.vdi (UUID: c4390b1a-c79e-4a36-bd94-3c11aba3bbda)
SATA Controller (1, 0): /home/corey/virtual_drives/fgvm.vdi (UUID: 6d261bb0-39c6-4661-a6ee-52d6d605a9cb)
SATA Controller (2, 0): Empty
NIC 1:           MAC: 080027A2E4F2, Attachment: Bridged Interface 'enp5s0', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 1000 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: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
UART 3:          disabled
UART 4:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           disabled
Clipboard Mode:  disabled
Drag and drop Mode: disabled
VRDE:            enabled (Address 0.0.0.0, Ports 5001, MultiConn: off, ReuseSingleConn: off, Authentication type: null)
Video redirection: disabled
VRDE property: TCP/Ports  = "5001"
VRDE property: TCP/Address = <not set>
VRDE property: VideoChannel/Enabled = <not set>
VRDE property: VideoChannel/Quality = <not set>
VRDE property: VideoChannel/DownscaleProtection = <not set>
VRDE property: Client/DisableDisplay = <not set>
VRDE property: Client/DisableInput = <not set>
VRDE property: Client/DisableAudio = <not set>
VRDE property: Client/DisableUSB = <not set>
VRDE property: Client/DisableClipboard = <not set>
VRDE property: Client/DisableUpstreamAudio = <not set>
VRDE property: Client/DisableRDPDR = <not set>
VRDE property: H3DRedirect/Enabled = <not set>
VRDE property: Security/Method = <not set>
VRDE property: Security/ServerCertificate = <not set>
VRDE property: Security/ServerPrivateKey = <not set>
VRDE property: Security/CACertificate = <not set>
VRDE property: Audio/RateCorrectionMode = <not set>
VRDE property: Audio/LogPath = <not set>

USB:             disabled
EHCI:            disabled
XHCI:            disabled

USB Device Filters:<none>
Bandwidth groups:  <none>
Shared folders:  <none>
Video capturing:    not active
Capture screens:    0
Capture file:       /home/corey/VirtualBox VMs/fgvm/fgvm.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25
Guest:
Configured memory balloon size:      0 MB
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: No Network at boot, only Network after resetting guest interface

Post by socratis »

I don't see anything wrong with the setup. Does 'enp5s0' exist?
  • Follow a "start the VM from cold-boot" / "observe error" (re-start the network so you get an IP) / "shutdown the VM" cycle.
  • With the VM shut down completely (not paused or saved), right-click on the VM in the VirtualBox Manager and select "Show Log".
  • Save only the first "VBox.log", ZIP it and attach it to your response (see the "Upload attachment" tab below the reply form).
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
CTimms
Posts: 11
Joined: 16. Oct 2017, 04:55

Re: No Network at boot, only Network after resetting guest interface

Post by CTimms »

enp5s0 is one of two GB ports on my Poweredge 2950. The other port is enp9s0.
I have configured and connected the 2nd port, then set the bridgeadapter1 to enp9s0 and still get the same results.
Below is the Host /etc/network/interfaces file

Code: Select all

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp5s0
iface enp5s0 inet static
address 192.168.1.202
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-search cloudspace.local
dns-nameservers 8.8.8.8 8.8.4.4

# Secondary Network Interface
auto enp9s0
iface enp9s0 inet static
address 192.168.1.203
netmask 255.255.255.0
This next code is from the hwinfo of the host, specifically relating to the network cards.

Code: Select all

  net interface: name = enp5s0, path = /class/net/enp5s0
    type = 1
    carrier = 1
    hw_addr = 00:19:b9:b7:ef:ca
    net device: path = /devices/pci0000:00/0000:00:1c.0/0000:04:00.0/0000:05:00.0
    net driver: name = bnx2, path = /bus/pci/drivers/bnx2
    ethtool private flags: 0
  net interface: name = enp9s0, path = /class/net/enp9s0
    type = 1
    carrier = 1
    hw_addr = 00:19:b9:b7:ef:cc
    net device: path = /devices/pci0000:00/0000:00:02.0/0000:06:00.0/0000:07:00.0/0000:08:00.0/0000:09:00.0
    net driver: name = bnx2, path = /bus/pci/drivers/bnx2
    ethtool private flags: 0
A cold boot gives me all "green" [OK] next to each boot item, including raise network interfaces.

Both the host and the guest are headless systems, so I don't have a GUI manager to show the log, but I assume it would be the file... /home/corey/VirtualBox VMs/fgvm/Logs/VBox.log - Which I attached.

Thanks for all the help.
Attachments
VBox.zip
(20.52 KiB) Downloaded 15 times
Last edited by socratis on 18. Oct 2017, 23:46, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
CTimms
Posts: 11
Joined: 16. Oct 2017, 04:55

Re: No Network at boot, only Network after resetting guest interface

Post by CTimms »

One thing I haven't tried is a different NicType. The one I chose was "recommended" for bridged mode on some site I found via google. I could revert to the default or another type if you guys recommend something else?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: No Network at boot, only Network after resetting guest interface

Post by socratis »

CTimms wrote:The one I chose was "recommended" for bridged mode on some site I found via google.
There is no such thing as a "recommended for Bridged mode" card. There is a "recommended for the specific OS based on the template" card. Primarily what's supported out of the box for each OS. So, you should stick to the defaults, as suggested from the template. The developers really know better compared to a random site/blogger...

For an Ubuntu guest, that would be the "Intel PRO/1000 MT Desktop", which is I believe what you have selected already, so that's not your smoking gun.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: No Network at boot, only Network after resetting guest interface

Post by Perryg »

Do a clean (cold) boot of the guest and then run the following:

Code: Select all

hwinfo | grep "net interface"
and 
lspci
then
ifconfig -a
Post this here.

I don't need any host information yet.
CTimms
Posts: 11
Joined: 16. Oct 2017, 04:55

Re: No Network at boot, only Network after resetting guest interface

Post by CTimms »

I'm attaching a JPG of the output from those commands, since I couldn't copy and paste from the RDP and I couldn't SSH to the VM with the network not functioning.
Attachments
NetCapture.JPG
NetCapture.JPG (90.41 KiB) Viewed 11214 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: No Network at boot, only Network after resetting guest interface

Post by Perryg »

So the guest sees the adapter provided by VirtualBox but fails to initiate it. So let's do another thing. Remove the static address information and put it back to dhcp then do a clean boot of the guest. Does it receive an IP address? If not then run the command "ifconfig enp0s3 up" and run the ifconfig -a again. Does it receive an IP address?
CTimms
Posts: 11
Joined: 16. Oct 2017, 04:55

Re: No Network at boot, only Network after resetting guest interface

Post by CTimms »

It already was at DHCP when I sent that screenshot.

cold reboot again and the following output (see attachment).

*EDIT* I didn't reboot, I powered down and powered it back up.
Attachments
NewNetCapture.JPG
NewNetCapture.JPG (88.53 KiB) Viewed 11206 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: No Network at boot, only Network after resetting guest interface

Post by Perryg »

So if I get you right you never edited the interface file on this install like you did the others setting it to static, correct?

Can you post a screen shot of the interfaces file?

Oh and can you run dhclient after a reboot and see if it forces a renewal and actually receives an IP?
Post Reply