Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Setup network interface for GCE exported VM

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
waniel
Posts: 4
Joined: 2022-12-28 20:34

Setup network interface for GCE exported VM

#1 Post by waniel »

Hello Debian Forum,

I have a Debian 10 server running on the GCE (Google Cloud Engine) that runs an Apache web server. I created a snapshot of the server and exported that as an image (vmdk) and have that setup in VirtualBox on my Development Laptop (running Mint). I can boot into the system fine, however it has no network interfaces.

Code: Select all

root@debian:/# ls /sys/class/net/
lo
root@debian:/# cat /etc/network/interfaces
# Include files from /etc/network/interfaces.d
source-directory /etc/network/interfaces.d

# Cloud images dynamically generate config fragments for newly
# attached interfaces. see /etc/udev/rules.d/75-cloud-ifupdown.rules
# and /etc/network/cloud-ifupdown-helper. Dynamically generated
# configuration fragments are stored in /run:
source-directory /run/network/interfaces.d
There are no files in the interfaces.d and I don't think the udev rule is even applicable as the VM is no longer in the GCE environment.

I know that for general VM dev setup I would want a static ip setup, but I have a lot to brush up on as it pertains to networking. I am looking setup an interface that will work with a basic bridged connection from VirtualBox.

I commented out the two source-directory calls from /etc/network/interfaces and added the following:

Code: Select all

auto wlp1s0
allow-hotplug wlp1s0
iface wlp1s0 inet dhcp
wlp1s0 is the name of the adapter from my VirtualBox VM Settings for the bridged adapter. Then restart networking:

Code: Select all

root@debian:/# systemctl restart networking
Job for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xe" for details.
root@debian:/# systemctl status networking.service
` networking.service - Raise network interfaces
    Loadedf: loaded(...)
    Active: failed (Result: exit-code) ...
      Docs: man:interfaces(5)
   Process: ...
   Main PID: ...
...
debian systemd[1]: Failed to start Raise network interfaces.
I have also tried adding the mac address provided by VirtualBox VM settings to the /etc/network/interfaces

Code: Select all

auto wlp1s0
allow-hotplug wlp1s0
iface wlp1s0 inet dhcp
    hwaddress ether 00:11:22:33:44:55
Where then I get a slightly more descriptive message from

Code: Select all

root@debian:/# systemctl status networking.service
` networking.service - Raise network interfaces
    Loadedf: loaded(...)
    Active: failed (Result: exit-code) ...
      Docs: man:interfaces(5)
   Process: ...
   Main PID: ...
...
debian systemd[1]: Starting Raise network interfaces...
debian ifup[4468]: Cannot find device "wlp1s0"
debian ifup[4468]: ifup: failed to bring up wlp1s0
...
debian systemd[1]: Failed to start Raise network interfaces.
In my research I have read that setting up bridged networks in VirtualBox on a Laptop Host using Wifi might cause issues. But I cannot even get the interface up, so I am not sure that is where I am stuck.

Please let me know if there steps that I missed or anything that I am fundamentally not understanding. Thanks for any help or direction! :D

Aki
Global Moderator
Global Moderator
Posts: 2816
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 68 times
Been thanked: 382 times

Re: Setup network interface for GCE exported VM

#2 Post by Aki »

Hello,
waniel wrote: 2022-12-28 22:25

Code: Select all

root@debian:/# systemctl status networking.service
` networking.service - Raise network interfaces
    Loadedf: loaded(...)
    Active: failed (Result: exit-code) ...
      Docs: man:interfaces(5)
   Process: ...
   Main PID: ...
...
debian systemd[1]: Starting Raise network interfaces...
debian ifup[4468]: Cannot find device "wlp1s0"
debian ifup[4468]: ifup: failed to bring up wlp1s0
...
debian systemd[1]: Failed to start Raise network interfaces.
It looks like the name of the network interface is not recognized: what is the output of the ip command ?
Have you checked the system logs about other clues ?
The GCE kernel could not have the required network kernel modules: have you installed a "not-cloud" (standard) debian kernel ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

waniel
Posts: 4
Joined: 2022-12-28 20:34

Re: Setup network interface for GCE exported VM

#3 Post by waniel »

@Aki Thanks for your response,

Code: Select all

root@debian:/# ip link show
1: lo: <LOOPBACK, UP, LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
	link/loopback 00:00:00:00:00:00 brb 00:00:00:00:00:00
root@debian:/# 
I Less'd through syslog, but wasn't seeing anything that referenced network. Will have more time to look this week.

Lastly I do have a debian kernal to use yes. I was able to load into the file system from recovery and that does have network access:

Code: Select all

root@debian:/# ip link show
1: lo: <LOOPBACK, UP, LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
	link/loopback 00:00:00:00:00:00 brb 00:00:00:00:00:00
2: enp0s3: <BROADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
	link/ether 08:00:27:41:2f:8e brd ff:ff:ff:ff:ff:ff
root@debian:/# 
Is there a way to install the required network drivers that my GCE image would need?

Aki
Global Moderator
Global Moderator
Posts: 2816
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 68 times
Been thanked: 382 times

Re: Setup network interface for GCE exported VM

#4 Post by Aki »

Hello,

As you can see, the name of the network interface in the output of ip command does not match the name in the /etc/network/interfaces configuration file.

Before installing a new kernel, can you check how your network adapters are recognized by the kernel in use ?
You could use the following command:

Code: Select all

script log.txt
lspci -vvv 
exit
The output of the previous commands will be in the log.txt file.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

waniel
Posts: 4
Joined: 2022-12-28 20:34

Re: Setup network interface for GCE exported VM

#5 Post by waniel »

@Aki

Thank you for your patience, been a busy past few weeks. After running the commands on the VM I was unable to retrieve the file itself from the VM, but I was able to snip the log file together from a less command, then used a text extractor to get the following:

(might not be a perfect, but I tried to make sure it was correct)


Code: Select all

Script started on 2023-01-11 16:18:55+00:00 [TERM="linux"_TTY="/dev/tty1" COLUMNS="80" LINES="25"]
root@debian: /home/ftbadmin# lspci -www.
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
    Control: I/O- Mem- BusMaster- SpecCycle- MemWINU- UGASnoop- ParErr- Stepping- SERR- FastB2B- Dis INTX-
    Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEUSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTX-

00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton III
    Control: I/0+ Mem+ BusMaster+ SpecCycle- MemWINU- VGASnoop- ParErr- Stepping- SERR- FastB2B- Dis INTX-
    Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEUSEL=medium >TAbort- <TAbort <MAbort->SERR- <PERR- INTX-
    Latency: 0

00:01.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01) (prog-if 8a [ISA Compatibility mode controller, supports both channels switched to PCI native mode, supports bus mastering 1)
    Control: I/0+ Mem+ BusMaster+ SpecCycle- MemWINU- UGASnoop- ParErr- Stepping- SERR- FastB2B- Dis INTX-
    Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEUSEL=fast >TAbort- <TAbort-<MAbort- >SERR- <PERR- INTX-
    Latency: 64
    Region 0: [virtual] Memory at 000001f0 (32-bit, non-prefetchable) [size=8]
    Region 1: [virtual] Memory at 000003f0 (type 3, non-prefetchable)
    Region 2: [virtual] Memory at 00000170 (32-bit, non-prefetchable) [size=8]
    Region 3: [virtual] Memory at 00000370 (type 3, non-prefetchable)
    Region 4: I/O ports at 1000 [size=16]
    Kernel driver in use: ata_piix
    Kernel modules: ata_piix, ata_generic

00:02.0 VGA compatible controller: VMware SVGA II Adapter (prog-if 00 [VGA controller])
    Subsystem: VMware SUGA II Adapter
    Control: I/0+ Mem+ BusMaster- SpecCycle- MemWINU- UGASnoop- ParErr- Stepping- SERR- FastB2B- Dis INTX-
    Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEUSEL=fast >TAbort- <TAbort-KMAbort- >SERR- <PERR- INTX-
    Interrupt: pin A routed to IRQ 10
    Region 0: I/O ports at d010 [size=16]
    Region 1: Memory at e0000000 prefe ble) [size=16M]
    Region 2: Memory at f0000000 (32-bit, non-prefetchable) [size=2M]
    [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]

00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
    Subsystem: Intel Corporation PRO/1000 MT Desktop Adapter
    Control: I/0+ Mem+ BusMaster- SpecCycle- MemWINU- VGASnoop- ParErr- Step\ping- SERR- FastB2B- Dis INTX-
    Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEUSEL=medium >TAbort- <TAbort<MAbort- >SERR- <PERR- INTX-
    Interrupt: pin A routed to IRQ 9
    Region 0: Memory at f0200000 (32-bit, non-prefetchable) [size=128K]
    Region 2: I/O ports at d020 [size=8]
    Capabilities: -,D3cold-)[dc] Power Management version 2
        Flags: PMEC1k- DSI+ D1- D2- AuxCurrent=0mA PME (DO-, D1, D2-, D3hot
        Status: DO NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [e4] PCI-X non-bridge device
        Command: DPERE- ERO+ RBC=512 OST=1
        Status: Dev=ff:1f.0 64bit- 133MHz- SCD- USC- DC=simple DMMRBC=20 48 DMOST=1 DMCRS=8 RSCEM- 266MHz- 533MHz-

00:04.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service
    Control: I/0+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Dis INTX-
    Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEUSEL=fast >TAbort- <TAbort-KMAbort- >SERR- <PERR- INTX-
    Interrupt: pin A routed to IRQ 11
    Region 0: I/O ports at 1040 [size=32]
    Region 1: Memory at f0400000 (32-bit, non-prefetchable) [size=4M]
    Region 2: Memory at f0800000 (32-bit, prefetchable) [size=16K]

00:05.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)
    Subsystem: Dell 82801AA AC'97 Audio Controller
    Control: I/O0+ Mem- BusMaster- SpecCycle- MemWINU- UGASnoop- ParErr- Stepping- SERR- FastB2B- Dis INTX-
    Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEUSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTX-
    Interrupt: pin A routed to IRQ 11
    Region 0: I/O ports at d100 [size=256]
    Region 1: I/O ports at d200 [size=64]

00:06.0 USB controller: Apple Inc. KeyLargo/Intrepid USB (prog-if 10 [OHCI])
    Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Dis INTX-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEUSEL=fast >TAbort- <TAbort-KMAbort- >SERR- <PERR- INTX-
    Interrupt: pin A routed to IRQ 10
    Region 0: Memory at f0804000 (32-bit, non-prefetchable) [size=4K]

00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
    Control: I/0+ Mem- BusMaster- SpecCycle- MemWINU- UGASnoop- ParErr- Stepping- SERR- FastB2B- Dis INTX-
    Status: Cap- 66MHz- UDF- Fast B2B+ ParErr- DEUSEL=medium >TAbort- <TAbort- <MAbort->SERR- <PERR- INTX-
    Interrupt: pin A routed to IRQ 9

00:00.0 SATA controller: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] (rev 02) (prog-if 01 [AHCI 1.0])
    Control: I/0+ Mem+ BusMaster+ SpecCycle- MemWINU- VGASnoop- ParErr- Stepping- SERR- FastB2B- Dis INTX-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEUSEL=fast >TAbort- <TAbort-<MAbort- >SERR- <PERR- INTX-
    Latency: 0
    Interrupt: pin A routed to IRQ 11
    Region 0: I/O ports at d240 [size=8]
    Region 1: I/O ports at d248 [size=4]
    Region 2: I/O ports at d250 [size=8]-,D3cold-)
    Region 3: I/O ports at d258 [size=4]
    Region 4: I/O ports at d260 [size=16]
    Region 5: Memory at f0806000 (32-bit, non-prefetchable) [size=8K]
    Capabilities: [70] Power Management version 3
        Flags: PMEC1k- DSI- D1- D2- AuxCurrent=0mA PME (DO-, D1, D2, D3hot
        Status: DO NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [a8] SATA HBA v1.0 BAR4 Offset=00000002

root@debian: /home/ftbadmin# exit
exit

Script done on 2023-01-11 16:19:18+00:00 [COMMAND_EXIT_CODE="0"]
(END)

Aki
Global Moderator
Global Moderator
Posts: 2816
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 68 times
Been thanked: 382 times

Re: Setup network interface for GCE exported VM

#6 Post by Aki »

Hello,
The VM's network interface is recognized as reported in the previous log:

Code: Select all

00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
There's probably a mismatch of network adapter's name between the name assigned by the kernel and the name specified in /etc/network/interfaces (used for basic network configuration by the OS). If it is confirmed, it could be solved updating the name of the network adapted in /etc/network/interfaces and restarting the OS.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

waniel
Posts: 4
Joined: 2022-12-28 20:34

Re: Setup network interface for GCE exported VM

#7 Post by waniel »

Hello @Aki

Thanks for the response. Yes, that is what I thought in the beginning. Is the name different from what Virtual Box displays in the settings. I have tried a few setups, but right now I am looking at a bridged adapter who's name is wlp1s0.

I have tried a lot of combinations bellow and am now trying to find the most basic setup for my interfaces file. Still cannot find the interface named wlp1s0.

Settings:
Attached to: Bridged Adapter
Name: wlp1s0
Advanced
Adapter Type: Intel PRO/1000 MT Desktop (82540EM)
Promiscuous Mode: Deny
MAC Address: 0800271DB7AA
[x] Cable Connected

Code: Select all

auto lo
iface lo inet loopback

auto wlp1s0
iface wlp1s0 inet dhcp

Post Reply