In VirtualBox, LXC containers do not receive DHCP IP OFFER when using bridged connection

midix

New Member
Mar 5, 2018
7
0
1
44
I have a similar issue to
https://forum.proxmox.com/threads/proxmox-on-local-network-no-ip-for-the-containers.36353/
But my environment might be slightly different, so I decided to create a new thread.

I installed Proxmox 5.1 into VirtualBox 5.1 (nice coincidence).

I had captured screenshots of all settings and messages, but cannot post them because I'm a new member.

My VirtualBox machine's network adapter is directly bridged to physical adapter which connects to my router.

During install, I just entered root password, domain as proxmox.local, IP set to static 192.168.1.103 and clicked Next Next Finish.

Proxmox web UI shows for node Network settings:

enp0s3 - Network device; in properties has all fields empty
vmbr0 - Linux bridge; in properties has the following:

Name: vmbr0
IP Address: 192.168.1.0.3
Subnet mask: 255.255.255.0
Gateway: 192.168.1.1
Autostart: checked
VLAN aware: unchecked
Bridge ports: enp0s3
Other fields empty.

Then I downloaded ubuntu 16.04 and 17.04 container templates using pveam download command on directly on my new Proxmox server. Created a container using ubuntu 16.04 template, In network settings changed it to use DHCP instead of Static IP, other settings left default - name eth0, Bridge vmbr0, VLAN tag: no VLAN, Firewall unchecked.

The machine started fine, although I could not attach to Console for a few minutes - showed just blank screen. Then finally I attached and entered

Code:
ip a

but got only autogenerated IPv6 address and no IPv4 address.

Luckily, I got to my router's (cheap TP-LINK TL-WR740N / TL-WR740ND) system log and I did not see any new IPs in router's DHCP client list, but here's what I saw in router's log:
Code:
170 Mar 5 17:49:50 DHCP NOTICE DHCPS:Send OFFER with ip 192.168.1.101
169 Mar 5 17:49:50 DHCP NOTICE DHCPS:Recv DISCOVER from 5E:BB:BE:29:E1:E5
168 Mar 5 17:49:37 DHCP NOTICE DHCPS:Send OFFER with ip 192.168.1.101
167 Mar 5 17:49:37 DHCP NOTICE DHCPS:Recv DISCOVER from 5E:BB:BE:29:E1:E5

The MAC address is the same as for the new LXC container.

Digging deeper, I ran:
Code:
journalctl | grep -Ei 'dhcp'
in the container console, and the result had lots of messages like
Code:
DHCPDISCOVER on eth0 to 255.255.255 port 67 interval (some random number each time)
and ended with
Code:
No DHCPOFFERS received.

So, clearly the container sends DHCP requests to my router and my router responds with an offer, but the container never acknowledges the offer.

But when I then stopped the container and replaced DHCP with static IP 192.168.1.101/24 and netmask 255.255.255.0, then networking started normally, and also Proxmox console was ready much faster. I suspect that with DHCP, the console is not ready while the container is stuck requesting an IP address until it gives up.

I tried also Ubuntu 17.04 - the same result. Also tried
Code:
dhclient -r eth0
dhclient eth0
- it hangs for long time again spamming my router with DHCPS:Recv DISCOVER.

In contrast, if I use Ubuntu 17.04 image in a new VirtualBox machine and set it to DHCP, it works immediately and my router shows:
Code:
32 Mar 5 18:09:16 DHCP NOTICE DHCPS:Send ACK to 192.168.1.106
31 Mar 5 18:09:16 DHCP NOTICE DHCPS:Recv REQUEST from 08:00:27:DF:0A:91
30 Mar 5 18:09:16 DHCP NOTICE DHCPS:Send OFFER with ip 192.168.1.106
29 Mar 5 18:09:15 DHCP NOTICE DHCPS:Recv DISCOVER from 08:00:27:DF:0A:91

So, in normal conditions DHCPS requests / responses are correctly routed to/from VirtualBox guests and my router. There might be something missing for Proxmox bridge itself - why does it let DHCP requests to pass from the container to my router but does not route the response OFFER back?

Most probably, I will reconfigure Proxmox to use its internal network and DHCP and NAT the host IP to internal containers, but at this point I'm not sure if that advanced setup will work at all if I'm unable to get the "simple" bridged approach router <-> physical host network adapter <-> Proxmox bridge <-> LXC container running.
 
I think it is actual

router being DHCP server <-> physical host <-> VirtualBox <-> VBox guest running Proxmox VE <-> Proxmox bridge <-> LXC

That is based upon
installed Proxmox 5.1 into VirtualBox 5.1

@midix : start with getting a DHCP offer for VBox guestsss

Or even better remove VirtualBox from the chain and enjoy Proxmox ...
 
DHCP for VBox guests work as expected - as I told, I tried installing a Ubuntu Server 17.04 image (which should be similar to the same 17.04 template I installed in LXC container) directly on VirtualBox and DHCP worked immediately for this installation.

Essentially this works fine:

router being DHCP server <-> physical host <-> VirtualBox bridged to physical host adapter <-> VBox guest running Ubuntu Server 17.04

Router receives DISCOVER, sends OFFER and receives REQUEST and sends ACK


But this does not work:

router being DHCP server <-> physical host <-> VirtualBox bridged to physical host adapter <-> VBox guest running Proxmox VE <-> Proxmox bridge <-> LXC running Ubuntu Server 17.04


Router receives DISCOVER, sends OFFER but does not receive REQUEST, and LXC behaves as if OFFER was not received.
 
Mmm, strange.
My first thought was "the ethernet broadcasts get through"

Checking some PCAP files I have kept from some completely unrelated DHCP sessions,
show that the DHCP REQUEST is also transmitted as an ethernet broadcast.

Thing to try:
Give the proxmox guest a realtek NIC instead of virtio.

Please report back
 
Actually the VirtualBox guest (running Proxmox) had Intel Pro/1000 MT adapter by default. Now I tested with "Paravirtualized Network (virtio-net)" but got exactly the same results.

I'll test how real virtual machines inside Proxmod work because I Proxmod does not show network adapter choices for LXC containers.

VirtualBox does not support full nested virtualization because I get
Code:
KVM virtualisation configured, but not available. Either disable in VM configuration or enable in BIOS.
when attempting to start a VM but it seems I should be able to do it just for experiment purposes with disabled KVM virtualization in nested VM settings.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!